Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AIP-84 Allow specifying an injectable path_prefix #45933

Open
1 task done
pierrejeambrun opened this issue Jan 22, 2025 · 1 comment
Open
1 task done

AIP-84 Allow specifying an injectable path_prefix #45933

pierrejeambrun opened this issue Jan 22, 2025 · 1 comment
Assignees
Labels
area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. good first issue kind:meta High-level information important to the community
Milestone

Comments

@pierrejeambrun
Copy link
Member

pierrejeambrun commented Jan 22, 2025

Body

Allow via a configuration parameter a way for user to specify a path_prefix on the fastapi application. (FastAPI app also serves the webapplication, both will be under that prefix).

We can leverage the root_path param of fastapi and can build something similar to what we had for the legacy_api here:

# Apply DispatcherMiddleware
base_url = urlsplit(webserver_base_url)[2]
if not base_url or base_url == "/":
base_url = ""
if base_url:
wsgi_app = DispatcherMiddleware(_root_app, mounts={base_url: flask_app.wsgi_app})
flask_app.wsgi_app = wsgi_app # type: ignore[assignment]

This will also most likely require some adjustment in the front-end part. (vite build + redirection etc... to use the appropriate prefix, otherwise we might end-up with 404 responses there).

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@pierrejeambrun pierrejeambrun added area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. good first issue kind:meta High-level information important to the community labels Jan 22, 2025
@pierrejeambrun pierrejeambrun added this to the Airflow 3.0.0 milestone Jan 22, 2025
@kaxil
Copy link
Member

kaxil commented Jan 22, 2025

For whoever picks this issue: To know about root_path, path_prefix and the use-case check https://fastapi.tiangolo.com/advanced/behind-a-proxy/

@rawwar rawwar self-assigned this Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:API Airflow's REST/HTTP API area:UI Related to UI/UX. For Frontend Developers. good first issue kind:meta High-level information important to the community
Projects
Development

No branches or pull requests

3 participants