Skip to content

HDDS-17200. Treat deleted S3 secret cache entries as absent - #11812

Open
andyhuangdev wants to merge 1 commit into
apache:masterfrom
andyhuangdev:HDDS-17200
Open

andyhuangdev wants to merge 1 commit into
apache:masterfrom
andyhuangdev:HDDS-17200

Conversation

@andyhuangdev

Copy link
Copy Markdown
Contributor

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.

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.
@github-actions github-actions Bot added the om label Oct 28, 2026
@andyhuangdev
andyhuangdev marked this pull request as ready for review October 28, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant