napkin-0.5.12
Copyright(c) Soostone Inc 2020
LicenseAllRightsReserved
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Napkin.Auth.GoogleOAuth

Description

 
Synopsis

Documentation

type OAuth2TokenByteString = ByteString #

Alias for OAuth2Token Lazy ByteString received from google oAuth service

callbackUrlWhenNoXWindow :: Text #

the google oAuth default callback URL this value will required the user to manually cut/paste the oAuth code, code received from google oAuth server, into the corresponding browser. We mostly use this approach for headless VMs See docs: https://developers.google.com/youtube/v3/live/guides/auth/installed-apps

displayCredentials :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> m (Maybe CredentialsJson) #

napkin show napkin effective credential file

findCredentials :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> m (Maybe CredentialsJson) #

napkin show napkin effective credential file

authResetWorkflow :: (MonadIO m, MonadCatch m, Katip m) => OAuth2Env -> m (Maybe CredentialsJson) #

napkin reset authentication workflow removes the previously cached napkin auth file for this project

toGCredential :: OAuth2Conf -> OAuth2Token -> GCredentials #

add the required client_id and client_secret to the oAuth token

decodeO2Token #

Arguments

:: MonadCatch m 
=> OAuth2TokenByteString

oAuth2 token received from google oAuth backend

-> m OAuth2Token 

decode oAuth2Token

saveOAuth2Credentials #

Arguments

:: 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) #

napkin 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 well know location for future use.