Package io.micronaut.gcp.credentials
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="true")
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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Implementation ofLowLevelHttpRequest
that uses the blocking API ofHttpClient
. -
Constructor Summary
ConstructorDescriptionDefaultOAuth2HttpTransportFactory
(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration) Constructor forDefaultOAuth2HttpTransportFactory
. -
Method Summary
-
Constructor Details
-
DefaultOAuth2HttpTransportFactory
public DefaultOAuth2HttpTransportFactory(io.micronaut.context.BeanContext beanContext, io.micronaut.http.client.HttpClientConfiguration defaultClientConfiguration) Constructor forDefaultOAuth2HttpTransportFactory
.- Parameters:
beanContext
- the current bean contextdefaultClientConfiguration
- the default HTTP client configuration
-
-
Method Details
-
create
public com.google.api.client.http.HttpTransport create()- Specified by:
create
in interfacecom.google.auth.http.HttpTransportFactory
-