servant-auth-server-0.4.0.1: servant-server/servant-auth compatibility

Safe HaskellNone
LanguageHaskell2010

Servant.Auth.Server.Internal.Types

Synopsis

Documentation

data AuthResult val Source #

The result of an authentication attempt.

Constructors

BadPassword 
NoSuchUser 
Authenticated val

Authentication succeeded.

Indefinite

If an authentication procedure cannot be carried out - if for example it expects a password and username in a header that is not present - Indefinite is returned. This indicates that other authentication methods should be tried.

Instances
Monad AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

(>>=) :: AuthResult a -> (a -> AuthResult b) -> AuthResult b #

(>>) :: AuthResult a -> AuthResult b -> AuthResult b #

return :: a -> AuthResult a #

fail :: String -> AuthResult a #

Functor AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

fmap :: (a -> b) -> AuthResult a -> AuthResult b #

(<$) :: a -> AuthResult b -> AuthResult a #

Applicative AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

pure :: a -> AuthResult a #

(<*>) :: AuthResult (a -> b) -> AuthResult a -> AuthResult b #

liftA2 :: (a -> b -> c) -> AuthResult a -> AuthResult b -> AuthResult c #

(*>) :: AuthResult a -> AuthResult b -> AuthResult b #

(<*) :: AuthResult a -> AuthResult b -> AuthResult a #

Foldable AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

fold :: Monoid m => AuthResult m -> m #

foldMap :: Monoid m => (a -> m) -> AuthResult a -> m #

foldr :: (a -> b -> b) -> b -> AuthResult a -> b #

foldr' :: (a -> b -> b) -> b -> AuthResult a -> b #

foldl :: (b -> a -> b) -> b -> AuthResult a -> b #

foldl' :: (b -> a -> b) -> b -> AuthResult a -> b #

foldr1 :: (a -> a -> a) -> AuthResult a -> a #

foldl1 :: (a -> a -> a) -> AuthResult a -> a #

toList :: AuthResult a -> [a] #

null :: AuthResult a -> Bool #

length :: AuthResult a -> Int #

elem :: Eq a => a -> AuthResult a -> Bool #

maximum :: Ord a => AuthResult a -> a #

minimum :: Ord a => AuthResult a -> a #

sum :: Num a => AuthResult a -> a #

product :: Num a => AuthResult a -> a #

Traversable AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

traverse :: Applicative f => (a -> f b) -> AuthResult a -> f (AuthResult b) #

sequenceA :: Applicative f => AuthResult (f a) -> f (AuthResult a) #

mapM :: Monad m => (a -> m b) -> AuthResult a -> m (AuthResult b) #

sequence :: Monad m => AuthResult (m a) -> m (AuthResult a) #

Alternative AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

