Repository navigation
HDDS-17200. Treat deleted S3 secret cache entries as absent - #11812
Open
andyhuangdev wants to merge 1 commit into
Open
andyhuangdev wants to merge 1 commit into
andyhuangdev wants to merge 1 commit into
Conversation
Use getSecret when reading the secret string so revoked cache entries cannot return their old secret before flush. Add a regression test with the persisted secret still present. Tests: 75 related unit tests pass; full checkstyle and git diff --check pass.
andyhuangdev
marked this pull request as ready for review
October 28, 2026 12:32
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.
What changes were proposed in this pull request?
S3SecretManagerImpl.getSecretString() now delegates to getSecret() so both methods treat a cache entry marked as deleted as absent.
Revoking an S3 secret marks its cache entry as deleted until the double buffer flush cleans it up. Previously, getSecretString() ignored this marker and returned the old secret. Reusing getSecret() prevents returning the revoked secret or reading it back from the store before the revoke is flushed, and throws OzoneSecurityException with S3_SECRET_NOT_FOUND.
What is the link to the Apache JIRA
HDDS-17200
How was this patch tested?
Added TestS3GetSecretRequest.testGetSecretStringOfRevokedSecret, which revokes a secret without flushing while retaining the persisted secret. It verifies that the cache entry is marked as deleted, getSecret() returns null, and getSecretString() throws S3_SECRET_NOT_FOUND.
The regression test failed before the fix and passed afterward. All 75 related unit tests passed, including S3 secret requests, delegation token validation, S3 signing key derivation, S3 security utilities, and double buffer tests.
Full-project checkstyle and git diff --check also passed.