Package org.forgerock.secrets.gcpkms
Class ChfHttpTransport
- java.lang.Object
-
- com.google.api.client.http.HttpTransport
-
- org.forgerock.secrets.gcpkms.ChfHttpTransport
-
public class ChfHttpTransport extends com.google.api.client.http.HttpTransportImplementation of the Google Cloud APIHttpTransportinterface using CHF. This allows CHF to be used as the HTTP client library for REST calls to Google Cloud Platform. Example:Handler chfHandler = new HttpClientHandler(); Supplier<Context> contextSupplier = RootContext::new; HttpTransportFactory httpTransportFactory = () -> new ChfHttpTransport(chfHandler, contextSupplier); GoogleCredentials credentials = ServiceAccountCredentials.fromStream( new FileInputStream("/engineering-devops-afce7aa71027.json"), httpTransportFactory); credentials = credentials.createScoped("https://www.googleapis.com/auth/cloudkms");Note: it is not possible to change the transport used for RPC calls to GCP services, so this will only be used to obtain OAuth access tokens and other auxiliary requests.
-
-
Constructor Summary
Constructors Constructor Description ChfHttpTransport(Handler httpHandler, Supplier<Context> context)Initialises the transport with the given CHF client handler and context supplier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.google.api.client.http.LowLevelHttpRequestbuildRequest(String method, String url)
-