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.1.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for fastapi_key_auth-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab07df54c33c9a0245a713a8a384664c7695a40b1c25de57370e48cd9f103d77 |
|
MD5 | 6d6fc52cc4eff10478359631f69e0200 |
|
BLAKE2b-256 | e7dced9bf49efb552b7a40686444c7c7275dd69c318df4de8c14423c2c5b25f5 |