-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Library to authenticate with OAuth for Haskell web applications.
--
-- API docs and the README are available at
-- http://www.stackage.org/package/authenticate-oauth.
@package authenticate-oauth
@version 1.6
module Web.Authenticate.OAuth
-- | Data type for OAuth client (consumer).
--
-- The constructor for this data type is not exposed. Instead, you should
-- use the def method or newOAuth function to retrieve a
-- default instance, and then use the records below to make
-- modifications. This approach allows us to add configuration options
-- without breaking backwards compatibility.
data OAuth
-- | The default value for this type.
def :: Default a => a
-- | Default value for OAuth datatype. You must specify at least
-- oauthServerName, URIs and Tokens.
newOAuth :: OAuth
-- | Service name (default: "")
oauthServerName :: OAuth -> String
-- | URI to request temporary credential (default: ""). You MUST
-- specify if you use getTemporaryCredential',
-- getTemporaryCredentialProxy or getTemporaryCredential;
-- otherwise you can just leave this empty.
oauthRequestUri :: OAuth -> String
-- | Uri to obtain access token (default: ""). You MUST specify if
-- you use getAcessToken or getAccessToken' or
-- getAccessTokenWith; otherwise you can just leave this empty.
oauthAccessTokenUri :: OAuth -> String
-- | Uri to authorize (default: ""). You MUST specify if you use
-- authorizeUrl or authorizeZUrl'; otherwise you can just
-- leave this empty.
oauthAuthorizeUri :: OAuth -> String
-- | Signature Method (default: HMACSHA1)
oauthSignatureMethod :: OAuth -> SignMethod
-- | Consumer key (You MUST specify)
oauthConsumerKey :: OAuth -> ByteString
-- | Consumer Secret (You MUST specify)
oauthConsumerSecret :: OAuth -> ByteString
-- | Callback uri to redirect after authentication (default:
-- Nothing)
oauthCallback :: OAuth -> Maybe ByteString
-- | Optional authorization realm (default: Nothing)
oauthRealm :: OAuth -> Maybe ByteString
-- | OAuth spec version (default: OAuth10a)
oauthVersion :: OAuth -> OAuthVersion
data OAuthVersion
-- | OAuth protocol ver 1.0 (no oauth_verifier; differs from RFC 5849).
OAuth10 :: OAuthVersion
-- | OAuth protocol ver 1.0a. This corresponds to community's 1.0a spec and
-- RFC 5849.
OAuth10a :: OAuthVersion
-- | Data type for signature method.
data SignMethod
PLAINTEXT :: SignMethod
HMACSHA1 :: SignMethod
RSASHA1 :: PrivateKey -> SignMethod
-- | Data type for redential.
newtype Credential
Credential :: [(ByteString, ByteString)] -> Credential
[unCredential] :: Credential -> [(ByteString, ByteString)]
newtype OAuthException
OAuthException :: String -> OAuthException
-- | Data type for getAccessTokenWith method.
--
-- You can create values of this type using
-- defaultAccessTokenRequest.
--
-- Since 1.5.1
data AccessTokenRequest
-- | Create a value of type AccessTokenRequest with default values
-- filled in.
--
-- Note that this is a settings type. More information on usage can be
-- found at: http://www.yesodweb.com/book/settings-types.
--
-- Since 1.5.1
defaultAccessTokenRequest :: OAuth -> Credential -> Manager -> AccessTokenRequest
-- | add auth hook.
--
-- Default: addAuthHeader
--
-- Since 1.5.1
accessTokenAddAuth :: AccessTokenRequest -> (ByteString -> Credential -> Request -> Request)
-- | Request Hook.
--
-- Default: id
--
-- Since 1.5.1
accessTokenRequestHook :: AccessTokenRequest -> (Request -> Request)
-- | OAuth Application
--
-- Since 1.5.1
accessTokenOAuth :: AccessTokenRequest -> OAuth
-- | Temporary Credential (with oauth_verifier if >= 1.0a)
--
-- Since 1.5.1
accessTokenTemporaryCredential :: AccessTokenRequest -> Credential
-- | Manager
--
-- Since 1.5.1
accessTokenManager :: AccessTokenRequest -> Manager
-- | Convenient function to create Credential with OAuth Token and
-- Token Secret.
newCredential :: ByteString -> ByteString -> Credential
-- | Empty credential.
emptyCredential :: Credential
-- | Insert an oauth parameter into given Credential.
insert :: ByteString -> ByteString -> Credential -> Credential
-- | Remove an oauth parameter for key from given Credential.
delete :: ByteString -> Credential -> Credential
-- | Convenient method for inserting multiple parameters into credential.
inserts :: [(ByteString, ByteString)] -> Credential -> Credential
-- | Insert oauth-verifier on a Credential.
injectVerifier :: ByteString -> Credential -> Credential
-- | Add OAuth headers & sign to Request.
signOAuth :: MonadIO m => OAuth -> Credential -> Request -> m Request
-- | Generate OAuth signature. Used by signOAuth.
genSign :: MonadIO m => OAuth -> Credential -> Request -> m ByteString
-- | Test existing OAuth signature. Since 1.5.2
checkOAuth :: MonadIO m => OAuth -> Credential -> Request -> ExceptT OAuthException m Request
-- | Get temporary credential for requesting acces token.
getTemporaryCredential :: MonadIO m => OAuth -> Manager -> m Credential
-- | Get temporary credential for requesting access token with Scope
-- parameter.
getTemporaryCredentialWithScope :: MonadIO m => ByteString -> OAuth -> Manager -> m Credential
-- | Get temporary credential for requesting access token via the proxy.
getTemporaryCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> Manager -> m Credential
getTemporaryCredential' :: MonadIO m => (Request -> Request) -> OAuth -> Manager -> m Credential
-- | URL to obtain OAuth verifier.
authorizeUrl :: OAuth -> Credential -> String
-- | Convert OAuth and Credential to URL to authorize. This takes function
-- to choice parameter to pass to the server other than
-- oauth_callback or oauth_token.
authorizeUrl' :: (OAuth -> Credential -> SimpleQuery) -> OAuth -> Credential -> String
-- | Place the authentication information in a URL encoded body instead of
-- the Authorization header.
--
-- Note that the first parameter is used for realm in addAuthHeader, and
-- this function needs the same type. The parameter, however, is unused.
--
-- Since 1.5.1
addAuthBody :: a -> Credential -> Request -> Request
-- | Get Access token.
getAccessToken :: MonadIO m => OAuth -> Credential -> Manager -> m Credential
-- | Get Access token via the proxy.
getAccessTokenProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> Manager -> m Credential
-- | Get Access token.
getTokenCredential :: MonadIO m => OAuth -> Credential -> Manager -> m Credential
-- | Get Access token via the proxy.
getTokenCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> Manager -> m Credential
getAccessToken' :: MonadIO m => (Request -> Request) -> OAuth -> Credential -> Manager -> m Credential
getAccessTokenWith :: MonadIO m => AccessTokenRequest -> m (Either (Response ByteString) Credential)
-- | Encode a string using the percent encoding method for OAuth.
paramEncode :: ByteString -> ByteString
addScope :: ByteString -> Request -> Request
addMaybeProxy :: Maybe Proxy -> Request -> Request
instance Data.Data.Data Web.Authenticate.OAuth.Credential
instance GHC.Read.Read Web.Authenticate.OAuth.Credential
instance GHC.Classes.Ord Web.Authenticate.OAuth.Credential
instance GHC.Classes.Eq Web.Authenticate.OAuth.Credential
instance GHC.Show.Show Web.Authenticate.OAuth.Credential
instance Data.Data.Data Web.Authenticate.OAuth.OAuthException
instance GHC.Classes.Eq Web.Authenticate.OAuth.OAuthException
instance GHC.Show.Show Web.Authenticate.OAuth.OAuthException
instance Data.Data.Data Web.Authenticate.OAuth.OAuth
instance GHC.Read.Read Web.Authenticate.OAuth.OAuth
instance GHC.Classes.Eq Web.Authenticate.OAuth.OAuth
instance GHC.Show.Show Web.Authenticate.OAuth.OAuth
instance Data.Data.Data Web.Authenticate.OAuth.SignMethod
instance GHC.Read.Read Web.Authenticate.OAuth.SignMethod
instance GHC.Classes.Eq Web.Authenticate.OAuth.SignMethod
instance GHC.Show.Show Web.Authenticate.OAuth.SignMethod
instance GHC.Read.Read Web.Authenticate.OAuth.OAuthVersion
instance Data.Data.Data Web.Authenticate.OAuth.OAuthVersion
instance GHC.Classes.Ord Web.Authenticate.OAuth.OAuthVersion
instance GHC.Enum.Enum Web.Authenticate.OAuth.OAuthVersion
instance GHC.Classes.Eq Web.Authenticate.OAuth.OAuthVersion
instance GHC.Show.Show Web.Authenticate.OAuth.OAuthVersion
instance Data.Default.Class.Default Web.Authenticate.OAuth.OAuth
instance GHC.Exception.Exception Web.Authenticate.OAuth.OAuthException
-- | This Module provides interface for the instance of MonadIO
-- instead of MonadIO. What this module do is just adding
-- withManager or runResourceT.
-- | Deprecated: This module is deprecated; rewrite your code using
-- MonadResource
module Web.Authenticate.OAuth.IO
-- | Get Access token.
getAccessToken :: MonadIO m => OAuth -> Credential -> m Credential
-- | Get temporary credential for requesting acces token.
getTemporaryCredential :: MonadIO m => OAuth -> m Credential
-- | Get temporary credential for requesting access token with Scope
-- parameter.
getTemporaryCredentialWithScope :: MonadIO m => ByteString -> OAuth -> m Credential
-- | Get temporary credential for requesting access token via the proxy.
getTemporaryCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> m Credential
getTemporaryCredential' :: MonadIO m => (Request -> Request) -> OAuth -> m Credential
-- | Get Access token.
getTokenCredential :: MonadIO m => OAuth -> Credential -> m Credential
-- | Get Access token via the proxy.
getAccessTokenProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> m Credential
-- | Get Access token via the proxy.
getTokenCredentialProxy :: MonadIO m => Maybe Proxy -> OAuth -> Credential -> m Credential
getAccessToken' :: MonadIO m => (Request -> Request) -> OAuth -> Credential -> m Credential