Globus integration assumes app is running on Dataverse server
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
Hi there .. I attempted to integrate the dataverse-globus app with Dataverse and had an issue because Dataverse assumes the app is running locally, and I had installed it on a separate server, for various reasons. Per Jim M, "the app call the /api/datasets/{id}/addGlobusFiles call and the URL to call is picked up from the 'origin' header sent in with that call, which means that it's hardcoded right now to assume the app and Dataverse are running on the same machine."
That is happening in this code: https://github.com/IQSS/dataverse/blob/497c578ca11cd328e45c913d06c0ee20547b881f/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java#L3388-L3392
What then happens is the API call to upload the file to dataverse replaces the URL of the app server with the dataverse server URL and the upload fails, even though the Globus upload to the bucket is successful.
The workaround to make it work was to change the domain name of our app server to include the word "localhost", which caused the code to just look for that in the string, and then it replaces the server name with "http://localhost:8080" which makes the API call successful. I am requesting that the code be changed to also allow the app to run on a separate server with a separate domain name, which is reflected in the upload API call.
Thanks!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/main/java/edu/harvard/iq/dataverse/api/Datasets.java around lines 3388-3392 and trace the /api/datasets/{id}/addGlobusFiles request. Verify how the origin header is used to construct the upload callback URL. Done means a dataverse-globus app on a separate server and domain can complete the upload without replacing its URL with the Dataverse server URL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100