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

Portabilitynon-portable
Stabilityexperimental
Maintainerme@jspha.com
Safe HaskellNone

Network.OAuth.Stateful

Contents

Description

 

Synopsis

An OAuth Monad Transformer

type OAuth ty a = OAuthT ty IO aSource

runOAuth :: Cred ty -> Server -> OAuth ty a -> IO aSource

data OAuthT ty m a Source

A simple monad suitable for basic OAuth requests.

Instances

MonadTrans (OAuthT ty) 
Monad m => Monad (OAuthT ty m) 
Functor m => Functor (OAuthT ty m) 
(Monad m, Functor m) => Applicative (OAuthT ty m) 
MonadIO m => MonadIO (OAuthT ty m) 

runOAuthT :: (MonadIO m, MonadCatch m) => Cred ty -> Server -> OAuthT ty m a -> m aSource

runOAuthT' :: (MonadIO m, MonadCatch m) => ManagerSettings -> Cred ty -> Server -> OAuthT ty m a -> m aSource

Standard operations

These operations are similar to those exposed by Network.OAuth.Types.Params or Network.OAuth.Signing but use the OAuth monad state instead of needing manual threading.

oauth :: MonadIO m => Request -> OAuthT ty m RequestSource

Generate default OAuth parameters and use them to sign a request. This is the simplest OAuth method.

sign :: Monad m => Oa ty -> Request -> OAuthT ty m RequestSource

Sign a request using a set of parameters, Oa.

newParams :: MonadIO m => OAuthT ty m (Oa ty)Source

Create a fresh set of parameters.

OAuth State

withGen :: Monad m => (SystemRNG -> m (a, SystemRNG)) -> OAuthT ty m aSource

OAuthT retains a cryptographic random generator state.

withManager :: Monad m => (Manager -> m a) -> OAuthT ty m aSource

OAuthT retains a Network.HTTP.Client Manager. The Manager is created at the beginning of an OAuthT thread and destroyed at the end, so it's efficient to pipeline many OAuth requests together.

withCred :: Monad m => Cred ty -> OAuthT ty m a -> OAuthT ty' m aSource