servant-0.11: A family of combinators for defining webservices APIs

Safe Haskell | Safe
Language | Haskell2010

Servant.API.BasicAuth

Synopsis

- data BasicAuth realm userData
- data BasicAuthData = BasicAuthData {
  - basicAuthUsername :: !ByteString
  - basicAuthPassword :: !ByteString
  }

# Documentation

data BasicAuth realm userData #

Combinator for Basic Access Authentication.

- IMPORTANT*: Only use Basic Auth over HTTPS! Credentials are not hashed or encrypted. Note also that because the same credentials are sent on every request, Basic Auth is not as secure as some alternatives. Further, the implementation in servant-server does not protect against some types of timing attacks.

In Basic Auth, username and password are base64-encoded and transmitted via the `Authorization` header. Handshakes are not required, making it relatively efficient.

Instances

HasLink k sub => HasLink * ((:>) k * (BasicAuth realm a) sub) # |
Associated Types type MkLink ((:>) k * (BasicAuth realm a) sub) (endpoint :: (:>) k * (BasicAuth realm a) sub) :: * # Methods toLink :: Proxy ((k :> *) (BasicAuth realm a) sub) endpoint -> Link -> MkLink ((k :> *) (BasicAuth realm a) sub) endpoint #
type MkLink * ((:>) k * (BasicAuth realm a) sub) # |
type MkLink * ((:>) k * (BasicAuth realm a) sub) = MkLink k sub

data BasicAuthData #

A simple datatype to hold data required to decorate a request

Constructors

BasicAuthData |
Fields basicAuthUsername :: !ByteString basicAuthPassword :: !ByteString