oauthenticated-0.0.5: Simple OAuth client code built atop http-conduit

Safe HaskellNone




Signing forms the core process for OAuth. Given a Request about to be sent, Server parameters, and a full Oa we append a set of parameters to the Request which turns it into a signed OAuth request.


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.

sign :: Oa ty -> Server -> Request -> RequestSource

Sign a request given generated parameters

Low-level interface

The low-level interface is used to build oauth and sign and can be useful for testing.

augmentRequest :: ParameterMethod -> Query -> Request -> RequestSource

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.

bodyParams :: Request -> QuerySource

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.