fix(helper): preserve multiple X509 bundle authorities#428
Open
maxlambrecht wants to merge 1 commit intospiffe:mainfrom
Open
fix(helper): preserve multiple X509 bundle authorities#428maxlambrecht wants to merge 1 commit intospiffe:mainfrom
maxlambrecht wants to merge 1 commit intospiffe:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes KeyStoreHelper truststore alias generation so multiple X.509 authorities in the same trust-domain bundle are persisted under distinct aliases, and adds a regression test to validate multiple authorities are stored.
Changes:
- Increment the per-bundle alias index when storing authority certificates to avoid overwriting.
- Add a new unit test that injects a bundle containing multiple authorities for the same trust domain and verifies both are present in the truststore.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| java-spiffe-helper/src/main/java/io/spiffe/helper/keystore/KeyStoreHelper.java | Fixes alias generation loop to use distinct aliases for multiple authorities. |
| java-spiffe-helper/src/test/java/io/spiffe/helper/keystore/KeyStoreHelperTest.java | Adds regression test ensuring multiple authorities for one trust domain are persisted under separate aliases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Max Lambrecht <maxlambrecht@gmail.com>
b522688 to
3f8dea4
Compare
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
Fix
KeyStoreHelpertruststore updates for X.509 bundle authorities:Why
storeBundleinitialized the alias index but never incremented it, so later authorities could overwrite earlier ones. In watch mode, bundle rotations could also leave removed authorities trusted under old aliases, and nondeterministicSetiteration could cause unnecessary alias churn.How tested
Ran
./gradlew :java-spiffe-helper:test --tests io.spiffe.helper.keystore.KeyStoreHelperTest.