Copyright | 2016 |
---|---|
License | GPLv3 |
Maintainer | Gatlin Johnson <gatlin@niltag.net> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Defines functions necessary for generating OAuth 1.0a Authorization headers.
- auth_header :: MonadIO m => Credentials -> ByteString -> ByteString -> [Param] -> m ByteString
- param_string :: [Param] -> ByteString
- data Param = Param {
- paramKey :: ByteString
- paramValue :: ByteString
- data Credentials = Credentials {
- consumerKey :: ByteString
- consumerSecret :: ByteString
- token :: Maybe ByteString
- tokenSecret :: Maybe ByteString
- class PercentEncode t where
- percent_encode :: t -> t
- filterNonAlphanumeric :: ByteString -> ByteString
- gen_nonce :: MonadIO m => m ByteString
- timestamp :: MonadIO m => m Integer
- sig_base_string :: ByteString -> ByteString -> ByteString -> ByteString
- signing_key :: ByteString -> Maybe ByteString -> ByteString
- sign :: ByteString -> ByteString -> ByteString
- create_header_string :: [Param] -> ByteString
- oauth_sig :: MonadIO m => Credentials -> ByteString -> ByteString -> [Param] -> m [Param]
Documentation
:: MonadIO m | |
=> Credentials | |
-> ByteString | method |
-> ByteString | url |
-> [Param] | Any extra parameters |
-> m ByteString |
From start to finish creates the OAuth 1.0a header string
(what you would put as the value for the Authorization
header)
param_string :: [Param] -> ByteString Source
Generate a parameter string from a list of Param
HTTP request parameters
Param | |
|
data Credentials Source
Request credentials
Credentials | |
|
Show Credentials Source |
class PercentEncode t where Source
Types which may be percent encoded
percent_encode :: t -> t Source
PercentEncode ByteString Source | |
PercentEncode Param Source |
filterNonAlphanumeric :: ByteString -> ByteString Source
Filter all non-alphanumeric (by English standards) from a ByteString
sig_base_string :: ByteString -> ByteString -> ByteString -> ByteString Source
Create the base string which will be signed
signing_key :: ByteString -> Maybe ByteString -> ByteString Source
Create the OAuth signing key from the various access secrets
:: ByteString | Signing key |
-> ByteString | Message to sign |
-> ByteString | Resulting base64-encoded signature |
create_header_string :: [Param] -> ByteString Source
Generate the Authorization header given a list of Param
:: MonadIO m | |
=> Credentials | |
-> ByteString | method |
-> ByteString | url |
-> [Param] | any extra parameters |
-> m [Param] |
Generates the signature for a given request, not the full header