-
Notifications
You must be signed in to change notification settings - Fork 547
Fix URL signing api for URLs containing special characters #12435
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
Open
ErykKul
wants to merge
9
commits into
develop
Choose a base branch
from
fix-url-signing-special-characters
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f911647
Fix URL signing api for URLs containing special characters
ErykKul 2c94dc8
Merge branch 'develop' into fix-url-signing-special-characters
ErykKul 96be125
Extra URL signing tests to prevent regression
ErykKul 8812582
More URL signing tests
ErykKul 9cb852a
Clean up URL signing tests and comments
ErykKul 12216ba
Merge branch 'develop' into fix-url-signing-special-characters
ErykKul 942f3cf
updated the release note
ErykKul 4387ee9
Clarify URL-signing release note and comment
ErykKul 8b1ab7b
Return 500 instead of 400 when signing secret is not configured
ErykKul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| ### Signed URLs work again for URLs with special characters | ||
|
|
||
| Requesting a signed URL (e.g. via `/api/admin/requestSignedUrl`, used by external tools, the Globus | ||
| integration and third-party integrations such as the `rdm-integration` connector) was broken in 6.10 | ||
| for URLs whose query contained special characters — most notably persistent IDs such as | ||
| `doi:10.5072/FK2/ABC` (which contain `:` and `/`), as well as spaces, percent-encoded values and | ||
| non-ASCII characters. In 6.10 the signing step began re-encoding/normalizing the URL (for example | ||
| percent-encoding `:` and `/`) before computing the signature, while the request is validated against | ||
| the URL the caller actually presents back. The re-encoded signature no longer matched, so validation | ||
| failed with authentication / "signature does not match" errors. | ||
|
|
||
| Signing no longer re-encodes the URL: it is signed exactly as provided, with only the reserved | ||
| signing parameters (`until`, `user`, `method`, `token`, `key`, `signed`) stripped out; the rest of | ||
| the URL is left untouched, character for character. | ||
|
|
||
| **This restores the URL-signing behavior used before 6.10, so it is compatible with older versions | ||
| and with existing integrations.** Clients and connectors that build or consume signed URLs the way | ||
| they did before 6.10 keep working unchanged, signatures are computed the same way as before the | ||
| regression, and URLs containing special characters validate again. No client-side changes are | ||
| required. | ||
|
|
||
| ### A signing secret is now required to request signed URLs | ||
|
|
||
| Separately from the fix above, the `/api/admin/requestSignedUrl` endpoint now requires a non-empty | ||
| signing secret (`dataverse.api.signing-secret`) to be configured. Previously an unset secret silently | ||
| fell back to using only the user's API token as the signing key, which is too weak. If the secret is | ||
| not configured, the endpoint now returns an error instead of issuing a weakly-signed URL. | ||
|
|
||
| **Upgrade note:** installations that use signed URLs through this endpoint (including the | ||
| `rdm-integration` connector) must set `dataverse.api.signing-secret`. See the | ||
| [Configuration Guide](https://guides.dataverse.org/en/latest/installation/config.html#dataverse-api-signing-secret). | ||
| Treat the value like a password. Because the signing secret is part of the signing key, setting (or | ||
| later changing) it invalidates previously issued signed URLs: any existing signed URLs that have not | ||
| yet expired will stop working, and clients/integrations will need to request new ones. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.