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.

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


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.1.0.tar.gz (9.1 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.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_workbench-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.18

File hashes

Hashes for fastapi_workbench-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c0e92e76e369b45e8bf99cf7b71917b30727685da11537aada82d4a00b1e7d54
MD5 6ff5b4583da77eb982ec3880d15009b1
BLAKE2b-256 6d0709d9788c600b32eb75863eb294f5f3a8f97243de7c2edb022aee85568414

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fastapi_workbench-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec67955209ffe13a0c646dda31987912848fb904020ec2aa08a4919433dbc17f
MD5 8717b12545a98c09de7d3f6d73900cc2
BLAKE2b-256 0f60dabc6f634f99fb91c7bd9c93447f21672c25d5cba8c915c6a1dfea4cd207

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