FastAPI helpers for Posit Workbench / RStudio Server proxy prefixes
Project description
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:
pip install -e ./fastapi_workbench
Quickstart
Wrap your app once:
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:
from fastapi_workbench import external_url
url = external_url(request, "/invites/accept?token=...")
Use Workbench-safe redirects:
from fastapi_workbench import safe_redirect
return safe_redirect(request, "/admin/login")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fastapi_workbench-0.2.0.tar.gz.
File metadata
- Download URL: fastapi_workbench-0.2.0.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4cbc22ec6210da38c70cd7a3860ca3db3206bdf2c31928fc804cecaf87a3a9c
|
|
| MD5 |
786bdab450a5cb37e67aed7ff43831be
|
|
| BLAKE2b-256 |
40dd44c775b9fdea2cf80c54a8f40e31c5409d0b280c4ba236cb8e3042f2f2f4
|
File details
Details for the file fastapi_workbench-0.2.0-py3-none-any.whl.
File metadata
- Download URL: fastapi_workbench-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
278fc0635829178b3bd7a57b62ee56cf62c908fb1a1c21e420c42b32c6ae6167
|
|
| MD5 |
31459f6f769498877f91f47b9bd5bf95
|
|
| BLAKE2b-256 |
bbb5eeb7705d0bf6d2a1147a6d55ec1c29d06b40a960106c2c028986516faf87
|