oauth10a-0.1.0.0: Simple utilities to create OAuth 1.0a headers

Copyright2016
LicenseGPLv3
MaintainerGatlin Johnson <gatlin@niltag.net>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Net.OAuth.OAuth10a

Description

Defines functions necessary for generating OAuth 1.0a Authorization headers.

Synopsis

Documentation

auth_header Source

Arguments

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

data Param Source

HTTP request parameters

Constructors

Param 

Fields

paramKey :: ByteString
 
paramValue :: ByteString
 

data Credentials Source

Request credentials

Constructors

Credentials 

Fields

consumerKey :: ByteString
 
consumerSecret :: ByteString
 
token :: Maybe ByteString
 
tokenSecret :: Maybe ByteString
 

Instances

class PercentEncode t where Source

Types which may be percent encoded

Methods

percent_encode :: t -> t Source

filterNonAlphanumeric :: ByteString -> ByteString Source

Filter all non-alphanumeric (by English standards) from a ByteString

gen_nonce :: MonadIO m => m ByteString Source

Generate the request nonce

timestamp :: MonadIO m => m Integer Source

Rounded integer number of seconds since the UNIX epoch

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

sign Source

Arguments

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

oauth_sig Source

Arguments

:: MonadIO m 
=> Credentials 
-> ByteString

method

-> ByteString

url

-> [Param]

any extra parameters

-> m [Param] 

Generates the signature for a given request, not the full header