-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make KeyVaultJcaProvider can work when keyvault-uri is not set. #22488
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
package com.azure.spring.security.keyvault.certificates.starter; | ||
|
||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
|
||
/** | ||
* This is used to generate spring-configuration-metadata.json | ||
* | ||
* @see <a href="https://docs.spring.io/spring-boot/docs/current/reference/html/appendix-configuration-metadata.html">Metadata</a> | ||
*/ | ||
@EnableConfigurationProperties({ AzureCertPathProperties.class }) | ||
@ConfigurationProperties("azure.cert-path") | ||
public class AzureCertPathProperties { | ||
|
||
/** | ||
* The path to put custom certificates | ||
*/ | ||
private String custom; | ||
|
||
/** | ||
* The path to put well-known certificates | ||
*/ | ||
private String wellKnown; | ||
|
||
public String getCustom() { | ||
return custom; | ||
} | ||
|
||
public String getWellKnown() { | ||
return wellKnown; | ||
} | ||
|
||
public void setCustom(String custom) { | ||
this.custom = custom; | ||
} | ||
|
||
public void setWellKnown(String wellKnown) { | ||
this.wellKnown = wellKnown; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,6 @@ public class KeyVaultCertificatesEnvironmentPostProcessor implements Environment | |
@Override | ||
public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { | ||
|
||
if (environment.getProperty("azure.keyvault.uri") == null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there any side effect with this remove? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No side effect, I think. |
||
return; | ||
} | ||
|
||
putEnvironmentPropertyToSystemProperty(environment, "azure.keyvault.aad-authentication-url"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd suggest to add a warning message in log to warn users still having this property configed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it's not necessary, because:
|
||
putEnvironmentPropertyToSystemProperty(environment, "azure.keyvault.uri"); | ||
putEnvironmentPropertyToSystemProperty(environment, "azure.keyvault.tenant-id"); | ||
putEnvironmentPropertyToSystemProperty(environment, "azure.keyvault.client-id"); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should discuss this property name,
azure.cert-path.custom
seems not a clear name to meThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current property name is the conclusion discussed with @gavinfish
Refs: #21611 (comment)