Python module to add username and password authentication to specific FastAPI routes
Platform Supported
Deployments
pip install FastAPI-UI-Auth
import uiauth
from fastapi import FastAPI
app = FastAPI()
@app.get("/public")
async def public_route():
return {"message": "This is a public route"}
async def private_route():
return {"message": "This is a private route"}
uiauth.protect(
app=app,
params=uiauth.Parameters(
path="/private",
function=private_route
)
)
FastAPI-UI-Auth
supports bothAPIRoute
andAPIWebSocketRoute
routes.
Refer samples directory for different use-cases.
Docstring format: Google
Styling conventions: PEP 8
and isort
Requirement
python -m pip install gitverse
Usage
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
Requirement
python -m pip install sphinx==5.1.1 pre-commit recommonmark
Usage
pre-commit run --all-files
https://pypi.org/project/FastAPI-UI-Auth/
© Vignesh Rao
Licensed under the MIT License