Repository navigation
CLARIN-DSpace v9/Hide the magic handle token and make /api/core/handles admin-only - #1511
Open
milanmajchrak wants to merge 2 commits into
Open
milanmajchrak wants to merge 2 commits into
milanmajchrak wants to merge 2 commits into
Conversation
…es admin-only Port of dtq-dev PR 1508 (commit 1a22aac) to the v9 base. Only the javax import in the IT changed to jakarta. Co-Authored-By: Claude Fable 5.1 <[email protected]>
The constructor uses the same format check as hideToken, a magic URL must start with the marker as in HandlePlugin, and a blank token never matches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
References
Port of #1508 (commit 1a22aac). dspace-customers issue 1071.
Description
Reads of
/api/core/handlesare admin-only now, and the token part of the magic URL is empty in every response.Instructions for Reviewers
HandleRestRepository.findOneandfindAllrequireADMIN, like create, patch and delete. The only reader is the admin handle table.Handle.hideToken()empties the token in every/api/core/handlesresponse, the DB value stays.Handle.restoreToken()puts it back when an admin saves the URL as the API showed it.POST /api/services/handlesstill returns the token it generated,PUTstill needs it.Handlereads a token only from a complete magic URL that starts with the marker, the same checkhideTokenuses.findByHandleAndMagicTokenfinds nothing for a blank token.javax.ws.rstojakarta.ws.rsin the IT, the diff is the same as dtq-dev PR 1508.HandleRestRepositoryITandExternalHandleRestRepositoryITcover it. Compile and Checkstyle pass locally, the ITs run in CI.Codex review (gpt-6.2-sol, high), 2 rounds: 3 findings fixed (token read only from a complete magic URL, marker required at the start, blank token rejected). Not changed: a PATCH cannot clear the token with a blank slot; same as dtq-dev, an admin replaces the token instead.
Checklist
mainbranch of code (unless it is a backport or is fixing an issue specific to an older branch).pom.xml), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.🤖 Generated with Claude Code