git.iko.soy/typeable/servant
on master help sign in
Add Experimental warnings on combinators
commit29f8e64e1c91cb2107be471fc9efc344de7f899e authoraaron levin <aaron.levin@soundcloud.com> dateWed 17 Feb 2016, 22:01 (11 years ago) parentcd31b20
4 files changed+14−1
servant-client/src/Servant/Common/Auth.hs+6 servant-server/src/Servant/Server/Internal/Auth.hs+5 servant/servant.cabal+1−1 servant/src/Servant/API/Auth.hs → servant/src/Servant/Experimental/API/Auth.hs+2
servant-client/src/Servant/Common/Auth.hs+6
@@ -15,15 +15,21 @@ import Servant.Common.Req (Req)
1515-- | For a resource protected by authentication (e.g. AuthProtect), we need
1616-- to provide the client with some data used to add authentication data
1717-- to a request
18+--
19+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
1820type family AuthClientData a :: *
1921
2022-- | For better type inference and to avoid usage of a data family, we newtype
2123-- wrap the combination of some 'AuthClientData' and a function to add authentication
2224-- data to a request
25+--
26+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
2327newtype AuthenticateReq a =
2428 AuthenticateReq { unAuthReq :: (AuthClientData a, AuthClientData a -> Req -> Req) }
2529
2630-- | Handy helper to avoid wrapping datatypes in tuples everywhere.
31+--
32+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
2733mkAuthenticateReq :: AuthClientData a
2834 -> (AuthClientData a -> Req -> Req)
2935 -> AuthenticateReq a
servant-server/src/Servant/Server/Internal/Auth.hs+5
@@ -16,12 +16,17 @@ import Servant.Server.Internal.ServantErr (ServantErr)
1616
1717-- | Specify the type of data returned after we've authenticated a request.
1818-- quite often this is some `User` datatype.
19+--
20+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
1921type family AuthServerData a :: *
2022
2123-- | Handlers for AuthProtected resources
24+--
25+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
2226newtype AuthHandler r usr = AuthHandler
2327 { unAuthHandler :: r -> ExceptT ServantErr IO usr }
2428 deriving (Generic, Typeable)
2529
30+-- | NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE
2631mkAuthHandler :: (r -> ExceptT ServantErr IO usr) -> AuthHandler r usr
2732mkAuthHandler = AuthHandler
servant/servant.cabal+1−1
@@ -26,7 +26,6 @@ source-repository head
2626library
2727 exposed-modules:
2828 Servant.API
29− Servant.API.Auth
3029 Servant.API.Alternative
3130 Servant.API.BasicAuth
3231 Servant.API.Capture
@@ -44,6 +43,7 @@ library
4443 Servant.API.Vault
4544 Servant.API.Verbs
4645 Servant.API.WithNamedContext
46+ Servant.API.Experimental.Auth
4747 Servant.Utils.Links
4848 build-depends:
4949 base >=4.7 && <5
servant/src/Servant/API/Auth.hs → servant/src/Servant/Experimental/API/Auth.hsrenamed+2
@@ -8,5 +8,7 @@ import Data.Typeable (Typeable)
88
99-- | A generalized Authentication combinator. Use this if you have a
1010-- non-standard authentication technique.
11+--
12+-- NOTE: THIS API IS EXPERIMENTAL AND SUBJECT TO CHANGE.
1113data AuthProtect (tag :: k) deriving (Typeable)
1214