Skip to content

chore: Refactor x509Provider to create a shared Utils class for Mtls#1907

Open
vverman wants to merge 11 commits intogoogleapis:mainfrom
vverman:refactor-x509-provider
Open

chore: Refactor x509Provider to create a shared Utils class for Mtls#1907
vverman wants to merge 11 commits intogoogleapis:mainfrom
vverman:refactor-x509-provider

Conversation

@vverman
Copy link
Copy Markdown
Contributor

@vverman vverman commented Mar 24, 2026

Fixes googleapis/google-cloud-java#12582

Addressed a concern raised by Andy refer.

Now X509Provider only exposes the necessary methods needed by the MtlsProvider interface

@vverman vverman requested review from a team as code owners March 24, 2026 02:24
@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Mar 24, 2026
@vverman vverman force-pushed the refactor-x509-provider branch from 1500bea to f78ed98 Compare March 24, 2026 03:02
@vverman vverman requested a review from lqiu96 March 24, 2026 03:04
*
* <p>For internal use only.
*/
public class SystemEnvironmentProvider implements EnvironmentProvider, Serializable {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq, what is the difference between SystemEnvironmentProvider and EnvironmentProvider?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An EnvProvider is an interface which can be implemented by test-classes to pass in their own env variables.

The SystemEnvProvider implements this EnvProvider and implements the associated functions such that the env-variables are fetched from the system env.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. Can you add @internalapi to this class and for SystemPropertyProvider?

@lqiu96
Copy link
Copy Markdown
Member

lqiu96 commented Mar 24, 2026

feat: Refactor x509Provider

Since this is a refactor, I'm going to change the title to chore: ... to reflect the type of change in the release notes. Thank you for helping with our backlog!

@lqiu96 lqiu96 changed the title feat: Refactor x509Provider chore: Refactor x509Provider to create a shared Utils class for Mtls Mar 24, 2026
@marcosgtz7
Copy link
Copy Markdown

marcosgtz7 commented Mar 24, 2026 via email

private static String getExplicitCertConfigPath(IdentityPoolCredentialSource credentialSource) {
IdentityPoolCredentialSource.CertificateConfig certConfig =
credentialSource.getCertificateConfig();
return certConfig.useDefaultCertificateConfig()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential null pointer access: The variable certConfig may be null at this location

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the catch! I added a null pointer check!

@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Apr 4, 2026
@vverman vverman force-pushed the refactor-x509-provider branch from b2ff241 to e8fbea7 Compare April 4, 2026 23:50
@vverman vverman requested a review from nbayati April 4, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: xl Pull request size is extra large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google-auth-library-java] Auth: Refactor X509Provider

4 participants