Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data BasicAuthResult usr
- = Unauthorized
- | BadPassword
- | NoSuchUser
- | Authorized usr
- newtype BasicAuthCheck m usr = BasicAuthCheck {
- unBasicAuthCheck :: BasicAuthData -> m (BasicAuthResult usr)
- mkBAChallengerHdr :: ByteString -> (CI ByteString, ByteString)
- decodeBAHdr :: Request -> Maybe BasicAuthData
- runBasicAuth :: MonadSnap m => Request -> ByteString -> BasicAuthCheck m usr -> DelayedM m usr
Basic Auth
data BasicAuthResult usr Source #
servant-server's current implementation of basic authentication is not immune to certian kinds of timing attacks. Decoding payloads does not take a fixed amount of time.
The result of authentication/authorization
Instances
newtype BasicAuthCheck m usr Source #
Datatype wrapping a function used to check authentication.
BasicAuthCheck | |
|
Instances
Functor m => Functor (BasicAuthCheck m) Source # | |
Defined in Servant.Server.Internal.BasicAuth fmap :: (a -> b) -> BasicAuthCheck m a -> BasicAuthCheck m b # (<$) :: a -> BasicAuthCheck m b -> BasicAuthCheck m a # | |
Generic (BasicAuthCheck m usr) Source # | |
Defined in Servant.Server.Internal.BasicAuth type Rep (BasicAuthCheck m usr) :: Type -> Type # from :: BasicAuthCheck m usr -> Rep (BasicAuthCheck m usr) x # to :: Rep (BasicAuthCheck m usr) x -> BasicAuthCheck m usr # | |
type Rep (BasicAuthCheck m usr) Source # | |
Defined in Servant.Server.Internal.BasicAuth type Rep (BasicAuthCheck m usr) = D1 (MetaData "BasicAuthCheck" "Servant.Server.Internal.BasicAuth" "servant-snap-0.8.3.1-A0aMkouUYQH6GhVU2N5w4z" True) (C1 (MetaCons "BasicAuthCheck" PrefixI True) (S1 (MetaSel (Just "unBasicAuthCheck") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (BasicAuthData -> m (BasicAuthResult usr))))) |
mkBAChallengerHdr :: ByteString -> (CI ByteString, ByteString) Source #
Internal method to make a basic-auth challenge
decodeBAHdr :: Request -> Maybe BasicAuthData Source #
Find and decode an Authorization
header from the request as Basic Auth
runBasicAuth :: MonadSnap m => Request -> ByteString -> BasicAuthCheck m usr -> DelayedM m usr Source #
Run and check basic authentication, returning the appropriate http error per the spec.