#6122 PDC api doc uses http:// instead of https://
Closed 6 years ago Opened 6 years ago by till.

PDC is properly available via https but for some reason the API doc uses http:// for links instead:
https://pdc.fedoraproject.org/rest_api/v1/

http://pdc.fedoraproject.org seems to be only mentioned for copr/mbs in ansible (which is a separate issue)

Just wondering, is PDC using http:// behind proxies and therefore maybe using the wrong protocol?


This might be:

BROWSABLE_DOCUMENT_MACROS = {
    # need to be rewrite with the real host name when deploy.
    'HOST_NAME': 'http://{{ inventory_hostname }}:80',
    # make consistent with rest api root.
    'API_PATH': '%s%s' % (REST_API_URL, REST_API_VERSION),
}

in roles/pdc/frontend/templates/settings_local.py

@ralph any ideas?

Metadata Update from @ralph:
- Issue assigned to ralph

6 years ago

Looks like this is what we need:

https://stackoverflow.com/questions/22279893/djangorestframework-https-links-with-routers-and-viewsets

Stripping X-Forwarded-Proto shouldn't be an issue for us, since the incoming requests should all come through the proxies anyways -- the firewall should disallow requests from outside that don't come through the proxies.

I guess.. let's wait until freeze is up to do this in prod?

Metadata Update from @ralph:
- Issue tagged with: unfreeze

6 years ago

Metadata Update from @ralph:
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata