diff --git a/servant-server/src/Servant/Server/Internal.hs b/servant-server/src/Servant/Server/Internal.hs index 98d75f1e..15bc3392 100644 --- a/servant-server/src/Servant/Server/Internal.hs +++ b/servant-server/src/Servant/Server/Internal.hs @@ -34,7 +34,7 @@ import qualified Data.ByteString.Lazy as BL import qualified Data.Map as M import Data.Maybe (mapMaybe, fromMaybe) import Data.String (fromString) -import Data.String.Conversions (cs, (<>), ConvertibleStrings) +import Data.String.Conversions (ConvertibleStrings, cs, (<>)) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding (decodeUtf8, @@ -51,6 +51,8 @@ import Network.Wai (Application, lazyRequestBody, rawQueryString, remoteHost, + Response, + Request, requestHeaders, requestMethod, responseLBS, vault) @@ -80,8 +82,8 @@ import Servant.Common.Text (FromText, fromText) import Servant.Server.Internal.Authentication (AuthData (authData), AuthProtected (..), checkAuthStrict, - onMissingAuthData, - onUnauthenticated) + AuthHandlers(onMissingAuthData, + onUnauthenticated)) import Servant.Server.Internal.PathInfo import Servant.Server.Internal.Router import Servant.Server.Internal.RoutingApplication diff --git a/servant-server/src/Servant/Server/Internal/Authentication.hs b/servant-server/src/Servant/Server/Internal/Authentication.hs index 02c09893..f594bc29 100644 --- a/servant-server/src/Servant/Server/Internal/Authentication.hs +++ b/servant-server/src/Servant/Server/Internal/Authentication.hs @@ -6,7 +6,7 @@ module Servant.Server.Internal.Authentication ( AuthProtected (..) , AuthData (..) -, AuthHandlers (..) +, AuthHandlers (AuthHandlers, onMissingAuthData, onUnauthenticated) , basicAuthLax , basicAuthStrict , laxProtect @@ -36,7 +36,7 @@ class AuthData a where -- | handlers to deal with authentication failures. data AuthHandlers authData = AuthHandlers { -- we couldn't find the right type of auth data (or any, for that matter) - onMissingauthData :: IO Response + onMissingAuthData :: IO Response , -- we found the right type of auth data in the request but the check failed onUnauthenticated :: authData -> IO Response