Class SqlCredentialFactory

java.lang.Object
com.google.cloud.spring.autoconfigure.sql.SqlCredentialFactory
All Implemented Interfaces:
com.google.cloud.sql.CredentialFactory

public class SqlCredentialFactory extends Object implements com.google.cloud.sql.CredentialFactory
Returns the credentials that are written to a system property by the Cloud SQL starter.

Since the sockets factory creates an instance of this class by reflection and without any arguments, the credential location must be in a place that this class knows without any context.

  • Field Details

    • CREDENTIAL_LOCATION_PROPERTY_NAME

      public static final String CREDENTIAL_LOCATION_PROPERTY_NAME
      the system property name for the location of the credentials.
      See Also:
    • CREDENTIAL_ENCODED_KEY_PROPERTY_NAME

      public static final String CREDENTIAL_ENCODED_KEY_PROPERTY_NAME
      the system property name for the key name.
      See Also:
  • Constructor Details

    • SqlCredentialFactory

      public SqlCredentialFactory()
  • Method Details

    • create

      public com.google.api.client.http.HttpRequestInitializer create()
      Specified by:
      create in interface com.google.cloud.sql.CredentialFactory
    • getCredentials

      public com.google.auth.oauth2.GoogleCredentials getCredentials()
      Specified by:
      getCredentials in interface com.google.cloud.sql.CredentialFactory