From 71d5debdf1cfa999cd89d96cfbaaa97bf2de753c Mon Sep 17 00:00:00 2001 From: aaron levin Date: Thu, 24 Dec 2015 21:53:51 +0100 Subject: [PATCH] Incorporate new GADT-based auth into servant-docs --- servant-docs/example/greet.hs | 6 +++--- servant-docs/src/Servant/Docs/Internal.hs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/servant-docs/example/greet.hs b/servant-docs/example/greet.hs index 7d0f05a6..aa86245f 100644 --- a/servant-docs/example/greet.hs +++ b/servant-docs/example/greet.hs @@ -75,7 +75,7 @@ instance ToSample Cookie where instance ToSample SecretData where toSamples _ = singleSample (SecretData "shhhhh!") -instance ToAuthInfo (AuthProtect Cookie User policy) where +instance ToAuthInfo (AuthProtect Cookie User mP mE uP uE) where toAuthInfo _ = AuthenticationInfo "In this sentence we outline how authentication works." "The following data is required on each request as a serialized header." @@ -108,9 +108,9 @@ type TestApi = :<|> "greet" :> Capture "greetid" Text :> Delete '[JSON] () -- GET /private - :<|> "private" :> AuthProtect Cookie User 'Strict :> Get '[JSON] SecretData + :<|> "private" :> AuthProtect Cookie User 'Strict () 'Strict () :> Get '[JSON] SecretData -- GET /private-lax - :<|> "private-lax" :> AuthProtect Cookie User 'Lax :> Get '[JSON] SecretData + :<|> "private-lax" :> AuthProtect Cookie User 'Lax () 'Lax () :> Get '[JSON] SecretData testApi :: Proxy TestApi testApi = Proxy diff --git a/servant-docs/src/Servant/Docs/Internal.hs b/servant-docs/src/Servant/Docs/Internal.hs index 1b01c88e..53914ee3 100644 --- a/servant-docs/src/Servant/Docs/Internal.hs +++ b/servant-docs/src/Servant/Docs/Internal.hs @@ -727,14 +727,14 @@ instance ( HasDocs sublayout , ToSample auth , ToSample usr - , ToAuthInfo (AuthProtect auth usr policy) + , ToAuthInfo (AuthProtect auth usr mPolicy mError uPolicy uError) ) - => HasDocs (AuthProtect auth usr policy :> sublayout) where + => HasDocs (AuthProtect auth usr mPolicy mError uPolicy uError :> sublayout) where docsFor Proxy (endpoint, action) = docsFor (Proxy :: Proxy sublayout) (endpoint, action') where - authProxy = Proxy :: Proxy (AuthProtect auth usr policy) + authProxy = Proxy :: Proxy (AuthProtect auth usr mPolicy mError uPolicy uError) action' = over authInfo (|> toAuthInfo authProxy) action instance