@@ -15,15 +15,21 @@ import Servant.Common.Req (Req)
15-- | For a resource protected by authentication (e.g. AuthProtect), we need
15-- | For a resource protected by authentication (e.g. AuthProtect), we need
16-- to provide the client with some data used to add authentication data
16-- to provide the client with some data used to add authentication data
17-- to a request
17-- to a request
19+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
18type family AuthClientData a :: *
20type family AuthClientData a :: *
20-- | For better type inference and to avoid usage of a data family, we newtype
22-- | For better type inference and to avoid usage of a data family, we newtype
21-- wrap the combination of some 'AuthClientData' and a function to add authentication
23-- wrap the combination of some 'AuthClientData' and a function to add authentication
22-- data to a request
24-- data to a request
26+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
23newtype AuthenticateReq a =
27newtype AuthenticateReq a =
24 AuthenticateReq { unAuthReq :: (AuthClientData a, AuthClientData a -> Req -> Req) }
28 AuthenticateReq { unAuthReq :: (AuthClientData a, AuthClientData a -> Req -> Req) }
26-- | Handy helper to avoid wrapping datatypes in tuples everywhere.
30-- | Handy helper to avoid wrapping datatypes in tuples everywhere.
32+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
27mkAuthenticateReq :: AuthClientData a
33mkAuthenticateReq :: AuthClientData a
28 -> (AuthClientData a -> Req -> Req)
34 -> (AuthClientData a -> Req -> Req)
29 -> AuthenticateReq a
35 -> AuthenticateReq a