Skip to content

Fix URL signing api for URLs containing special characters - #12435

Open
ErykKul wants to merge 37 commits into
developfrom
fix-url-signing-special-characters
Open

Fix URL signing api for URLs containing special characters#12435
ErykKul wants to merge 37 commits into
developfrom
fix-url-signing-special-characters

Conversation

@ErykKul

@ErykKul ErykKul commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

What this PR does / why we need it:
Bug fix; URL signing for URLs containing special characters broken in 6.10, this PR fixes the introduced bug.

Which issue(s) this PR closes:
Issue not created, bug fixed directly here.

Special notes for your reviewer:
Added tests to prevent regression. Also, API requires now the signing secret to be set, otherwise it will not work.

Suggestions on how to test this:
No special testing needed, the unit tests should be sufficient.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No

Is there a release notes update needed for this change?:
Yes, included.

Additional documentation:
No

@ErykKul ErykKul added Size: 3 A percentage of a sprint. 2.1 hours. Type: Bug - Blocker Bug is blocking user work, no workaround available labels Jun 4, 2026
@ErykKul ErykKul added this to the 6.11 milestone Jun 4, 2026
@ErykKul ErykKul moved this to Ready for Review ⏩ in IQSS Dataverse Project Jun 4, 2026
@coveralls

coveralls commented Jun 4, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 25.402% (+0.2%) from 25.242% — fix-url-signing-special-characters into develop

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@ErykKul ErykKul moved this from Ready for Review ⏩ to In Progress 💻 in IQSS Dataverse Project Jun 4, 2026
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Test Results

404 tests  ±0   389 ✅ +1   37m 34s ⏱️ + 5m 55s
 55 suites ±0    15 💤 ±0 
 55 files   ±0     0 ❌  - 1 

Results for commit 458ae25. ± Comparison against base commit 82e84a1.

♻️ This comment has been updated with latest results.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment thread doc/sphinx-guides/source/installation/config.rst Outdated
@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@pdurbin pdurbin removed this from the 6.11 milestone Jun 8, 2026
@pdurbin pdurbin added the Status: Needs Input Applied to issues in need of input from someone currently unavailable label Aug 25, 2026
@pdurbin

pdurbin commented Aug 26, 2026

Copy link
Copy Markdown
Member

@ErykKul just a reminder that we'd like your input and code freeze for 6.12 is next Thursday! 🥶

@pdurbin

pdurbin commented Aug 26, 2026

Copy link
Copy Markdown
Member

We think only @ErykKul is actively using this but we'd like to get it into 6.12.

@cmbz cmbz added the FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) label Aug 26, 2026
@ErykKul

ErykKul commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

@pdurbin I am on it. Trying to wrap it up. Not ready yet, I will try to have it ready by tomorrow evening.

…eserved params instead of stripping, constant-time signature check #12435
Comment thread src/main/java/edu/harvard/iq/dataverse/api/Admin.java Fixed
@github-actions

This comment has been minimized.

…chronized, no per-node cache), 400s instead of 500s for smuggled or manifest reserved params, constructor injection, coverage tests #12435
Comment thread src/main/java/edu/harvard/iq/dataverse/util/URLTokenUtil.java Fixed
@github-actions

This comment has been minimized.

2 similar comments
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@ErykKul

ErykKul commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

@qqmyers Ready for another look. The signing/validation fix itself is unchanged since your last pass; the rework around it, per our discussion:

Signing secret is now a DB setting (:ApiSigningSecret), auto-generated on first use. I dropped the JVM option entirely: there's no good way to generate a secret and keep it synced across the deployment shapes people actually run (docker compose, Kubernetes, hosted Payara). Admins can still store their own; a minimum length of 32 is enforced on every write path (single PUT, localized, bulk). DELETE rotates it. Upgrading invalidates outstanding signed URLs (release note covers it). With the secret always present, all the "no secret configured" fallback paths are gone.

Reserved query parameters are now rejected, never silently stripped — requestSignedUrl and tool-manifest allowedApiCalls templates return a 400 naming the parameter (note: a pre-existing manifest that misused one worked silently in 6.10 and will 400 at launch after upgrade).

One behavior change to ratify: requestSignedUrl with an explicit but unknown user now returns 400 instead of silently signing with the calling superuser's token (a typo used to mint a full-privilege URL). Omitting user still defaults to the caller, as already documented: I wondered whether that default should be more explicit (or required), but that felt out of scope for this PR.

Also while in there: constant-time signature comparison, and the secret is redacted from the action log.

…ecial-characters

# Conflicts:
#	src/main/java/edu/harvard/iq/dataverse/api/Access.java
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:fix-url-signing-special-characters
ghcr.io/gdcc/configbaker:fix-url-signing-special-characters

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY26 Sprint 25 FY26 Sprint 25 (2026-06-03 - 2026-06-17) FY26 Sprint 26 FY26 Sprint 26 (2026-06-17 - 2026-07-01) FY27 Sprint 1 FY27 Sprint 1 (2026-07-01 - 2026-07-15) FY27 Sprint 2 FY27 Sprint 2 (2026-07-15 - 2026-07-29) FY27 Sprint 3 FY27 Sprint 3 (2026-07-29 - 2026-08-12) FY27 Sprint 4 FY27 Sprint 4 (2026-08-12 - 2026-08-26) FY27 Sprint 5 FY27 Sprint 5 (2026-08-26 - 2026-09-09) Original size: 3 Size: 10 A percentage of a sprint. 7 hours. Status: Needs Input Applied to issues in need of input from someone currently unavailable Type: Bug - Blocker Bug is blocking user work, no workaround available

Projects

Status: QA ✅

Development

Successfully merging this pull request may close these issues.

7 participants