Class GoogleCredentialsConfiguration

java.lang.Object
io.micronaut.gcp.credentials.GoogleCredentialsConfiguration
All Implemented Interfaces:
io.micronaut.core.util.Toggleable

@ConfigurationProperties("gcp.credentials") @Context public class GoogleCredentialsConfiguration extends Object implements io.micronaut.core.util.Toggleable
Configuration for the Google credentials.
Since:
1.0
Author:
graemerocher, Ray Tsang
  • Field Details

  • Constructor Details

    • GoogleCredentialsConfiguration

      public GoogleCredentialsConfiguration()
  • Method Details

    • getScopes

      @NonNull public @NonNull List<URI> getScopes()
      The scopes to use.
      Returns:
      The scopes
    • setScopes

      public void setScopes(@Nullable @Nullable List<URI> scopes)
      The default scopes to associate with the application to access specific APIs. See Google Scopes for a complete list. Leave this empty if you don't need additional API access.
      Parameters:
      scopes - The scopes
    • getLocation

      @NonNull public @NonNull Optional<String> getLocation()
      The location of the service account credential key file. See Understanding Service Accounts for more information on generating a service account key file.
      Returns:
      The location
    • setLocation

      public void setLocation(@Nullable @Nullable String location)
      Sets the location to the service account credential key file.
      Parameters:
      location - The location
    • getEncodedKey

      @NonNull public @NonNull Optional<String> getEncodedKey()
      The Base64 encoded service account key content. This is not recommended except if you need to encode service account key via an environmental variable. For other use cases, configure
      location
      instead.
      Returns:
      The key
    • setEncodedKey

      public void setEncodedKey(@Nullable @Nullable String encodedKey)
      Sets the Base64 encoded service account key content..
      Parameters:
      encodedKey - The key
    • isEnabled

      public boolean isEnabled()
      Allows disabling Google credentials configuration. This may be useful in situations where you don't want to authenticate despite having the Google Cloud SDK configured. Default value is true.
      Specified by:
      isEnabled in interface io.micronaut.core.util.Toggleable
      Since:
      4.4.1
    • setEnabled

      public void setEnabled(boolean enabled)
      Allows disabling Google credentials configuration. This may be useful in situations where you don't want to authenticate despite having the Google Cloud SDK configured. Default value is true.
      Parameters:
      enabled - whether to enable or disable Google credentials configuration.
      Since:
      4.4.1
    • isUseHttpClient

      public boolean isUseHttpClient()
      If the HttpClient based transport should be used for retrieving authentication tokens. Default value is true. Note that if HttpClient is not on the classpath, the GCP SDK's default transport will be used instead.
      Returns:
      Whether the HttpClient should be used for retrieving authentication tokens.
      Since:
      5.4.0
    • setUseHttpClient

      public void setUseHttpClient(boolean useHttpClient)
      Allows disabling use of the HttpClient based transport for retrieving authentication tokens. Default value is true.
      Parameters:
      useHttpClient - Whether the HttpClient should be used for retrieving authentication tokens.
      Since:
      5.4.0