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

add API_HOSTAME setting to override the hostname used for OpenAPI schema #5167

Open
dkliban opened this issue Mar 25, 2024 · 2 comments
Open
Labels

Comments

@dkliban
Copy link
Member

dkliban commented Mar 25, 2024

Is your feature request related to a problem? Please describe.

The OpenAPI schema provides a list of servers that currently looks like this in our deployment:

    "servers": [
        {
            "url": "http://pulp-api-svc.pulp-stage.svc.cluster.local:24817/"
        }
    ]

We would like to be able to set the hostname to match that of the gateway that we use to access the API.

The API_HOSTNAME should default to the hostname of the machine it is running on. The value is just the hostname. It is distinct and separate from API_ROOT.

@mdellweg
Copy link
Member

mdellweg commented Apr 3, 2024

@gerrod3 You are working on a different api gateway story. Do you think there is a way without adding new setting?

@gerrod3
Copy link
Contributor

gerrod3 commented Apr 3, 2024

Maybe you could use the HTTP_HOST value in request.META along with HTTP_X_FORWARDED_PROTO to construct the hostname. https://docs.djangoproject.com/en/5.0/ref/request-response/#django.http.HttpRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants