Class DefaultOAuth2HttpTransportFactory

java.lang.Object
io.micronaut.gcp.credentials.DefaultOAuth2HttpTransportFactory
All Implemented Interfaces:
com.google.auth.http.HttpTransportFactory

@Singleton @Requires(classes=io.micronaut.http.client.HttpClient.class) @Requires(property="gcp.credentials.use-http-client",value="true",defaultValue="false") public class DefaultOAuth2HttpTransportFactory extends Object implements com.google.auth.http.HttpTransportFactory
An implementation of HttpTransportFactory based upon HttpClient that can be supplied when creating GoogleCredentials, allowing full control over configuration of the client. This transport will log unsuccessful HTTP requests at the WARN level using Micronaut framework's SLF4J logging infrastructure, giving more visibility into potential errors without needing to bridge the GCP SDK's java.util.logging statements.
Since:
5.4.0
Author:
Jeremy Grelle
  • Constructor Details

    • DefaultOAuth2HttpTransportFactory

      public DefaultOAuth2HttpTransportFactory(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration)
      Constructor for DefaultOAuth2HttpTransportFactory.
      Parameters:
      beanContext - the current bean context
      defaultClientConfiguration - the default HTTP client configuration
  • Method Details

    • create

      public com.google.api.client.http.HttpTransport create()
      Specified by:
      create in interface com.google.auth.http.HttpTransportFactory