A simple authentication service built with: - FastAPI (Python) - JSON Web Token authentication - BCrypt for hashing and salting passwords - PostgreSQL database
To run the project use the following commands: (you need to have DOCKER installed - https://www.docker.com/products/docker-desktop)
- docker-compose build
- docker-compose up
- '/register' : Register a new user account
- '/login' : Login with username and password (this returns an access_token which you'll need to pass in the 'Authorization' header with value: 'Bearer <your-access-token-here>' to be able to use the other routes)
- '/status' : Only returns a json object -> {"status": "ok"} if you have a valid token
- '/users/me/items' : Returns the current user and a list of items that belongs to it /the list is only a placeholder for now/
To see the interactive docs visit: http://localhost:8001/docs
Here you will get SWAGGER UI and can interact with the API Authorization doesn't work from this UI - for that you need to use Postman or similar to pass in the access_token as the Authorization header's value
- Open a terminal window
- Run command: $ openssl rand -hex 32
- And paste your key as the value for the SECRET_KEY variable in utils.py