Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- type OAuth2TokenByteString = ByteString
- displayCredentials :: Katip m => OAuth2Env -> m (Maybe CredentialsJson)
- findCredentials :: Katip m => OAuth2Env -> m (Maybe CredentialsJson)
- authResetWorkflow :: Katip m => OAuth2Env -> m (Maybe CredentialsJson)
- toGCredential :: OAuth2Conf -> OAuth2Token -> GCredentials
- urlBuilder :: OAuth2Env -> Text
- o2CodeUXhandler :: OAuth2Env -> IO OAuth2Code
- o2TokenFromO2Code :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> OAuth2Code -> m ByteString
- decodeO2Token :: MonadCatch m => OAuth2TokenByteString -> m OAuth2Token
- saveOAuth2Credentials :: MonadIO m => OAuth2Env -> ByteString -> m (Maybe CredentialsJson)
- authWorkflow :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> m (Maybe CredentialsJson)
Documentation
type OAuth2TokenByteString = ByteString #
Alias for OAuth2Token Lazy ByteString received from google oAuth service
displayCredentials :: Katip m => OAuth2Env -> m (Maybe CredentialsJson) #
Shows effective credential file
findCredentials :: Katip m => OAuth2Env -> m (Maybe CredentialsJson) #
FInds effective credential file
authResetWorkflow :: Katip m => OAuth2Env -> m (Maybe CredentialsJson) #
Resets authentication workflow removes the previously cached napkin auth file for this project
toGCredential :: OAuth2Conf -> OAuth2Token -> GCredentials #
Adds the required client_id and client_secret to the oAuth token
urlBuilder :: OAuth2Env -> Text #
Builds URL to send credentials to google authorization server. See step-3 https://cloud.google.com/community/tutorials/understanding-oauth2-and-deploy-a-basic-auth-srv-to-cloud-functions
o2CodeUXhandler :: OAuth2Env -> IO OAuth2Code #
Step 4, Get Authorization code from google Authorization server see https://cloud.google.com/community/tutorials/understanding-oauth2-and-deploy-a-basic-auth-srv-to-cloud-functions
o2TokenFromO2Code :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> OAuth2Code -> m ByteString #
Exchange authorization code for access token. Step 5 of the google oauth flow, see diagram https://cloud.google.com/community/tutorials/understanding-oauth2-and-deploy-a-basic-auth-srv-to-cloud-functions
:: MonadCatch m | |
=> OAuth2TokenByteString | oAuth2 token received from google oAuth backend |
-> m OAuth2Token |
decode oAuth2Token
:: MonadIO m | |
=> OAuth2Env | |
-> ByteString | Google Credential |
-> m (Maybe CredentialsJson) |
Creates credential file
We 1st create a temp credential file.
if we can create a Bigquery google environment, then the temp file is cashed
for future use
authWorkflow :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> m (Maybe CredentialsJson) #
Authentication workflow The work-flow : + creates credential file and stores in OS $TMP folder + attempts to create google env and bigquery env + if success, cache the tmp file napkin we'll know location for future use.