Nostradamus Prophecy Machine

    @personaspace/server-acl-middleware-ondomain
    TypeScript icon, indicating that this package has built-in type declarations

    0.1.2 • Public • Published

    PersonaSpace onDomain ACL Middleware

    For Node.js server

    CircleCI codecov Known Vulnerabilities JavaScript Style Guide

    Node.js server ACL middleware that prevents/allows access based on the host requesting data.

    Installation

    Install @personaspace/server-acl-middleware-ondomain using npm.

    npm i @personaspace/server-acl-middleware-ondomain
    

    Usage

    //  "request" is the web request on a PersonaSpace server.
    import { resolveAcl } from "@personaspace/server-acl";
    import { onDomain } from "@personaspace/server-acl-middleware-ondomain";
    
    const resource = "./ebntly/data/notes/test";
    const identity = "https://ebntly.personaspace.com";
    const defaultAcl = require("../support/default-acl.json");
    const acl = require(`${resource}.json`)["@acl"];
    const groups = require("../support/groups.json");
    const middleware = [onDomain];
    
    resolveAcl({
        acl,
        defaultAcl,
        groups,
        identity,
        resourcePath, 
        request
    }, middleware, (err, resultantPerms) => {
      if(err) throw err;
      //  Check resultantPerms
    });

    Documentation

    Documentation is located at https://personaspace.github.io/node-server-acl-middleware-ondomain. For issues with the documentation, please Create a new issue.

    Contributing to PersonaSpace

    PersonaSpace is a large project and contributors are welcome. Thank you for your support and efforts!

    There are a lot of ways to contribute:

    Be sure to look at CONTRIBUTING.md.

    License

    PersonaSpace is licensed under the MIT License.

    Install

    npm i @personaspace/server-acl-middleware-ondomain

    DownloadsWeekly Downloads

    0

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    8.07 kB

    Total Files

    7

    Last publish

    Collaborators

    • bntly