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

Install

From PyPI (when published):

pip install fastapi-workbench==0.3.1

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.1.tar.gz (13.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.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fastapi_workbench-0.3.1.tar.gz
Algorithm Hash digest
SHA256 53d4e2b28bdd3a7f755cdb82a299035f2d59b36dd107d06e5b02850629b21c0a
MD5 58292f0bbd0f74542a021f127db57a42
BLAKE2b-256 d0b799e87a378e21611be5db4ddb131031fdcd7710184547ff34b4c2b096cd0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_workbench-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 243b7dec36ce435efbb44a9a89a3c845b9511468937e27cf9d76b059162d0aff
MD5 9d890ed282f81f7196eaa3717fad8736
BLAKE2b-256 46e2c994475bdfd6643b18218d52da81dcbcab7fd0fdb9a4778cf18d64bfab60

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