feat(spring): support Key Vault certificate alias filters - #50018
Open
arnabnandy7 wants to merge 1 commit into
Open
feat(spring): support Key Vault certificate alias filters#50018arnabnandy7 wants to merge 1 commit into
arnabnandy7 wants to merge 1 commit into
Conversation
arnabnandy7
requested review from
a team,
moarychan,
rujche and
saragluna
as code owners
August 3, 2026 18:57
Contributor
|
Thank you for your contribution @arnabnandy7! We will review the pull request and get back to you soon. |
|
Azure Pipelines: Successfully started running 3 pipeline(s). 31 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Spring SSL bundle configuration support to control which Azure Key Vault JCA certificate aliases are loaded by propagating include/exclude regex patterns into the JCA provider’s system property.
Changes:
- Added new SSL bundle properties for
keystoreandtruststorecertificate alias filter patterns and bound them via Spring configuration. - Propagated configured patterns to the Key Vault JCA provider using
azure.keyvault.jca.certificate-alias-filter-patterns. - Added/updated unit tests and changelog entries documenting the new configuration.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/jca/AzureKeyVaultSslBundleRegistrar.java | Sets the new alias-filter system property when patterns are configured and includes it in the cleared-property set. |
| sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/jca/properties/AzureKeyVaultSslBundleProperties.java | Adds certificateAliasFilterPatterns list to keystore/truststore property model for configuration binding. |
| sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/jca/AzureKeyVaultSslBundleRegistrarTests.java | Adds a test for propagating configured patterns to the JCA system property. |
| sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/jca/AzureKeyVaultJcaAutoConfigurationTests.java | Extends configuration binding assertions for the new truststore alias-filter property. |
| sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md | Documents the new SSL bundle alias-filter configuration support. |
| sdk/spring/CHANGELOG.md | Adds the feature entry to the aggregated Spring release notes. |
Suppressed comments (1)
sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/keyvault/jca/AzureKeyVaultJcaAutoConfigurationTests.java:79
- After adding keystore alias-filter property values, the test should also assert that the keystore patterns were bound (similar to the truststore assertion above) to ensure the new keystore configuration is actually exercised.
assertThat(sslBundlesProperties.getKeyvault().get("testBundle3").getTruststore().getKeyvaultRef()).isEqualTo("kv1");
assertThat(sslBundlesProperties.getKeyvault().get("testBundle3").getKeystore().getKeyvaultRef()).isEqualTo("kv2");
Signed-off-by: Arnab Nandy <arnab_nandy7@yahoo.com>
arnabnandy7
force-pushed
the
feature/keyvault-certificate-alias-filter
branch
from
August 3, 2026 19:22
1367efc to
ad1c98a
Compare
Contributor
Author
|
@moarychan please review |
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.
Description
Adds Spring configuration support for filtering the certificate aliases loaded by the Azure Key Vault JCA provider.
Applications can now configure alias filter patterns independently for an SSL bundle's keystore and truststore:
spring.ssl.bundle.keyvault.<bundle-name>.keystore.certificate-alias-filter-patternsspring.ssl.bundle.keyvault.<bundle-name>.truststore.certificate-alias-filter-patternsThe configured list is passed to the JCA provider through the
azure.keyvault.jca.certificate-alias-filter-patternssystem property. Include patterns are regular expressions, while exclusion patterns use the!prefix. When the list is empty, all certificate aliases continue to be loaded, preserving the existing behavior.The JCA system property is cleared between keystore and truststore initialization to prevent filter settings from leaking between SSL bundles or stores.
This change also:
Resolves #50013.
Depends on #49774, which adds the corresponding certificate alias filtering support to
azure-security-keyvault-jca.The focused tests are:
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines