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
|
||||
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)
|
||||
(authReq val req)
|
||||
baseurl
|
||||
manager
|
||||
|
||||
-- | If you have a 'Delete' endpoint in your API, the 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
|
||||
let getGet = getNth (Proxy :: Proxy 0) $ client api baseUrl manager
|
||||
|
||||
manager <- C.newManager C.defaultManagerSettings
|
||||
let getGet :: ExceptT ServantError IO Person
|
||||
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")]
|
||||
|
||||
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
|
||||
Left res <- runExceptT (getPrivatePerson (BasicAuth "xxx" "yyy"))
|
||||
|
|
|
@ -66,14 +66,14 @@ instance ToSample Greet where
|
|||
instance ToSample Int where
|
||||
toSamples _ = singleSample 1729
|
||||
|
||||
instance ToSample User User where
|
||||
toSample _ = Just (User "I'm a user!")
|
||||
instance ToSample User where
|
||||
toSamples _ = singleSample (User "I'm a user!")
|
||||
|
||||
instance ToSample Cookie Cookie where
|
||||
toSample _ = Just (Cookie "cookie")
|
||||
instance ToSample Cookie where
|
||||
toSamples _ = singleSample (Cookie "cookie")
|
||||
|
||||
instance ToSample SecretData SecretData where
|
||||
toSample _ = Just (SecretData "shhhhh!")
|
||||
instance ToSample SecretData where
|
||||
toSamples _ = singleSample (SecretData "shhhhh!")
|
||||
|
||||
instance ToAuthInfo (AuthProtect Cookie User policy) where
|
||||
toAuthInfo _ = AuthenticationInfo "In this sentence we outline how authentication works."
|
||||
|
|
|
@ -30,13 +30,12 @@ module Servant.Docs
|
|||
, DocOptions(..) , defaultDocOptions, maxSamples
|
||||
|
||||
, -- * Classes you need to implement for your types
|
||||
<<<<<<< HEAD
|
||||
ToSample(..)
|
||||
, toSample
|
||||
, noSamples
|
||||
, singleSample
|
||||
, samples
|
||||
ToAuthInfo(..)
|
||||
, ToAuthInfo(..)
|
||||
, sampleByteString
|
||||
, sampleByteStrings
|
||||
, ToParam(..)
|
||||
|
|
|
@ -725,8 +725,8 @@ instance
|
|||
{-# OVERLAPPABLE #-}
|
||||
#endif
|
||||
( HasDocs sublayout
|
||||
, ToSample auth auth
|
||||
, ToSample usr usr
|
||||
, ToSample auth
|
||||
, ToSample usr
|
||||
, ToAuthInfo (AuthProtect auth usr policy)
|
||||
)
|
||||
=> HasDocs (AuthProtect auth usr policy :> sublayout) where
|
||||
|
|
Loading…
Reference in a new issue