API key validation Middleware
Project description
FastAPI-Key-Auth
from fastapi import FastAPI
from fastapi_key_auth import AuthorizerMiddleware
app = FastAPI()
app.add_middleware(AuthorizerMiddleware)
An api key in headers['x-api-key']
is validated against all values in your apps environment variables starting
with API_KEY_
before passing it on to your app
.
If the api key is not present, ergo invalid, it will return a 401 Unauthorized
.
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 Distribution
fastapi-key-auth-0.5.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_key_auth-0.5.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 559cfe2f2d97ef351da1e48117331215640b4d3cc97980f10cc328a4eafb7437 |
|
MD5 | 43af2c4966212ab6386ecf6cbf155cfe |
|
BLAKE2b-256 | 0a1296249b9e72d2b40dbcab0dc2cc7e34dba15da9045a548d0cddeb6ae912bb |