A simple permissioning service that can add, and validate permissions for resources.
The relationship among USER, ROLE and PERMISSIONS is as follows:
- USERs can have multiple ROLEs, e.g. Reader
- ROLEs consist of multiple PERMISSIONs, and each ROLE define access for one or multiple resources, e.g. READ BlogPosts, WRITE Comments
- PERMISSIONs denote the access level, e.g. READ, WRITE
The ER Diagram may make more sense
We are allowing a few endpoints to perform actions
POST /api/signup
- Signup as a userPOST /api/login
- Login as a valid userGET /api/users/:userId/roles
- List all the roles added to a user denoted byuserId
POST /api/users/:userId/roles
- Add a list of roles for a user denoted byuserId
GET /api/roles
- List all available rolesPOST /api/roles
- Create a new role, with a list of permissions
GET /api/permissions
- List all available permissionsPOST /api/permissions
- Create a new permission
You need to have Docker and docker-compose
installed to run this project locally.
Clone Repository
git clone [email protected]:goldenrati0/auth-service.git
Navigate to project directory
cd auth-service/
Start project with docker-compose
docker-compose up
After the containers have started successfully, you will be able to access the server browsing
http://127.0.0.1:3000/
If anything goes wrong, download from here