Signed URLs: If target user account does not yet have an API Token, requestURL fails, even though request made with valid token.
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:
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
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 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