servant-auth-token-0.5.6.0: Servant based API and server for token based authorisation

Copyright(c) Anton Gushcha 2016
LicenseMIT
Maintainerncrashed@gmail.com
Stabilityexperimental
PortabilityPortable
Safe HaskellNone
LanguageHaskell2010

Servant.Server.Auth.Token.Monad

Description

 
Synopsis

Documentation

type AuthHandler m = (HasAuthConfig m, MonadError ServantErr m, MonadIO m, HasStorage m) Source #

Context that is needed to run the auth server

class Monad m => HasAuthConfig m where Source #

Monad that can read an auth config

Instances
HasAuthConfig m => HasAuthConfig (ExceptT e m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

(HasAuthConfig m, Monoid w) => HasAuthConfig (WriterT w m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

HasAuthConfig m => HasAuthConfig (StateT s m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

HasAuthConfig m => HasAuthConfig (StateT s m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

(HasAuthConfig m, Monoid w) => HasAuthConfig (WriterT w m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

HasAuthConfig m => HasAuthConfig (ReaderT r m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

HasAuthConfig m => HasAuthConfig (ContT r m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

(HasAuthConfig m, Monoid w) => HasAuthConfig (RWST r w s m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

(HasAuthConfig m, Monoid w) => HasAuthConfig (RWST r w s m) Source # 
Instance details

Defined in Servant.Server.Auth.Token.Config

require :: AuthHandler m => ByteString -> Maybe a -> m a Source #

If the value is Nothing, throw 400 response

getConfig :: AuthHandler m => m AuthConfig Source #

Getting config from global state

getsConfig :: AuthHandler m => (AuthConfig -> a) -> m a Source #

Getting config part from global state

guard404 :: AuthHandler m => ByteString -> m (Maybe a) -> m a Source #

Run RDBMS operation and throw 404 (not found) error if the second arg returns Nothing