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.4.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_key_auth-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5c4725736ee7e2fb7dc56eeb34589327bb0a2a56967abce218ff93aa46dda96c |
|
MD5 | 0291e27ec57a8dc3be75d5f8dd479063 |
|
BLAKE2b-256 | 978768eae5f5a6d96cd4d498fad52189ec829ef729e275aea1d7fb48748ee82e |