← Back to all examples

FastAPI Action Middleware Gate

limetry + FastAPIPythonrecommendedautomated tests

FastAPI dependency evaluates mutating routes with limetry before handlers run. Deny → 403; approval_required → 202.

Source folder: examples/fastapi-action-middleware-gate

Documentation & Guide

README.md

FastAPI action middleware gate

Evaluate mutating FastAPI routes with the limetry Python SDK before handlers run. Deny → 403; approval_required → 202.

Install

pip install -e ../../packages/sdk-python
pip install -r requirements.txt

Run

uvicorn app:app --reload

Test

pytest test_app.py

Source Files

4 files in examples/fastapi-action-middleware-gate
markdown
# FastAPI action middleware gate

Evaluate mutating FastAPI routes with the [`limetry`](../../packages/sdk-python)
Python SDK before handlers run. Deny → 403; approval_required → 202.

## Install

```bash
pip install -e ../../packages/sdk-python
pip install -r requirements.txt
```

## Run

```bash
uvicorn app:app --reload
```

## Test

```bash
pytest test_app.py
```

Contact

Talk to the Limetry team

Questions about self-run Limetry, Limetry Cloud, or partnerships — send a note.  Open contact.