IQSS / IQSS/dataverse

Signed URLs: If target user account does not yet have an API Token, requestURL fails, even though request made with valid token.

Open
#9,405 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
564
Avg merge
2d 2h
Merged PRs (30d)
29

Description

When requesting a signed url as a super user but for permissions for a new non super user, it fails with "Do not have a valid user with apiToken". In this case it is referring to the the target user who has not yet created an api token for their account.

Discussed with Jim and he thought the request should create a token if there was not yet one and so a bug.
"a bug - the API key is used in creating/validating the signature so this call should probably be creating one if needed."

Relevant command lines:

JSON='{"url":"https://dataverse-internal.iq.harvard.edu/api/v1/datasets/:persistentId/?persistentId=doi:10.70122/FK2/AH9UIE","timeOut":35,"user":"kc022223"}'

curl -k -H "X-Dataverse-key:$API_KEY" -H 'Content-Type:application/json' -d "$JSON" http://localhost:8080/api/admin/requestSignedUrl

{"status":"ERROR","message":"Do not have a valid user with apiToken"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the /api/admin/requestSignedUrl endpoint and trace how the target user's API token is validated when generating the signed URL. Confirm the expected token-creation and signature behavior, then verify that a request for a target user without an existing token succeeds while existing-token requests continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.