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.4 · Changelog

Install

From PyPI (when published):

pip install fastapi-workbench==0.3.4

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.4.tar.gz (18.7 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.4-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastapi_workbench-0.3.4.tar.gz
Algorithm Hash digest
SHA256 18e1e823f3069b778d6f65a04886fdb9e628a603cb4dd98b3e9bfcff1686ff1b
MD5 867ac430bd6c75f862425750766e38ca
BLAKE2b-256 9e4bd5938dd31f9ed367685774651c3253423f807071b97ef78e8783b49892c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_workbench-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3342d046487b28cf662f94ff64e7d224f44350a980fca28926bc714eb26d6783
MD5 10e93d2a20a4c16b3b0bd64947974dd0
BLAKE2b-256 d954e6badf3d9e6d5639ad072e591c2c9c3f2e7066c01ddded9edd48b72842f6

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