on master help sign in
Add general Authentication combinators
038abb4aaron levin
servant/servant.cabal+1
@@ -26,6 +26,7 @@ source-repository head
26library
26library
27 exposed-modules:
27 exposed-modules:
28 Servant.API
28 Servant.API
29+ Servant.API.Auth
29 Servant.API.Alternative
30 Servant.API.Alternative
30 Servant.API.BasicAuth
31 Servant.API.BasicAuth
31 Servant.API.Capture
32 Servant.API.Capture
servant/src/Servant/API.hs+4
@@ -40,6 +40,9 @@ module Servant.API (
40 -- * Response Headers
40 -- * Response Headers
41 module Servant.API.ResponseHeaders,
41 module Servant.API.ResponseHeaders,
42
42
43+ -- * General Authentication
44+ module Servant.API.Auth,
45+
43 -- * Untyped endpoints
46 -- * Untyped endpoints
44 module Servant.API.Raw,
47 module Servant.API.Raw,
45 -- | Plugging in a wai 'Network.Wai.Application', serving directories
48 -- | Plugging in a wai 'Network.Wai.Application', serving directories
@@ -55,6 +58,7 @@ module Servant.API (
55
58
56import Servant.API.Alternative ((:<|>) (..))
59import Servant.API.Alternative ((:<|>) (..))
57import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
60import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
61+import Servant.API.Auth (AuthProtect)
58import Servant.API.Capture (Capture)
62import Servant.API.Capture (Capture)
59import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
63import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
60 FromFormUrlEncoded (..), JSON,
64 FromFormUrlEncoded (..), JSON,
servant/src/Servant/API/Auth.hsnew file+12
@@ -0,0 +1,12 @@
1+{-# LANGUAGE DataKinds #-}
2+{-# LANGUAGE DeriveDataTypeable #-}
3+{-# LANGUAGE KindSignatures #-}
4+{-# LANGUAGE PolyKinds #-}
5+module Servant.API.Auth where
6+
7+import Data.Typeable (Typeable)
8+
9+-- | A generalized Authentication combinator. Use this if you have a
10+-- non-standard authentication technique.
11+data AuthProtect (tag :: k) deriving (Typeable)
12+