MonadPlus AuthResult Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Eq val => Eq (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

(==) :: AuthResult val -> AuthResult val -> Bool #

(/=) :: AuthResult val -> AuthResult val -> Bool #

Ord val => Ord (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

compare :: AuthResult val -> AuthResult val -> Ordering #

(<) :: AuthResult val -> AuthResult val -> Bool #

(<=) :: AuthResult val -> AuthResult val -> Bool #

(>) :: AuthResult val -> AuthResult val -> Bool #

(>=) :: AuthResult val -> AuthResult val -> Bool #

max :: AuthResult val -> AuthResult val -> AuthResult val #

min :: AuthResult val -> AuthResult val -> AuthResult val #

Read val => Read (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Show val => Show (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

showsPrec :: Int -> AuthResult val -> ShowS #

show :: AuthResult val -> String #

showList :: [AuthResult val] -> ShowS #

Generic (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Associated Types

type Rep (AuthResult val) :: * -> * #

Methods

from :: AuthResult val -> Rep (AuthResult val) x #

to :: Rep (AuthResult val) x -> AuthResult val #

Semigroup (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

(<>) :: AuthResult val -> AuthResult val -> AuthResult val #

sconcat :: NonEmpty (AuthResult val) -> AuthResult val #

stimes :: Integral b => b -> AuthResult val -> AuthResult val #

Monoid (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

mempty :: AuthResult val #

mappend :: AuthResult val -> AuthResult val -> AuthResult val #

mconcat :: [AuthResult val] -> AuthResult val #

type Rep (AuthResult val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

type Rep (AuthResult val) = D1 (MetaData "AuthResult" "Servant.Auth.Server.Internal.Types" "servant-auth-server-0.4.0.1-B5Ah7vB7bwPHTsml18azdn" False) ((C1 (MetaCons "BadPassword" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "NoSuchUser" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "Authenticated" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 val)) :+: C1 (MetaCons "Indefinite" PrefixI False) (U1 :: * -> *)))

newtype AuthCheck val Source #

An AuthCheck is the function used to decide the authentication status (the AuthResult) of a request. Different AuthChecks may be combined as a Monoid or Alternative; the semantics of this is that the *first* non-Indefinite result from left to right is used.

Constructors

AuthCheck 

Fields

Instances
Monad AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

(>>=) :: AuthCheck a -> (a -> AuthCheck b) -> AuthCheck b #

(>>) :: AuthCheck a -> AuthCheck b -> AuthCheck b #

return :: a -> AuthCheck a #

fail :: String -> AuthCheck a #

Functor AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

fmap :: (a -> b) -> AuthCheck a -> AuthCheck b #

(<$) :: a -> AuthCheck b -> AuthCheck a #

Applicative AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

pure :: a -> AuthCheck a #

(<*>) :: AuthCheck (a -> b) -> AuthCheck a -> AuthCheck b #

liftA2 :: (a -> b -> c) -> AuthCheck a -> AuthCheck b -> AuthCheck c #

(*>) :: AuthCheck a -> AuthCheck b -> AuthCheck b #

(<*) :: AuthCheck a -> AuthCheck b -> AuthCheck a #

Alternative AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

empty :: AuthCheck a #

(<|>) :: AuthCheck a -> AuthCheck a -> AuthCheck a #

some :: AuthCheck a -> AuthCheck [a] #

many :: AuthCheck a -> AuthCheck [a] #

MonadPlus AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

mzero :: AuthCheck a #

mplus :: AuthCheck a -> AuthCheck a -> AuthCheck a #

MonadIO AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

liftIO :: IO a -> AuthCheck a #

MonadTime AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

MonadReader Request AuthCheck Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

ask :: AuthCheck Request #

local :: (Request -> Request) -> AuthCheck a -> AuthCheck a #

reader :: (Request -> a) -> AuthCheck a #

Generic (AuthCheck val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Associated Types

type Rep (AuthCheck val) :: * -> * #

Methods

from :: AuthCheck val -> Rep (AuthCheck val) x #

to :: Rep (AuthCheck val) x -> AuthCheck val #

Semigroup (AuthCheck val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

(<>) :: AuthCheck val -> AuthCheck val -> AuthCheck val #

sconcat :: NonEmpty (AuthCheck val) -> AuthCheck val #

stimes :: Integral b => b -> AuthCheck val -> AuthCheck val #

Monoid (AuthCheck val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

Methods

mempty :: AuthCheck val #

mappend :: AuthCheck val -> AuthCheck val -> AuthCheck val #

mconcat :: [AuthCheck val] -> AuthCheck val #

type Rep (AuthCheck val) Source # 
Instance details

Defined in Servant.Auth.Server.Internal.Types

type Rep (AuthCheck val) = D1 (MetaData "AuthCheck" "Servant.Auth.Server.Internal.Types" "servant-auth-server-0.4.0.1-B5Ah7vB7bwPHTsml18azdn" True) (C1 (MetaCons "AuthCheck" PrefixI True) (S1 (MetaSel (Just "runAuthCheck") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Request -> IO (AuthResult val)))))