Skip to content

Conversation

@amartinezfayo
Copy link
Member

This change updates the disposeKeys function aws_kms KeyManager plugin to use prefix matching instead of exact equality when checking if a key belongs to the trust domain.
The previous logic (Description != prefix) only matched keys with descriptions exactly equal to SPIRE_SERVER_KEY/{trust_domain}, excluding keys with additional path components. The new logic (!strings.HasPrefix(Description, prefix)) correctly identifies all keys belonging to the trust domain, including those with extra path segments like SPIRE_SERVER_KEY/{trust_domain}/extra.

Thanks @moe-omar for pointing this in #5497.

The test suite was updated to fix a data race where the test directly accessed the key entries map without proper synchronization, now using the thread-safe ListKeyEntries() method instead, and adjusted to wait for all expected deletion signals before asserting results.

Signed-off-by: Agustín Martínez Fayó <amartinezfayo@gmail.com>
Copy link
Collaborator

@sorindumitru sorindumitru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@amartinezfayo amartinezfayo added this to the 1.14.1 milestone Jan 1, 2026
@amartinezfayo amartinezfayo merged commit b9c85e8 into spiffe:main Jan 1, 2026
94 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants