Skip to main content

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.

Version: 0.3.2 · Changelog

Install

From PyPI (when published):

pip install fastapi-workbench==0.3.2

From this monorepo (editable):

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")

Release checklist (maintainers)

cd fastapi_workbench
python -m pip install -e ".[dev]"
ruff check src tests
pytest
python -m build --sdist --wheel
twine check dist/*

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_workbench-0.3.2.tar.gz (17.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_workbench-0.3.2-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_workbench-0.3.2.tar.gz.

File metadata

  • Download URL: fastapi_workbench-0.3.2.tar.gz
  • Upload date:
  • Size: 17.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for fastapi_workbench-0.3.2.tar.gz
Algorithm Hash digest
SHA256 5ae95e02b0663afc576f72538af2bb3611e03c87deb9d682c048091618c7e294
MD5 34fe36fc130e3c5d71fb2f9b96049ff9
BLAKE2b-256 57121619fd3faaa5326ee35ae45ea1f1780ed59cd57e446761c9c3924530e914

See more details on using hashes here.

File details

Details for the file fastapi_workbench-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_workbench-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 54e698838f554e4edc750c539b23f49ef603191307336658ab1310b3786a06e2
MD5 7deab37016b5d46072c137f889057ec8
BLAKE2b-256 8a57697470ce0641effe556ca324c729ab118cde6f64bcb13741e40b4bbe0650

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page