https://github.com/guyshilo/accessservice
https://github.com/guyshilo/accessservice
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/guyshilo/accessservice
- Owner: guyShilo
- Created: 2021-12-14T21:11:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-17T08:03:43.000Z (over 4 years ago)
- Last Synced: 2025-03-15T10:42:55.554Z (over 1 year ago)
- Language: TypeScript
- Size: 196 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[circleci-image]: https://img.shields.io/circleci/build/github/nestjs/nest/master?token=abc123def456
[circleci-url]: https://circleci.com/gh/nestjs/nest
## Description
Access Service built with [Nest](https://github.com/nestjs/nest) framework TypeScript starter repository.
## Running the app
```bash
# Docker
$ docker-compose up
# The service will be running on localhost:3000
```
# Routes
```
POST /
```
- Given an authenticated user request (which contains the userId) and a list of required permissions, generate a new api key for the user.
```json
# Example
{
"userId": "5df66399592878d7d80dad38",
"permissions": [
"read",
"write"
]
}
```
```json
# With all the following requests please include Authorization Bearer in the request headers.
```
```
POST /authenticate
```
1. generate a new signed JWT token for the user with the pre-defined set of permissions
2. Update the "last usage" date of that token
```
DELETE /{:id}
```
- Given an authenticated user request and an API token, revoke the usage of that token.
```
GET /
```
- Given an authenticated user request, get all the tokens of that user in an obstructed form (showing only the last 4 chars, like a credit card) with their status and last recently used date.
Nest is [MIT licensed](LICENSE).