| Copyright | (c) Joseph Abrahamson 2013 |
|---|---|
| License | MIT |
| Maintainer | me@jspha.com |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.OAuth.Signing
Description
- oauth :: CPRG gen => Cred ty -> Server -> Request -> gen -> IO (Request, gen)
- sign :: Oa ty -> Server -> Request -> Request
- makeSignature :: SignatureMethod -> ByteString -> ByteString -> ByteString
- augmentRequest :: ParameterMethod -> Query -> Request -> Request
- canonicalBaseString :: Oa ty -> Server -> Request -> ByteString
- canonicalParams :: Oa ty -> Server -> Request -> ByteString
- oauthParams :: Oa ty -> Server -> Query
- canonicalUri :: Request -> ByteString
- bodyParams :: Request -> Query
- queryParams :: Request -> Query
Primary interface
The oauth and sign commands can be used as low level signing
primitives, and they are indeed used to build the Network.OAuth.Stateful
interface exported by default.
oauth :: CPRG gen => Cred ty -> Server -> Request -> gen -> IO (Request, gen) Source
Sign a request with a fresh set of parameters.
Low-level interface
makeSignature :: SignatureMethod -> ByteString -> ByteString -> ByteString Source
augmentRequest :: ParameterMethod -> Query -> Request -> Request Source
Augments whatever component of the Request is specified by
ParameterMethod with one built from the apropriate OAuth parameters
(passed as a Query).
Currently this actually replaces the Authorization header if one
exists. This may be a bad idea if the realm parameter is pre-set,
perhaps.
TODO: Parse Authorization header and augment it.
Currently this actually replaces the entity body if one exists. This is definitely just me being lazy.
TODO: Try to parse entity body and augment it.
canonicalBaseString :: Oa ty -> Server -> Request -> ByteString Source
canonicalParams :: Oa ty -> Server -> Request -> ByteString Source
oauthParams :: Oa ty -> Server -> Query Source
canonicalUri :: Request -> ByteString Source
bodyParams :: Request -> Query Source
Queries a Request body and tries to interpret it as a set of OAuth
valid parameters. It makes the assumption that if the body type is a
streaming variety then it is not a set of OAuth parameters---dropping this
assumption would prevent this from being pure.
queryParams :: Request -> Query Source