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

Install

From PyPI (when published):

pip install fastapi-workbench==0.3.3

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_workbench-0.3.3.tar.gz
  • Upload date:
  • Size: 18.3 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.3.tar.gz
Algorithm Hash digest
SHA256 01175f4ad6693ad7cd752de24e4c1884ad85e0b007d724eb8ab9314a10e607c6
MD5 1b9bd4f2e6b47ae99e90130397c79546
BLAKE2b-256 87d4015e2a0cd2048bc78c12b3fae841012df2f608a5013bb2221233afd3815c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_workbench-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1b45481a493b2b4a3c748d77fd0ce4a0937b7db7f52661d8a6a31a907b59c2ac
MD5 ffe8618a9c27d065af017d120385e296
BLAKE2b-256 1238b7b848724b424821b983dbad385f5e13b4c0f2c3075d85db85f8d3b1e529

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