feat: Adds an X509 certificate provider in the auth libraries.#1624
feat: Adds an X509 certificate provider in the auth libraries.#1624aeitzman merged 12 commits intogoogleapis:x509from
Conversation
andyrzhao
left a comment
There was a problem hiding this comment.
Thanks for working on this!
oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java
Show resolved
Hide resolved
oauth2_http/javatests/com/google/auth/mtls/X509ProviderTest.java
Outdated
Show resolved
Hide resolved
| return System.getProperty(property, def); | ||
| } | ||
|
|
||
| File getWellKnownCertificateConfigFile() { |
There was a problem hiding this comment.
I think all these helper methods should be "private" whenever possible right? and use protected for those that needs to be overridden by the test mock?
There was a problem hiding this comment.
I'll make this function private, for the methods that need to be overridden, I think its better to keep them package private instead of protected, since we wouldn't expect packages that ingest this library to override them. For context, this is the same pattern that we use for the Default credentials provider in this library (https://github.com/googleapis/google-auth-library-java/blob/main/oauth2_http/java/com/google/auth/oauth2/DefaultCredentialsProvider.java)
oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java
Outdated
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java
Outdated
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/mtls/WorkloadCertificateConfiguration.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Lawrence Qiu <lqiu96@gmail.com>
| if (certConfigStream == null){ | ||
| throw new IllegalArgumentException("certConfigStream must not be null."); | ||
| } |
There was a problem hiding this comment.
nit: checkNotNull: https://www.javadoc.io/doc/com.google.guava/guava/33.0.0-jre/com/google/common/base/Preconditions.html for the method input argument
oauth2_http/javatests/com/google/auth/mtls/WorkloadCertificateConfigurationTest.java
Outdated
Show resolved
Hide resolved
lqiu96
left a comment
There was a problem hiding this comment.
Changes generally LGTM. Added a few nits and things about comments to warn uses about these classes (intended to be internal).
andyrzhao
left a comment
There was a problem hiding this comment.
Thanks for working on this PR! LGTM!
This PR creates a new "X509" certificate provider in a new Mtls package to handle workload X509 certificate reading. This is part of a larger feature described in go/x509-workload-auth-library-design
Merging this into a feature branch for now until the entire feature is ready.