-
Notifications
You must be signed in to change notification settings - Fork 493
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
API: Consistently use CORS (Cross-Origin Resource Sharing) headers such a "Access-Control-Allow-Origin" #1136
Comments
This was brought up again, via RT: https://help.hmdc.harvard.edu/Ticket/Display.html?id=235395 (below is my note on this from the dataverse list) I really feel [this issue] should be bumped [up] in priority. For these people, I just made a quick patch - built a version of Search.class that adds Access-Control-Allow-Origin=* to the response. |
This was addressed in the 3089-jsoup branch, as a quick fix - a patch applied to just the Search.java (search api); per a somewhat urgent request, RT 235512.The patch: < @context HttpServletResponse response
this dev. ticket should stay open - to resolve this issue more generally. |
The only candidates to consider for CORS are read-only endpoints (so web pages can't change things in Dataverse, only read them). Not sure about |
@michbarsinai : Agreed re: cors. In the near-future, the worldmap metadata should become part of the Datafile data. e.g. the core DataFile information + sections/JSON blocks of file-specific metadata for FITS, WorldMap, tabular data, etc., etc.
|
@pdurbin @michbarsinai - Let me know if the Dataverse "metrics" CORS are consistent with your implementation. (1) Read-only endpoints for Metrics: (2) Current CORS header: def send_cors_response(response):
"""Quick hack to allow CORS...."""
response["Access-Control-Allow-Origin"] = "*"
return response |
May have confused things by introducing a new item (Metrics API):
|
Thanks for clarifying.
CORS is only useful for scripts running in web pages that are served from other domains. Is that a scenario for using WorldMap?
Metrics - might be useful if someone would like to write a JS widget for showing the metrics in 3rd party sites.
…Sent from my iPhone
On 3 Jan 2017, at 23:14, Raman Prasad ***@***.***> wrote:
May have confused items:
WorldMap endpoints
Part of core Dataverse code
Internal use only
Metrics API
Not part of core Dataverse code
Open to the public
Not widely advertised
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Michael wrote: Dataverses: Datasets: Metadatablocks: Search: Shibboleth Groups (this had the green CORS tag): |
@michbarsinai @pdurbin Thoughts? |
@kcondon As of 44f4936 I'm seeing The other thing that strikes me is that that I assume we should be using the green "CORS" labels that @michbarsinai added to the API Guide as the source of truth of which endpoints support CORS. I'll include a screenshot below. I don't want to step on @michbarsinai 's toes so I'm going to unassign myself but if he's busy or wants me to work on this pull request, please let me know. |
Update on my initial list: |
@michbarsinai Turns out Search was implementing CORS so false alarm. |
@michbarsinai @pdurbin Regarding the green CORS labels as the source of truth, that's fine by me but I did not see mention of it when I was testing. Plus, they are not on all CORS-enabled endpoints, which I think is what Phil was getting at but not sure. An example: curl -v "http://localhost:8080/api/dataverses/1/facets?key=" I think that is the only missing one. @michbarsinai It looks like the only remaining issue is adding CORS tag to the doc for |
Phil added the remaining CORS tag, merged, closed. |
An API tester noticed that a couple API endpoints (Access and Meta, per below) add the "Access-Control-Allow-Origin" CORS (Cross-Origin Resource Sharing) header but most do not.
You can see the header like this:
curl -v https://apitest.dataverse.org/api/access/datafile/10
In this ticket let's decide if we should be returning these headers in more places. From a comment, it seems like the header was added to support TwoRavens.
See also http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
Here's where we add this header as of c4e786d
The text was updated successfully, but these errors were encountered: