Class CertificateBasedAccess

java.lang.Object
com.google.api.gax.rpc.mtls.CertificateBasedAccess

@InternalApi public class CertificateBasedAccess extends Object
Utility class for handling certificate-based access configurations.

This class handles the processing of GOOGLE_API_USE_CLIENT_CERTIFICATE and GOOGLE_API_USE_MTLS_ENDPOINT environment variables according to https://google.aip.dev/auth/4114

  • Constructor Details

    • CertificateBasedAccess

      public CertificateBasedAccess(EnvironmentProvider envProvider)
      The EnvironmentProvider mechanism supports env var injection for unit tests.
  • Method Details

    • createWithSystemEnv

      public static CertificateBasedAccess createWithSystemEnv()
    • useMtlsClientCertificate

      public boolean useMtlsClientCertificate()
      Returns if mutual TLS client certificate should be used.
    • getMtlsEndpointUsagePolicy

      public CertificateBasedAccess.MtlsEndpointUsagePolicy getMtlsEndpointUsagePolicy()
      Returns the current mutual TLS endpoint usage policy.