Python module to add username and password authentication to specific FastAPI routes
Project description
FastAPIUIAuth
Python module to add username and password authentication to specific FastAPI routes
Platform Supported
Deployments
Installation
pip install FastAPI-UI-Auth
Usage
import uiauth
from fastapi import FastAPI
from fastapi.routing import APIRoute
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,
routes=APIRoute(
path="/private",
endpoint=private_route
)
)
FastAPI-UI-Authsupports bothAPIRouteandAPIWebSocketRouteroutes.
Refer samples directory for different use-cases.
Coding Standards
Docstring format: Google
Styling conventions: PEP 8 and isort
Release Notes
Requirement
python -m pip install gitverse
Usage
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
Linting
Requirement
python -m pip install sphinx==5.1.1 pre-commit recommonmark
Usage
pre-commit run --all-files
Pypi Package
https://pypi.org/project/FastAPI-UI-Auth/
License & copyright
© Vignesh Rao
Licensed under the MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_ui_auth-0.3.1-py3-none-any.whl.
File metadata
- Download URL: fastapi_ui_auth-0.3.1-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10609526c0081f6addc64d1a9cf5db19ea5dd455b43077759a6b3c2b4c2d590c
|
|
| MD5 |
5a7cd17a9860842bf7eca4a64fb1c729
|
|
| BLAKE2b-256 |
f419f243f877d5a01f75dcb2087a1e8905b276324fbdbd92d4baeeaca82c153a
|