This repository contains a number of Node.js applications, each demonstrates a different approach to implementing Resource-Based Authorization (RBAC) for a simple HTTP API.
To run an example, cd to its directory and run:
npm install
npm start
To test the application, you can make a set of requests to the routes and check the responses:
curl -X <HTTP Verb> --location 'http://localhost:8080/api/<asset>' \
--header 'Content-Type: application/json' \
--data-raw '{
"user": {
"id": "[email protected]"
}
}'
Where <HTTP Verb>
is either GET
, PUT
, or DELETE
and <asset>
is either megaSeeds
or timeCrystals
.