Skip to main content

EAP Python Middleware

External Authentication Proxy (EAP) Middleware and Client SDK for Python.

Installation

pip install eap-middleware

Usage

from eap import EapEngine

# Automatically loads configuration from environment variables
engine = EapEngine.from_env()

# In a FastAPI/Starlette app:
app.add_middleware(engine.asgi_middleware())

Configuration (Environment Variables)

When initializing the engine with EapEngine.from_env(), EAP reads configuration directly from environment variables. Configure these variables in your host environment or .env file:

Variable Description Default
JWT_SECRET Cryptographic secret used to sign session cookies (HS256). Required
ALLOWED_EMAILS Comma-separated whitelist of allowed user emails or domains (e.g. admin@gmail.com, @iiitkota.ac.in). Required
GOOGLE_CLIENT_ID Client ID from your Google Cloud Console Credentials. Required for Web OAuth
GOOGLE_CLIENT_SECRET Client Secret from your Google Cloud Console Credentials. Required for Web OAuth
GOOGLE_REDIRECT_URL Redirect URI registered in your Google Console (e.g., http://localhost:8080/auth/callback). Required for Web OAuth
TARGET_URL Set to "tunnel" to use localtunnel gateway, or backend service URL. None
TUNNEL_TOKEN Secure token required to authenticate tunnel clients (if TARGET_URL=tunnel). None
RATE_LIMIT_PER_SEC Requests per second limit for web users. 3.0
RATE_BURST Max burst capacity for web users. 5.0
S2S_RATE_LIMIT_PER_SEC Requests per second limit for Server-to-Server API clients. 30.0
S2S_RATE_BURST Max burst capacity for Server-to-Server API clients. 100.0

Metadata

Release files for eap-middleware 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eap-middleware 1.0.0
File Size Uploaded Provenance Actions
eap_middleware-1.0.0.tar.gz 6.7 kB Without provenance Details for eap_middleware-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for eap-middleware 1.0.0
File Interpreter ABI Platform Actions
eap_middleware-1.0.0-py3-none-any.whl Python 3 none any Details for eap_middleware-1.0.0-py3-none-any.whl

Total release size: 13.7 kB

Release files / eap_middleware-1.0.0.tar.gz

Download URL eap_middleware-1.0.0.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
82afcb880546e92755953796364bed1f6537ff5699e3af896e233735193a354d
BLAKE2b-256 checksum
How to use checksums
30445547940f35b216757de543cccdcdc7b87e6ed06d9a14ccfb11256eb53943
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Release files / eap_middleware-1.0.0-py3-none-any.whl

Download URL eap_middleware-1.0.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c98aa52b232a3ef2b09d758fe8c97b5d4e4fc303b54976fcc50c30058f7e6fb8
BLAKE2b-256 checksum
How to use checksums
6630e8669edefd94342ce179704ddc9e95383b10b9b0f00824c96b466c6f6c8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.9

Security for eap-middleware 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page