Export the auth stuff for jwt

This commit is contained in:
Arian van Putten 2015-10-01 13:45:59 +02:00 committed by aaron levin
parent 51a68bd60d
commit a76b1f9e90

View file

@ -13,6 +13,8 @@ module Servant.Server.Internal.Authentication
, basicAuthStrict , basicAuthStrict
, laxProtect , laxProtect
, strictProtect , strictProtect
, jwtAuthHandlers
, jwtAuth
) where ) where
import Control.Monad (guard, (<=<)) import Control.Monad (guard, (<=<))
@ -133,5 +135,5 @@ jwtAuthHandlers =
-- One can use strictProtect and laxProtect to make more complex authentication -- One can use strictProtect and laxProtect to make more complex authentication
-- and authorization schemes. For an example of that, see our tutorial: @placeholder@ -- and authorization schemes. For an example of that, see our tutorial: @placeholder@
jwtAuth :: Secret -> subserver -> AuthProtected (JWT UnverifiedJWT) (JWT VerifiedJWT) subserver 'Strict jwtAuth :: Secret -> subserver -> AuthProtected (JWT UnverifiedJWT) (JWT VerifiedJWT) subserver 'Strict
jwtAuth secret subserver = strictProtect (return . JWT.verify secret) jwtAuthHandlers subserver jwtAuth secret subserver = strictProtect (return . JWT.verify secret) jwtAuthHandlers subserver