Skip to main content

Middleware for FastAPI/Starlette to check requests coming through Google Cloud IAP.

Project description

fastapi-google-iap

PyPI - Version PyPI - Python Version PyPI - License PyPI - Downloads codecov

A FastAPI plugin for Google Cloud Identity-Aware Proxy (IAP) authentication.

Installation

pip install fastapi-google-iap

Usage

from fastapi import FastAPI
from fastapi_google_iap import GoogleIapMiddleware

app = FastAPI()

app.use_middleware(
    GoogleIapMiddleware,
    audience="/projects/999999999999/apps/example-project",
    unprotected_routes=["/healthz"],
    restrict_to_domains=["example.com"],
)

License

This project is licensed under the terms of 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 Distribution

fastapi-google-iap-1.0.1.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

fastapi_google_iap-1.0.1-py3-none-any.whl (4.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