| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Servant.Server.Internal.BasicAuth
Contents
- 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
Constructors
| Unauthorized | |
| BadPassword | |
| NoSuchUser | |
| Authorized usr |
Instances
| Functor BasicAuthResult Source # | |
| Eq usr => Eq (BasicAuthResult usr) Source # | |
| Read usr => Read (BasicAuthResult usr) Source # | |
| Show usr => Show (BasicAuthResult usr) Source # | |
| Generic (BasicAuthResult usr) Source # | |
| type Rep (BasicAuthResult usr) Source # | |
newtype BasicAuthCheck m usr Source #
Datatype wrapping a function used to check authentication.
Constructors
| BasicAuthCheck | |
Fields
| |
Instances
| Functor m => Functor (BasicAuthCheck m) Source # | |
| Generic (BasicAuthCheck m usr) Source # | |
| type Rep (BasicAuthCheck m usr) Source # | |
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.