Skip to content

Commit 3900130

Browse files
authored
Merge branch 'haskell-servant:master' into resolve-warnings
2 parents 4ad54b6 + 8f081bd commit 3900130

File tree

18 files changed

+29
-28
lines changed

18 files changed

+29
-28
lines changed

servant-auth/servant-auth-client/servant-auth-client.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ test-suite spec
7474
, transformers >= 0.4.2.0 && < 0.6
7575
, wai >= 3.2.1.2 && < 3.3
7676
, warp >= 3.2.25 && < 3.4
77-
, jose >= 0.7.0.0 && < 0.10
77+
, jose >= 0.10 && < 0.11
7878
other-modules:
7979
Servant.Auth.ClientSpec
8080
default-language: Haskell2010

servant-auth/servant-auth-server/servant-auth-server.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ library
4141
, data-default-class >= 0.1.2.0 && < 0.2
4242
, entropy >= 0.4.1.3 && < 0.5
4343
, http-types >= 0.12.2 && < 0.13
44-
, jose >= 0.7.0.0 && < 0.10
44+
, jose >= 0.10 && < 0.11
4545
, lens >= 4.16.1 && < 5.3
4646
, memory >= 0.14.16 && < 0.19
4747
, monad-time >= 0.3.1.0 && < 0.4
48-
, mtl >= 2.2.2 && < 2.3
48+
, mtl ^>= 2.2.2 || ^>= 2.3.1
4949
, servant >= 0.13 && < 0.20
5050
, servant-auth == 0.4.*
5151
, servant-server >= 0.13 && < 0.20

servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/Cookie.hs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
module Servant.Auth.Server.Internal.Cookie where
33

44
import Blaze.ByteString.Builder (toByteString)
5+
import Control.Monad (MonadPlus(..), guard)
56
import Control.Monad.Except
67
import Control.Monad.Reader
78
import qualified Crypto.JOSE as Jose

servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/JWT.hs

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
module Servant.Auth.Server.Internal.JWT where
22

33
import Control.Lens
4-
import Control.Monad.Except
4+
import Control.Monad (MonadPlus(..), guard)
55
import Control.Monad.Reader
66
import qualified Crypto.JOSE as Jose
77
import qualified Crypto.JWT as Jose
8-
import Data.Aeson (FromJSON, Result (..), ToJSON, fromJSON,
9-
toJSON)
108
import Data.ByteArray (constEq)
119
import qualified Data.ByteString as BS
1210
import qualified Data.ByteString.Lazy as BSL
13-
import qualified Data.HashMap.Strict as HM
1411
import Data.Maybe (fromMaybe)
15-
import qualified Data.Text as T
1612
import Data.Time (UTCTime)
1713
import Network.Wai (requestHeaders)
1814

@@ -42,7 +38,7 @@ jwtAuthCheck jwtSettings = do
4238
-- token expires.
4339
makeJWT :: ToJWT a
4440
=> a -> JWTSettings -> Maybe UTCTime -> IO (Either Jose.Error BSL.ByteString)
45-
makeJWT v cfg expiry = runExceptT $ do
41+
makeJWT v cfg expiry = Jose.runJOSE $ do
4642
bestAlg <- Jose.bestJWSAlg $ signingKey cfg
4743
let alg = fromMaybe bestAlg $ jwtAlg cfg
4844
ejwt <- Jose.signClaims (signingKey cfg)
@@ -59,7 +55,7 @@ makeJWT v cfg expiry = runExceptT $ do
5955
verifyJWT :: FromJWT a => JWTSettings -> BS.ByteString -> IO (Maybe a)
6056
verifyJWT jwtCfg input = do
6157
keys <- validationKeys jwtCfg
62-
verifiedJWT <- runExceptT $ do
58+
verifiedJWT <- Jose.runJOSE $ do
6359
unverifiedJWT <- Jose.decodeCompact (BSL.fromStrict input)
6460
Jose.verifyClaims
6561
(jwtSettingsToJwtValidationSettings jwtCfg)

servant-auth/servant-auth-server/src/Servant/Auth/Server/Internal/Types.hs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
module Servant.Auth.Server.Internal.Types where
33

