Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/node-casbin/nest-authz-example
Node-Casbin authorization example for Nest.js via auth middleware: https://github.com/node-casbin/nest-authz
https://github.com/node-casbin/nest-authz-example
abac auth authz casbin javascript js middleware nest nestjs node node-casbin nodejs permissions rbac ts typescript
Last synced: 2 months ago
JSON representation
Node-Casbin authorization example for Nest.js via auth middleware: https://github.com/node-casbin/nest-authz
- Host: GitHub
- URL: https://github.com/node-casbin/nest-authz-example
- Owner: node-casbin
- License: mit
- Created: 2020-05-17T10:11:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-03-24T10:10:56.000Z (10 months ago)
- Last Synced: 2024-04-21T22:39:24.402Z (9 months ago)
- Topics: abac, auth, authz, casbin, javascript, js, middleware, nest, nestjs, node, node-casbin, nodejs, permissions, rbac, ts, typescript
- Language: TypeScript
- Homepage: https://github.com/node-casbin/nest-authz
- Size: 1.92 MB
- Stars: 17
- Watchers: 2
- Forks: 5
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nest-authz-example
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
## Description
A demo shows how to use nest-authz to implement role-based access control.
## Installation
```bash
$ npm install
```## Running the app
```bash
# development
$ npm run start# watch mode
$ npm run start:dev# production mode
$ npm run start:prod
```Open [http://localhost:3000/api](http://localhost:3000/api) to see api.
The api uses Bear auth schema, so if you want to access protected api, you should click the `Authorize` button and set `Bearer yourjwttoken` after login.## Test
```bash
# unit tests
$ npm run test
```## License
[MIT licensed](LICENSE).