Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | me@jspha.com |
Safe Haskell | None |
- type OAuth ty a = OAuthT ty IO a
- runOAuth :: Cred ty -> Server -> OAuth ty a -> IO a
- data OAuthT ty m a
- runOAuthT :: (MonadIO m, MonadCatch m) => Cred ty -> Server -> OAuthT ty m a -> m a
- runOAuthT' :: (MonadIO m, MonadCatch m) => ManagerSettings -> Cred ty -> Server -> OAuthT ty m a -> m a
- oauth :: MonadIO m => Request -> OAuthT ty m Request
- sign :: Monad m => Oa ty -> Request -> OAuthT ty m Request
- newParams :: MonadIO m => OAuthT ty m (Oa ty)
- withGen :: Monad m => (SystemRNG -> m (a, SystemRNG)) -> OAuthT ty m a
- withManager :: Monad m => (Manager -> m a) -> OAuthT ty m a
- withCred :: Monad m => Cred ty -> OAuthT ty m a -> OAuthT ty' m a
- getServer :: Monad m => OAuthT ty m Server
- getCredentials :: Monad m => OAuthT ty m (Cred ty)
An OAuth Monad Transformer
A simple monad suitable for basic OAuth requests.
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
.
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.
getCredentials :: Monad m => OAuthT ty m (Cred ty)Source