-
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
Load cert from file system in key vault #21947
Load cert from file system in key vault #21947
Conversation
Hi, @lzc-1997-abel , please fix the pipeline failure: https://dev.azure.com/azure-sdk/public/_build/results?buildId=934882&view=logs&j=c9d240ae-d682-5859-bc40-e53679190efe&t=40323220-fbf5-56cf-78c9-a2f416f2d69b&l=22 |
/azp run java - keyvault - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run java - spring - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
...curity-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/ClasspathCertificates.java
Outdated
Show resolved
Hide resolved
...urity-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/FileSystemCertificates.java
Outdated
Show resolved
Hide resolved
...urity-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/FileSystemCertificates.java
Outdated
Show resolved
Hide resolved
...urity-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/FileSystemCertificates.java
Outdated
Show resolved
Hide resolved
...urity-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/FileSystemCertificates.java
Outdated
Show resolved
Hide resolved
...re-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
Outdated
Show resolved
Hide resolved
...re-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
Outdated
Show resolved
Hide resolved
...y-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/FileSystemCertificatesTest.java
Outdated
Show resolved
Hide resolved
...vault-jca/src/test/java/com/azure/security/keyvault/jca/test/FileSystemCertificatesTest.java
Outdated
Show resolved
Hide resolved
...vault-jca/src/test/java/com/azure/security/keyvault/jca/test/FileSystemCertificatesTest.java
Outdated
Show resolved
Hide resolved
...ecurity-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultCertificates.java
Outdated
Show resolved
Hide resolved
...re-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
Outdated
Show resolved
Hide resolved
...re-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
Outdated
Show resolved
Hide resolved
...re-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
Outdated
Show resolved
Hide resolved
...re-security-keyvault-jca/src/main/java/com/azure/security/keyvault/jca/KeyVaultKeyStore.java
Outdated
Show resolved
Hide resolved
...vault-jca/src/test/java/com/azure/security/keyvault/jca/test/FileSystemCertificatesTest.java
Outdated
Show resolved
Hide resolved
...vault-jca/src/test/java/com/azure/security/keyvault/jca/test/FileSystemCertificatesTest.java
Show resolved
Hide resolved
...ty-test-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/test/JreKeyStoreTest.java
Outdated
Show resolved
Hide resolved
...ty-test-keyvault-jca/src/test/java/com/azure/security/keyvault/jca/test/JreKeyStoreTest.java
Outdated
Show resolved
Hide resolved
customCertificates = new FileSystemCertificates(customPath); | ||
keyVaultCertificates = new KeyVaultCertificates(refreshInterval, keyVaultClient, this); | ||
classpathCertificates = new ClasspathCertificates(); | ||
allCertificates = Arrays.asList(jreCertificates, wellKnowCertificates, customCertificates, keyVaultCertificates, classpathCertificates); |
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.
Could you please add unit test for the priority? For example:
- wellKnowCertificates and customCertificates has same alias, the first one will be used.
- Same to customCertificates and classpathCertificates
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.
LGTM. Please create another PR to update changelog and readme.
import java.security.cert.CertificateException; | ||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public class PropertyConvertorUtils { | ||
|
||
public static void putEnvironmentPropertyToSystemProperty(List<String> key) { | ||
public static void putEnvironmentPropertyToSystemPropertyForKeyVaultJca(List<String> key) { |
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.
nit: Delete parameter of this method, because it's always equal to SYSTEM_PROPERTIES
.
Hi, @stliu , sorry that I forgot this. Please review this PR again. And @lzc-1997-abel will create another PR to :
|
related issue: #21611
we need support load cert from file system(A configurable path).