0.2.0 • Published 4 years ago

extended-router-acl v0.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Extended Router ACL

Resource based Express ACL Middleware

index.ts

import express from 'express';
import { authorize, config } from 'extended-router-acl';

const app = express();

config({
  file: 'acl.yml',
});

app.use(authorize);

app.use('/', (req, res) => res.send({ ... }));
app.use('/books', (req, res) => res.send({ ... }));

app.listen(3000);

acl.yml

- resource: /
  permissions:
    public:
      - GET
- resource: /books
  permissions:
    admin:
      - GET
      - POST
      - DELETE

Install

npm install extended-router-acl

Features

  • Resource based ACL
  • Public route handling
  • Hooking functions

Docs

soon

License

MIT

0.2.0

4 years ago

0.1.0

4 years ago