Skip to main content

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 it will return a 401 Unauthorized.

Project details


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.3.0.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

fastapi_key_auth-0.3.0-py3-none-any.whl (2.4 kB view hashes)

Uploaded Python 3

Supported by

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