From 8a26dc52c54d9a5c3e62e72b23dc7923773cf1cf Mon Sep 17 00:00:00 2001 From: aaron levin Date: Thu, 24 Dec 2015 22:07:25 +0100 Subject: [PATCH] update servant-foriegn for new GADT-based auth --- servant-foreign/src/Servant/Foreign/Internal.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/servant-foreign/src/Servant/Foreign/Internal.hs b/servant-foreign/src/Servant/Foreign/Internal.hs index 706afd7a..fbb40042 100644 --- a/servant-foreign/src/Servant/Foreign/Internal.hs +++ b/servant-foreign/src/Servant/Foreign/Internal.hs @@ -27,7 +27,7 @@ import GHC.Exts (Constraint) import GHC.TypeLits import Prelude hiding (concat) import Servant.API -import Servant.API.Authentication +import Servant.API.Authentication (AuthProtect, AuthPolicy) -- | Function name builder that simply concat each part together concatCase :: FunctionName -> Text @@ -354,8 +354,8 @@ listFromAPI :: (HasForeign lang api, GenerateList (Foreign api)) => Proxy lang - listFromAPI lang p = generateList (foreignFor lang p defReq) instance (HasForeign lang sublayout) - => HasForeign lang ((AuthProtect (BasicAuth realm) (usr :: *) (policy :: AuthPolicy) :> sublayout)) where - type Foreign (AuthProtect (BasicAuth realm) (usr :: *) (policy :: AuthPolicy) :> sublayout) = Foreign sublayout + => HasForeign lang ((AuthProtect (BasicAuth realm) (usr :: *) (mPolicy :: AuthPolicy) mError (uPolicy :: AuthPolicy) uError :> sublayout)) where + type Foreign (AuthProtect (BasicAuth realm) (usr :: *) (mPolicy :: AuthPolicy) mError (uPolicy :: AuthPolicy) uError :> sublayout) = Foreign sublayout foreignFor _ Proxy req = foreignFor (Proxy :: Proxy lang) (Proxy :: Proxy sublayout) (req & reqHeaders <>~ @@ -366,8 +366,8 @@ instance (HasForeign lang sublayout) ]) instance (HasForeign lang sublayout) - => HasForeign lang ((AuthProtect Text (usr :: *) (policy :: AuthPolicy) :> sublayout)) where - type Foreign (AuthProtect Text (usr :: *) (policy :: AuthPolicy) :> sublayout) = Foreign sublayout + => HasForeign lang ((AuthProtect Text (usr :: *) (mP :: AuthPolicy) mE (uP :: AuthPolicy) uE :> sublayout)) where + type Foreign (AuthProtect Text (usr :: *) (mP :: AuthPolicy) mE (uP :: AuthPolicy) uE :> sublayout) = Foreign sublayout foreignFor _ Proxy req = foreignFor (Proxy :: Proxy lang) (Proxy :: Proxy sublayout) (req & reqHeaders <>~