Safe Haskell | None |
---|---|
Language | Haskell2010 |
Network.Hawk.Internal.Server.Types
Description
Consider this module to be internal, and don't import directly.
- type AuthResult t = AuthResult' (AuthSuccess t)
- type AuthResult' r = Either AuthFail r
- data AuthFail
- data AuthSuccess t = AuthSuccess Credentials HeaderArtifacts t
- authValue :: AuthSuccess t -> t
- authFailMessage :: AuthFail -> String
- data HawkReq = HawkReq {}
- data Credentials = Credentials {
- scKey :: Key
- scAlgorithm :: HawkAlgo
- type CredentialsFunc m t = ClientId -> m (Either String (Credentials, t))
- type NonceFunc = Key -> POSIXTime -> Nonce -> IO Bool
- type Nonce = ByteString
Documentation
type AuthResult t = AuthResult' (AuthSuccess t) Source #
The end result of authentication.
type AuthResult' r = Either AuthFail r Source #
An intermediate result of authentication.
Authentication can fail in multiple ways. This type includes the information necessary to generate a suitable response for the client. In the case of a stale timestamp, the client may try another authenticated request.
data AuthSuccess t Source #
Successful authentication produces a set of credentials and
"artifacts". Also included in the result is the result of
CredentialsFunc
.
Constructors
AuthSuccess Credentials HeaderArtifacts t |
Instances
Eq t => Eq (AuthSuccess t) Source # | |
Show t => Show (AuthSuccess t) Source # | |
authValue :: AuthSuccess t -> t Source #
The result of an AuthSuccess
.
A package of values containing the attributes of a HTTP request which are relevant to Hawk authentication.
Constructors
HawkReq | |
Fields
|
data Credentials Source #
The set of data the server requires for key-based hash verification of artifacts.
Constructors
Credentials | |
Fields
|
Instances
type CredentialsFunc m t = ClientId -> m (Either String (Credentials, t)) Source #
A user-supplied callback to get credentials from a client identifier.
type NonceFunc = Key -> POSIXTime -> Nonce -> IO Bool Source #
User-supplied nonce validation function. It should return True
if the nonce is valid.
Checking nonces can prevent request replay attacks. If the same key and nonce have already been seen, then the request can be denied.
type Nonce = ByteString Source #
The nonce should be a short sequence of random ASCII characters.