Safe Haskell | None |
---|---|
Language | Haskell2010 |
Servant client authentication.
Synopsis
- data HmacSettings = HmacSettings {
- hmacSigner :: SecretKey -> ByteString -> Signature
- hmacSecretKey :: SecretKey
- hmacRequestHook :: Maybe (Request -> ClientM ())
- defaultHmacSettings :: SecretKey -> HmacSettings
- newtype HmacClientM a = HmacClientM {}
- runHmacClient :: HmacSettings -> ClientEnv -> HmacClientM a -> IO (Either ClientError a)
- hmacClient :: forall api. HasClient HmacClientM api => Client HmacClientM api
HMAC client settings
data HmacSettings Source #
Environment for HmacClientM
. Contains all required settings for hmac client.
HmacSettings | |
|
Instances
MonadReader HmacSettings HmacClientM Source # | |
Defined in Servant.Auth.Hmac.Client ask :: HmacClientM HmacSettings # local :: (HmacSettings -> HmacSettings) -> HmacClientM a -> HmacClientM a # reader :: (HmacSettings -> a) -> HmacClientM a # |
defaultHmacSettings :: SecretKey -> HmacSettings Source #
Default HmacSettings
with the following configuration:
- Signing function is
signSHA256
. - Secret key is provided.
hmacRequestHook
isNothing
.
HMAC servant client
newtype HmacClientM a Source #
newtype
wrapper over ClientM
that signs all outgoing requests
automatically.
Instances
runHmacClient :: HmacSettings -> ClientEnv -> HmacClientM a -> IO (Either ClientError a) Source #
hmacClient :: forall api. HasClient HmacClientM api => Client HmacClientM api Source #
Generates a set of client functions for an API.