Metadata-Version: 2.1
Name: fastapi-workbench
Version: 0.1.0
Summary: FastAPI helpers for Posit Workbench / RStudio Server proxy prefixes
Author: jwt-user-management contributors
License: MIT
Project-URL: Repository, https://github.com/eddiethedean/jwt-user-management
Project-URL: Issues, https://github.com/eddiethedean/jwt-user-management/issues
Keywords: fastapi,starlette,posit,workbench,rstudio-server,proxy,root_path
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: starlette>=0.27
Requires-Dist: uvicorn>=0.23
Provides-Extra: dev
Requires-Dist: fastapi[standard]; extra == "dev"
Requires-Dist: httpx; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: ty; extra == "dev"

# fastapi-workbench

Small utilities to make FastAPI apps behave correctly behind Posit Workbench / RStudio Server proxy prefixes, while still behaving normally in non-Workbench deployments.

## Install (dev)

From the repo root:

```bash
pip install -e ./fastapi_workbench
```

## Quickstart

Wrap your app once:

```python
from fastapi import FastAPI
from fastapi_workbench import workbenchify

app = FastAPI()
app = workbenchify(app)
```

Generate external links that respect `root_path` and `PUBLIC_BASE_URL`:

```python
from fastapi_workbench import external_url

url = external_url(request, "/invites/accept?token=...")
```

Use Workbench-safe redirects:

```python
from fastapi_workbench import safe_redirect

return safe_redirect(request, "/admin/login")
```

