Project

Profile

Help

Story #7816

closed

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

Added by dkliban@redhat.com over 3 years ago. Updated over 3 years 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

Actions #1

Updated by bmbouter over 3 years 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?

Actions #2

Updated by dkliban@redhat.com over 3 years 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.

Actions #3

Updated by dkliban@redhat.com over 3 years ago

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

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

Actions #4

Updated by dkliban@redhat.com over 3 years 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