Skip to content

jean-pasquier/secure-fastapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Secure Fast API

Fast API blueprint that implements Oauth bearer token with OAuth scopes on a "multiple files" application with API Routers.

Database is mocked as Python memory lists.

How to

poetry install --with dev
source .venv/bin/activate

# you should save it somewhere safe, eg in a .env
export JWT_SECRET_KEY=$(openssl rand -hex 32)
uvicorn src.main:app --reload

Visit 127.0.0.1:8000/docs

Use case example

  1. Bob authenticates (user bob, password secret)
  2. Bob cannot manipulate items since he is admin
  3. Bob can create a new user Mike with type manager
  4. Bob provides to Mike the generated password
  5. Mike can connect and plays with his items
  6. Alice can only review her items
  7. Bob can list everyone's all items

About

Fast API blueprint with Bearer token OAuth implementation using API Routers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages