Class DefaultSecretManagerServiceClientFactory

java.lang.Object
com.google.cloud.spring.autoconfigure.secretmanager.DefaultSecretManagerServiceClientFactory
All Implemented Interfaces:
SecretManagerServiceClientFactory

@Component public class DefaultSecretManagerServiceClientFactory extends Object implements SecretManagerServiceClientFactory
A default implementation of the SecretManagerServiceClientFactory interface.

This factory provides a caching layer for SecretManagerServiceClient instances. Clients are created using the provided CredentialsProvider and a UserAgentHeaderProvider that adds the Spring Cloud GCP agent header to the client.

  • Method Details

    • getClient

      public com.google.cloud.secretmanager.v1.SecretManagerServiceClient getClient(@Nullable String location)
      Description copied from interface: SecretManagerServiceClientFactory
      Creates a Secret Manager service client for the given location.
      Specified by:
      getClient in interface SecretManagerServiceClientFactory
      Parameters:
      location - the location to create a client for.
      Returns:
      a Secret Manager service client.