úÎ2E.½7      !"#$%&'()*+,-./0123456SafeñCloud API exceptionToken exchange exceptions6Something went wrong with the request, token not found 0Errors associated with JWT-encoded token request Authentication key exceptions    !WebApiM and related functionality(c) Marco Zocca, 2018GPL-3zocca.marco gmail experimentalPOSIXNone 1<>?FKTã ”The main type of the library. It can easily be re-used in libraries that interface with more than one cloud API provider because its type parameter c1 lets us be declare distinct behaviours for each.A O contains all information necessary to communicating with a cloud API provider:3Authentication credentials (e.g. username/password):Authentication token (used to authenticate every API call)(Options (e.g. GCP authentication scopes)An authentication  with an expiry date7Lift an `IO a` action into the  monad"Lift an `IO a` action into the V monad, and catch synchronous exceptions, while rethrowing the asynchronous ones to IO# Evaluate a  action, given a .+NB : Assumes all exceptions are handled by 890`cacheToken tok hdl` : Overwrite the token TVar tv containing a token if tok! carries a more recent timestamp.%wExtract the token content (needed to authenticate subsequent requests). The token will be valid for at least 60 seconds& Create a  with an empty token:athe whole point of this parametrization is to have a distinct MonadHttp for each API provider/DSPSinstance HasCredentials c => MonadHttp (Boo c) where handleHttpException = throwM !"#$%& !None ü'®Parse a chunk of text into an RSA private key. For Google Cloud Platform , this is the private key associated with the user's "service account" (for server-to-server API use) 1https://console.cloud.google.com/apis/credentials Note: do not[ supply the RSA header and footer or any newlines (they will be inserted by this function).'Safe;=FT!iNone<#y; produce a &c-separated list of parameters that can be passed to an HTTP querty from a list of key, value pairs (<);=*>None6+Ü6Lsend a POST request over HTTPS to a given URI that will return a OAuth2Token?ÒReturns the UTCTime (absolute) related to a delay in seconds from the time this function is executed. We need this helper function because the "expires_in" field in the OAuth2 response means "seconds from now".6 Request URI.parameter list as a list of (key, value) pairs#request options (e.g. headers) ?ICorrection for system delays (e.g. processing and network time). Positive'"seconds from now" parameter. Positive +,-./0123456+,-./01234None>?KQV,Ÿ +,-./0123456 6+,-./012345None-70  !"#$%&'()*+,-./0&#" !%$'+,-./  )(*@      !"#$%&'()*+,-./011234556789:;<=>?@ABCDEF"goggles-0.3-GR5sWOQbNif7sFStY0rx3VNetwork.GogglesNetwork.Goggles.Auth"Network.Goggles.Control.ExceptionsNetwork.Goggles.Cloud Data.KeysNetwork.Goggles.TypesNetwork.Utils.HTTPNetwork.Goggles.Auth.OAuth2CloudException UnknownErrorIOError TimeoutErrorJsonDecodeErrorXMLDecodeErrorTokenExchangeExceptionNotFoundAPICredentialsNotFoundJWTErrorBadExpirationTimeCryptoSignError KeyException NoSecretFound NoParsePKNoRSAKeyWebApiM runWebApiMHandle credentialstokenoptionsTokentTokentTimeHasToken TokenContentOptions tokenFetchHasCredentials Credentials liftWebApiIO evalWebApiIO refreshToken accessToken createHandleparseRSAPrivateKeygetLbsputLbs urlEncode OAuth2TokenoaTokenExpirySeconds oaTokenString oaTokenTypeOAuth2TokenUTCoauTokenExpiryoauTokenString oauTokenTypemkOAuth2TokenUTCrequestOAuth2Token liftWebApiIO_'exceptions-0.8.3-6TQSgd6QYnC83Uf6EwjUmsControl.Monad.CatchthrowM cacheToken$fMonadRandomWebApiMencodeHttpParametersLBpostLbsencodeHttpParameters urlDecodetokenExpiryTime