servant-client-core-0.20.2: Core functionality and class for client function generation for servant APIs

Safe Haskell | None
Language | Haskell2010

Servant.Client.Core.Auth

Description

Authentication for clients

Synopsis

- type family AuthClientData a
- newtype AuthenticatedRequest a = AuthenticatedRequest {
  - unAuthReq :: (AuthClientData a, AuthClientData a -> Request -> Request)
  }
- mkAuthenticatedRequest :: AuthClientData a -> (AuthClientData a -> Request -> Request) -> AuthenticatedRequest a

# Documentation

type family AuthClientData a #

For a resource protected by authentication (e.g. AuthProtect), we need to provide the client with some data used to add authentication data to a request

NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

newtype AuthenticatedRequest a #

For better type inference and to avoid usage of a data family, we newtype wrap the combination of some `AuthClientData` and a function to add authentication data to a request

NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE

Constructors

AuthenticatedRequest |
Fields unAuthReq :: (AuthClientData a, AuthClientData a -> Request -> Request)

mkAuthenticatedRequest :: AuthClientData a -> (AuthClientData a -> Request -> Request) -> AuthenticatedRequest a #

Handy helper to avoid wrapping datatypes in tuples everywhere.

NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE