Project

Profile

Help

Story #7816

as a user, I can access pulpcore REST API from another domain

Added by dkliban@redhat.com about 1 year ago. Updated about 1 year ago.

Status:
CLOSED - WONTFIX
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Platform Release:
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

In some instances such as during development, Web UI needs to run on a different port from the REST API. In these instances the REST API needs to set "Access-Control-Allow-Origin" header on the response.

This can be accomplished using "django-cors-headers"[0].

[0] https://github.com/adamchainz/django-cors-headers

History

#1 Updated by bmbouter about 1 year ago

If it's only used for development, can we use dynaconf to fully configure this without picking up a formal dependency?

Also what would such a dynaconf config look like for example?

#2 Updated by dkliban@redhat.com about 1 year ago

The problem is that this requires adding a new Python dependency. We can't add that dependency using dynaconf.

The alternative to using this dependency is creating our own very basic middleware that can be enabled using a setting.

#3 Updated by dkliban@redhat.com about 1 year ago

Another alternative during development is using some kind of proxy[0].

[0] https://www.npmjs.com/package/cors-anywhere

#4 Updated by dkliban@redhat.com about 1 year ago

  • Status changed from NEW to CLOSED - WONTFIX

We will go with a proxy solution. Webpack provides such a proxy just for these purposes[0].

[0] https://webpack.js.org/configuration/dev-server/#devserverproxy

Also available in: Atom PDF