Add general Authentication combinators

This commit is contained in:
aaron levin 2016-02-17 20:59:58 +01:00
parent 51dbd82c16
commit 038abb433d
3 changed files with 17 additions and 0 deletions

View File

@ -26,6 +26,7 @@ source-repository head
library library
exposed-modules: exposed-modules:
Servant.API Servant.API
Servant.API.Auth
Servant.API.Alternative Servant.API.Alternative
Servant.API.BasicAuth Servant.API.BasicAuth
Servant.API.Capture Servant.API.Capture

View File

@ -40,6 +40,9 @@ module Servant.API (
-- * Response Headers -- * Response Headers
module Servant.API.ResponseHeaders, module Servant.API.ResponseHeaders,
-- * General Authentication
module Servant.API.Auth,
-- * Untyped endpoints -- * Untyped endpoints
module Servant.API.Raw, module Servant.API.Raw,
-- | Plugging in a wai 'Network.Wai.Application', serving directories -- | Plugging in a wai 'Network.Wai.Application', serving directories
@ -55,6 +58,7 @@ module Servant.API (
import Servant.API.Alternative ((:<|>) (..)) import Servant.API.Alternative ((:<|>) (..))
import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..)) import Servant.API.BasicAuth (BasicAuth,BasicAuthData(..))
import Servant.API.Auth (AuthProtect)
import Servant.API.Capture (Capture) import Servant.API.Capture (Capture)
import Servant.API.ContentTypes (Accept (..), FormUrlEncoded, import Servant.API.ContentTypes (Accept (..), FormUrlEncoded,
FromFormUrlEncoded (..), JSON, FromFormUrlEncoded (..), JSON,

View File

@ -0,0 +1,12 @@
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE KindSignatures #-}
{-# LANGUAGE PolyKinds #-}
module Servant.API.Auth where
import Data.Typeable (Typeable)
-- | A generalized Authentication combinator. Use this if you have a
-- non-standard authentication technique.
data AuthProtect (tag :: k) deriving (Typeable)