Skip to main content

Python module to add username and password authentication to specific FastAPI routes

Project description

FastAPIAuthenticator

Python module to add username and password authentication to specific FastAPI routes

Python

Platform Supported

Platform

Installation

repo="thevickypedia/FastAPIAuthenticator"

latest=$(curl -s https://api.github.com/repos/${repo}/tags | jq -r '.[0].name')

pip install "git+https://github.com/${repo}.git@${latest}"

Usage

import fastapiauthenticator

from fastapi import FastAPI

app = FastAPI()


@app.get("/public")
def public_route():
    return {"message": "This is a public route"}


def private_route():
    return {"message": "This is a private route"}


fastapiauthenticator.Authenticator(app=app, secure_function=private_route)

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

License & copyright

© Vignesh Rao

Licensed under the MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_ui_auth-0.1.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_ui_auth-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_ui_auth-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4e9fa5ae7e9b3c3173dce8448efef587bd20de93287c2f2d32e3e96b0b282453
MD5 3a05fc2fbe1fca6edf9ae8762323cf4c
BLAKE2b-256 82cf4841746e7ba7b798e572412bb307a4a738bafa200aa0248fe1d742b0ce97

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page