Solve extra merge conflicts
This commit is contained in:
parent
c64fa05611
commit
79ac58a33d
5 changed files with 13 additions and 12 deletions
|
@ -125,10 +125,11 @@ instance (KnownSymbol capture, ToHttpApiData a, HasClient sublayout)
|
||||||
instance (AuthenticateRequest authdata, HasClient sublayout) => HasClient (AuthProtect authdata (usr :: *) policy :> sublayout) where
|
instance (AuthenticateRequest authdata, HasClient sublayout) => HasClient (AuthProtect authdata (usr :: *) policy :> sublayout) where
|
||||||
type Client (AuthProtect authdata usr policy :> sublayout) = authdata -> Client sublayout
|
type Client (AuthProtect authdata usr policy :> sublayout) = authdata -> Client sublayout
|
||||||
|
|
||||||
clientWithRoute Proxy req baseurl val =
|
clientWithRoute Proxy req baseurl manager val =
|
||||||
clientWithRoute (Proxy :: Proxy sublayout)
|
clientWithRoute (Proxy :: Proxy sublayout)
|
||||||
(authReq val req)
|
(authReq val req)
|
||||||
baseurl
|
baseurl
|
||||||
|
manager
|
||||||
|
|
||||||
-- | If you have a 'Delete' endpoint in your API, the client
|
-- | If you have a 'Delete' endpoint in your API, the client
|
||||||
-- side querying function that is created when calling 'client'
|
-- side querying function that is created when calling 'client'
|
||||||
|
|
|
@ -173,6 +173,7 @@ sucessSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do
|
||||||
|
|
||||||
it "Servant.API.Get" $ \(_, baseUrl) -> do
|
it "Servant.API.Get" $ \(_, baseUrl) -> do
|
||||||
let getGet = getNth (Proxy :: Proxy 0) $ client api baseUrl manager
|
let getGet = getNth (Proxy :: Proxy 0) $ client api baseUrl manager
|
||||||
|
|
||||||
manager <- C.newManager C.defaultManagerSettings
|
manager <- C.newManager C.defaultManagerSettings
|
||||||
let getGet :: ExceptT ServantError IO Person
|
let getGet :: ExceptT ServantError IO Person
|
||||||
getDeleteEmpty :: ExceptT ServantError IO ()
|
getDeleteEmpty :: ExceptT ServantError IO ()
|
||||||
|
@ -273,7 +274,7 @@ sucessSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do
|
||||||
Right val -> getHeaders val `shouldBe` [("X-Example1", "1729"), ("X-Example2", "eg2")]
|
Right val -> getHeaders val `shouldBe` [("X-Example1", "1729"), ("X-Example2", "eg2")]
|
||||||
|
|
||||||
it "Handles Authentication appropriatley" $ withServer $ \ _ -> do
|
it "Handles Authentication appropriatley" $ withServer $ \ _ -> do
|
||||||
(Arrow.left show <$> runExceptT (getPrivatePerson (BasicAuth "servant" "server"))) `shouldReturn` Right alice
|
(Control.Arrow.left show <$> runExceptT (getPrivatePerson (BasicAuth "servant" "server"))) `shouldReturn` Right alice
|
||||||
|
|
||||||
it "returns 401 when not properly authenticated" $ do
|
it "returns 401 when not properly authenticated" $ do
|
||||||
Left res <- runExceptT (getPrivatePerson (BasicAuth "xxx" "yyy"))
|
Left res <- runExceptT (getPrivatePerson (BasicAuth "xxx" "yyy"))
|
||||||
|
|
|
@ -66,14 +66,14 @@ instance ToSample Greet where
|
||||||
instance ToSample Int where
|
instance ToSample Int where
|
||||||
toSamples _ = singleSample 1729
|
toSamples _ = singleSample 1729
|
||||||
|
|
||||||
instance ToSample User User where
|
instance ToSample User where
|
||||||
toSample _ = Just (User "I'm a user!")
|
toSamples _ = singleSample (User "I'm a user!")
|
||||||
|
|
||||||
instance ToSample Cookie Cookie where
|
instance ToSample Cookie where
|
||||||
toSample _ = Just (Cookie "cookie")
|
toSamples _ = singleSample (Cookie "cookie")
|
||||||
|
|
||||||
instance ToSample SecretData SecretData where
|
instance ToSample SecretData where
|
||||||
toSample _ = Just (SecretData "shhhhh!")
|
toSamples _ = singleSample (SecretData "shhhhh!")
|
||||||
|
|
||||||
instance ToAuthInfo (AuthProtect Cookie User policy) where
|
instance ToAuthInfo (AuthProtect Cookie User policy) where
|
||||||
toAuthInfo _ = AuthenticationInfo "In this sentence we outline how authentication works."
|
toAuthInfo _ = AuthenticationInfo "In this sentence we outline how authentication works."
|
||||||
|
|
|
@ -30,13 +30,12 @@ module Servant.Docs
|
||||||
, DocOptions(..) , defaultDocOptions, maxSamples
|
, DocOptions(..) , defaultDocOptions, maxSamples
|
||||||
|
|
||||||
, -- * Classes you need to implement for your types
|
, -- * Classes you need to implement for your types
|
||||||
<<<<<<< HEAD
|
|
||||||
ToSample(..)
|
ToSample(..)
|
||||||
, toSample
|
, toSample
|
||||||
, noSamples
|
, noSamples
|
||||||
, singleSample
|
, singleSample
|
||||||
, samples
|
, samples
|
||||||
ToAuthInfo(..)
|
, ToAuthInfo(..)
|
||||||
, sampleByteString
|
, sampleByteString
|
||||||
, sampleByteStrings
|
, sampleByteStrings
|
||||||
, ToParam(..)
|
, ToParam(..)
|
||||||
|
|
|
@ -725,8 +725,8 @@ instance
|
||||||
{-# OVERLAPPABLE #-}
|
{-# OVERLAPPABLE #-}
|
||||||
#endif
|
#endif
|
||||||
( HasDocs sublayout
|
( HasDocs sublayout
|
||||||
, ToSample auth auth
|
, ToSample auth
|
||||||
, ToSample usr usr
|
, ToSample usr
|
||||||
, ToAuthInfo (AuthProtect auth usr policy)
|
, ToAuthInfo (AuthProtect auth usr policy)
|
||||||
)
|
)
|
||||||
=> HasDocs (AuthProtect auth usr policy :> sublayout) where
|
=> HasDocs (AuthProtect auth usr policy :> sublayout) where
|
||||||
|
|
Loading…
Reference in a new issue