44
import Control.Applicative
5+
import Control.Monad (MonadPlus(..), ap)
56
import Control.Monad.Reader
67
import Control.Monad.Time
78
import Data.Monoid (Monoid (..))

servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ module Servant.Auth.ServerSpec (spec) where
66
#endif
77

88
import Control.Lens
9-
import Control.Monad.Except (runExceptT)
109
import Control.Monad.IO.Class (liftIO)
1110
import Crypto.JOSE (Alg (HS256, None), Error,
1211
JWK, JWSHeader,
1312
KeyMaterialGenParam (OctGenParam),
1413
ToCompact, encodeCompact,
15-
genJWK, newJWSHeader)
14+
genJWK, newJWSHeader, runJOSE)
1615
import Crypto.JWT (Audience (..), ClaimsSet,
1716
NumericDate (NumericDate),
1817
SignedJWT,
@@ -540,7 +539,7 @@ addJwtToHeader jwt = case jwt of
540539
$ defaults & header "Authorization" .~ ["Bearer " <> BSL.toStrict v]
541540

542541
createJWT :: JWK -> JWSHeader () -> ClaimsSet -> IO (Either Error Crypto.JWT.SignedJWT)
543-
createJWT k a b = runExceptT $ signClaims k a b
542+
createJWT k a b = runJOSE $ signClaims k a b
544543

545544
addJwtToCookie :: ToCompact a => CookieSettings -> Either Error a -> IO Options
546545
addJwtToCookie ccfg jwt = case jwt >>= (return . encodeCompact) of

servant-auth/servant-auth/servant-auth.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ library
3636
base >= 4.10 && < 4.18
3737
, containers >= 0.6 && < 0.7
3838
, aeson >= 1.3.1.1 && < 3
39-
, jose >= 0.7.0.0 && < 0.10
39+
, jose >= 0.10 && < 0.11
4040
, lens >= 4.16.1 && < 5.3
4141
, servant >= 0.15 && < 0.20
4242
, text >= 1.2.3.0 && < 2.1

servant-client-core/servant-client-core.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ library
5858
, containers >= 0.5.7.1 && < 0.7
5959
, deepseq >= 1.4.2.0 && < 1.5
6060
, text >= 1.2.3.0 && < 2.1
61-
, transformers >= 0.5.2.0 && < 0.6
61+
, transformers >= 0.5.2.0 && < 0.7
6262
, template-haskell >= 2.11.1.0 && < 2.20
6363

6464
if !impl(ghc >= 8.2)

servant-client-ghcjs/servant-client-ghcjs.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ library
4848
, http-media >=0.6.2 && <0.9
4949
, http-types >=0.12 && <0.13
5050
, monad-control >=1.0.0.4 && <1.1
51-
, mtl >=2.2.2 && <2.3
51+
, mtl ^>=2.2.2 || ^>=2.3.1
5252
, semigroupoids >=5.3 && <5.4
5353
, string-conversions >=0.3 && <0.5
5454
, transformers >=0.3 && <0.6

servant-client/servant-client.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ library
4545
, bytestring >= 0.10.8.1 && < 0.12
4646
, containers >= 0.5.7.1 && < 0.7
4747
, deepseq >= 1.4.2.0 && < 1.5
48-
, mtl >= 2.2.2 && < 2.3
48+
, mtl ^>= 2.2.2 || ^>= 2.3.1
4949
, stm >= 2.4.5.1 && < 2.6
5050
, text >= 1.2.3.0 && < 2.1
5151
, time >= 1.6.0.1 && < 1.13
52-
, transformers >= 0.5.2.0 && < 0.6
52+
, transformers >= 0.5.2.0 && < 0.7
5353

5454
if !impl(ghc >= 8.2)
5555
build-depends:

servant-client/src/Servant/Client/Internal/HttpClient/Streaming.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ import Control.DeepSeq
2424
(NFData, force)
2525
import Control.Exception
2626
(evaluate, throwIO)
27-
import Control.Monad ()
27+
import Control.Monad
28+
(unless)
2829
import Control.Monad.Base
2930
(MonadBase (..))
3031
import Control.Monad.Codensity

servant-conduit/servant-conduit.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ library
3131
base >=4.9 && <5
3232
, bytestring >=0.10.8.1 && <0.12
3333
, conduit >=1.3.1 && <1.4
34-
, mtl >=2.2.2 && <2.3
34+
, mtl ^>=2.2.2 || ^>=2.3.1
3535
, resourcet >=1.2.2 && <1.3
3636
, servant >=0.15 && <0.20
3737
, unliftio-core >=0.1.2.0 && <0.3

servant-http-streams/servant-http-streams.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ library
4242
, bytestring >= 0.10.8.1 && < 0.12
4343
, containers >= 0.5.7.1 && < 0.7
4444
, deepseq >= 1.4.2.0 && < 1.5
45-
, mtl >= 2.2.2 && < 2.3
45+
, mtl ^>= 2.2.2 || ^>= 2.3.1
4646
, text >= 1.2.3.0 && < 2.1
4747
, time >= 1.6.0.1 && < 1.13
48-
, transformers >= 0.5.2.0 && < 0.6
48+
, transformers >= 0.5.2.0 && < 0.7
4949

5050
if !impl(ghc >= 8.2)
5151
build-depends:

servant-machines/servant-machines.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ library
3131
base >=4.9 && <5
3232
, bytestring >=0.10.8.1 && <0.12
3333
, machines >=0.6.4 && <0.8
34-
, mtl >=2.2.2 && <2.3
34+
, mtl ^>=2.2.2 || ^>=2.3.1
3535
, servant >=0.15 && <0.20
3636
hs-source-dirs: src
3737
default-language: Haskell2010

servant-pipes/servant-pipes.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ library
3232
, bytestring >=0.10.8.1 && <0.12
3333
, pipes >=4.3.9 && <4.4
3434
, pipes-safe >=2.3.1 && <2.4
35-
, mtl >=2.2.2 && <2.3
35+
, mtl ^>=2.2.2 || ^>=2.3.1
3636
, monad-control >=1.0.2.3 && <1.1
3737
, servant >=0.15 && <0.20
3838
hs-source-dirs: src

servant-server/servant-server.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ library
6565
, bytestring >= 0.10.8.1 && < 0.12
6666
, constraints >= 0.2 && < 0.14
6767
, containers >= 0.5.7.1 && < 0.7
68-
, mtl >= 2.2.2 && < 2.3
68+
, mtl ^>= 2.2.2 || ^>= 2.3.1
6969
, text >= 1.2.3.0 && < 2.1
70-
, transformers >= 0.5.2.0 && < 0.6
70+
, transformers >= 0.5.2.0 && < 0.7
7171
, filepath >= 1.4.1.1 && < 1.5
7272

7373
-- Servant dependencies

servant/servant.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ library
8787
base >= 4.9 && < 4.18
8888
, bytestring >= 0.10.8.1 && < 0.12
8989
, constraints >= 0.2
90-
, mtl >= 2.2.2 && < 2.3
90+
, mtl ^>= 2.2.2 || ^>= 2.3.1
9191
, sop-core >= 0.4.0.0 && < 0.6
92-
, transformers >= 0.5.2.0 && < 0.6
92+
, transformers >= 0.5.2.0 && < 0.7
9393
, text >= 1.2.3.0 && < 2.1
9494

9595

servant/src/Servant/Types/SourceT.hs

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{-# LANGUAGE CPP #-}
12
{-# LANGUAGE DeriveFunctor #-}
23
{-# LANGUAGE GADTs #-}
34
{-# LANGUAGE RankNTypes #-}
@@ -154,8 +155,10 @@ instance (Applicative m, Show1 m, Show a) => Show (StepT m a) where
154155
-- | >>> lift [1,2,3] :: StepT [] Int
155156
-- Effect [Yield 1 Stop,Yield 2 Stop,Yield 3 Stop]
156157
--
158+
#if !MIN_VERSION_transformers(0,6,0)
157159
instance MonadTrans StepT where
158160
lift = Effect . fmap (`Yield` Stop)
161+
#endif
159162

160163
instance MFunctor StepT where
161164
hoist f = go where

0 commit comments

Comments
 (0)