git.iko.soy/typeable/servant
on master help sign in
Allow using aeson 1 (lax with min-bounds)
05ef0ddakhesacaro
servant-auth/servant-auth-client/servant-auth-client.cabal+2−2
@@ -64,7 +64,7 @@ test-suite spec
64 build-depends:
64 build-depends:
65 hspec >= 2.5.5 && < 2.9
65 hspec >= 2.5.5 && < 2.9
66 , QuickCheck >= 2.11.3 && < 2.15
66 , QuickCheck >= 2.11.3 && < 2.15
67− , aeson >= 2.0.1.0 && < 3
67+ , aeson >= 1.3.1.1 && < 3
68 , bytestring >= 0.10.6.0 && < 0.11
68 , bytestring >= 0.10.6.0 && < 0.11
69 , http-client >= 0.5.13.1 && < 0.8
69 , http-client >= 0.5.13.1 && < 0.8
70 , http-types >= 0.12.2 && < 0.13
70 , http-types >= 0.12.2 && < 0.13
@@ -74,7 +74,7 @@ test-suite spec
74 , transformers >= 0.4.2.0 && < 0.6
74 , transformers >= 0.4.2.0 && < 0.6
75 , wai >= 3.2.1.2 && < 3.3
75 , wai >= 3.2.1.2 && < 3.3
76 , warp >= 3.2.25 && < 3.4
76 , warp >= 3.2.25 && < 3.4
77− , jose >= 0.9 && < 0.10
77+ , jose >= 0.7.0.0 && < 0.10
78 other-modules:
78 other-modules:
79 Servant.Auth.ClientSpec
79 Servant.Auth.ClientSpec
80 default-language: Haskell2010
80 default-language: Haskell2010
servant-auth/servant-auth-server/servant-auth-server.cabal+2−2
@@ -32,7 +32,7 @@ library
32 ghc-options: -Wall
32 ghc-options: -Wall
33 build-depends:
33 build-depends:
34 base >= 4.10 && < 4.16
34 base >= 4.10 && < 4.16
35− , aeson >= 2.0.1.0 && < 3
35+ , aeson >= 1.0.0.1 && < 3
36 , base64-bytestring >= 1.0.0.1 && < 2
36 , base64-bytestring >= 1.0.0.1 && < 2
37 , blaze-builder >= 0.4.1.0 && < 0.5
37 , blaze-builder >= 0.4.1.0 && < 0.5
38 , bytestring >= 0.10.6.0 && < 0.11
38 , bytestring >= 0.10.6.0 && < 0.11
@@ -41,7 +41,7 @@ library
41 , data-default-class >= 0.1.2.0 && < 0.2
41 , data-default-class >= 0.1.2.0 && < 0.2
42 , entropy >= 0.4.1.3 && < 0.5
42 , entropy >= 0.4.1.3 && < 0.5
43 , http-types >= 0.12.2 && < 0.13
43 , http-types >= 0.12.2 && < 0.13
44− , jose >= 0.9 && < 0.10
44+ , jose >= 0.7.0.0 && < 0.10
45 , lens >= 4.16.1 && < 5.1
45 , lens >= 4.16.1 && < 5.1
46 , memory >= 0.14.16 && < 0.17
46 , memory >= 0.14.16 && < 0.17
47 , monad-time >= 0.3.1.0 && < 0.4
47 , monad-time >= 0.3.1.0 && < 0.4
servant-auth/servant-auth/servant-auth.cabal+3−2
@@ -35,11 +35,12 @@ library
35 build-depends:
35 build-depends:
36 base >= 4.10 && < 4.16
36 base >= 4.10 && < 4.16
37 , containers >= 0.6 && < 0.7
37 , containers >= 0.6 && < 0.7
38− , aeson >= 2.0.1.0 && < 3
38+ , aeson >= 1.3.1.1 && < 3
39− , jose >= 0.9 && < 0.10
39+ , jose >= 0.7.0.0 && < 0.10
40 , lens >= 4.16.1 && < 5.1
40 , lens >= 4.16.1 && < 5.1
41 , servant >= 0.15 && < 0.19
41 , servant >= 0.15 && < 0.19
42 , text >= 1.2.3.0 && < 1.3
42 , text >= 1.2.3.0 && < 1.3
43+ , unordered-containers >= 0.2.9.0 && < 0.3
43 exposed-modules:
44 exposed-modules:
44 Servant.Auth
45 Servant.Auth
45 Servant.Auth.JWT
46 Servant.Auth.JWT
servant-auth/servant-auth/src/Servant/Auth/JWT.hs+9−2
@@ -1,10 +1,17 @@
1+{-# LANGUAGE CPP #-}
2+
1module Servant.Auth.JWT where
3module Servant.Auth.JWT where
2
4
3import Control.Lens ((^.))
5import Control.Lens ((^.))
4import qualified Crypto.JWT as Jose
6import qualified Crypto.JWT as Jose
5import Data.Aeson (FromJSON, Result (..), ToJSON, fromJSON,
7import Data.Aeson (FromJSON, Result (..), ToJSON, fromJSON,
6 toJSON)
8 toJSON)
9+#if MIN_VERSION_aeson(2,0,0)
7−import qualified Data.Map as Map
10+import qualified Data.Map as KM
11+#else
12+import qualified Data.HashMap.Strict as KM
13+#endif
14+
8import qualified Data.Text as T
15import qualified Data.Text as T
9
16
10
17
@@ -17,7 +24,7 @@ import qualified Data.Text as T
17class FromJWT a where
24class FromJWT a where
18 decodeJWT :: Jose.ClaimsSet -> Either T.Text a
25 decodeJWT :: Jose.ClaimsSet -> Either T.Text a
19 default decodeJWT :: FromJSON a => Jose.ClaimsSet -> Either T.Text a
26 default decodeJWT :: FromJSON a => Jose.ClaimsSet -> Either T.Text a
20− decodeJWT m = case Map.lookup "dat" (m ^. Jose.unregisteredClaims) of
27+ decodeJWT m = case KM.lookup "dat" (m ^. Jose.unregisteredClaims) of
21 Nothing -> Left "Missing 'dat' claim"
28 Nothing -> Left "Missing 'dat' claim"
22 Just v -> case fromJSON v of
29 Just v -> case fromJSON v of
23 Error e -> Left $ T.pack e
30 Error e -> Left $ T.pack e
servant-client-core/servant-client-core.cabal+1−1
@@ -70,7 +70,7 @@ library
70 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
70 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
71 -- Here can be exceptions if we really need features from the newer versions.
71 -- Here can be exceptions if we really need features from the newer versions.
72 build-depends:
72 build-depends:
73− aeson >= 2.0.1.0 && < 3
73+ aeson >= 1.4.1.0 && < 3
74 , base-compat >= 0.10.5 && < 0.12
74 , base-compat >= 0.10.5 && < 0.12
75 , base64-bytestring >= 1.0.0.1 && < 1.3
75 , base64-bytestring >= 1.0.0.1 && < 1.3
76 , exceptions >= 0.10.0 && < 0.11
76 , exceptions >= 0.10.0 && < 0.11
servant-docs/servant-docs.cabal+1−1
@@ -52,7 +52,7 @@ library
52 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
52 -- Other dependencies: Lower bound around what is in the latest Stackage LTS.
53 -- Here can be exceptions if we really need features from the newer versions.
53 -- Here can be exceptions if we really need features from the newer versions.
54 build-depends:
54 build-depends:
55− aeson >= 2.0.1.0 && < 3
55+ aeson >= 1.4.1.0 && < 3
56 , aeson-pretty >= 0.8.5 && < 0.9
56 , aeson-pretty >= 0.8.5 && < 0.9
57 , base-compat >= 0.10.5 && < 0.12
57 , base-compat >= 0.10.5 && < 0.12
58 , case-insensitive >= 1.2.0.11 && < 1.3
58 , case-insensitive >= 1.2.0.11 && < 1.3
servant-server/servant-server.cabal+2−2
@@ -114,7 +114,7 @@ executable greet
114 , text
114 , text
115
115
116 build-depends:
116 build-depends:
117− aeson >= 2.0.1.0 && < 3
117+ aeson >= 1.4.1.0 && < 3
118 , warp >= 3.2.25 && < 3.4
118 , warp >= 3.2.25 && < 3.4
119
119
120test-suite spec
120test-suite spec
@@ -157,7 +157,7 @@ test-suite spec
157
157
158 -- Additional dependencies
158 -- Additional dependencies
159 build-depends:
159 build-depends:
160− aeson >= 2.0.1.0 && < 3
160+ aeson >= 1.4.1.0 && < 3
161 , directory >= 1.3.0.0 && < 1.4
161 , directory >= 1.3.0.0 && < 1.4
162 , hspec >= 2.6.0 && < 2.9
162 , hspec >= 2.6.0 && < 2.9
163 , hspec-wai >= 0.10.1 && < 0.12
163 , hspec-wai >= 0.10.1 && < 0.12
servant-swagger/servant-swagger.cabal+2−2
@@ -68,7 +68,7 @@ library
68 Servant.Swagger.Internal.TypeLevel.Every
68 Servant.Swagger.Internal.TypeLevel.Every
69 Servant.Swagger.Internal.TypeLevel.TMap
69 Servant.Swagger.Internal.TypeLevel.TMap
70 hs-source-dirs: src
70 hs-source-dirs: src
71− build-depends: aeson >=2.0.1.0 && <3
71+ build-depends: aeson >=1.4.2.0 && <3
72 , aeson-pretty >=0.8.7 && <0.9
72 , aeson-pretty >=0.8.7 && <0.9
73 , base >=4.9.1.0 && <5
73 , base >=4.9.1.0 && <5
74 , base-compat >=0.10.5 && <0.12
74 , base-compat >=0.10.5 && <0.12
@@ -108,7 +108,7 @@ test-suite spec
108 build-tool-depends: hspec-discover:hspec-discover >=2.6.0 && <2.8
108 build-tool-depends: hspec-discover:hspec-discover >=2.6.0 && <2.8
109 build-depends: base
109 build-depends: base
110 , base-compat
110 , base-compat
111− , aeson >=2.0.1.0 && <3
111+ , aeson >=1.4.2.0 && <3
112 , hspec >=2.6.0 && <2.8
112 , hspec >=2.6.0 && <2.8
113 , QuickCheck
113 , QuickCheck
114 , lens
114 , lens
servant/servant.cabal+1−1
@@ -98,7 +98,7 @@ library
98 -- Here can be exceptions if we really need features from the newer versions.
98 -- Here can be exceptions if we really need features from the newer versions.
99 build-depends:
99 build-depends:
100 base-compat >= 0.10.5 && < 0.12
100 base-compat >= 0.10.5 && < 0.12
101− , aeson >= 2.0.1.0 && < 3
101+ , aeson >= 1.4.1.0 && < 3
102 , attoparsec >= 0.13.2.2 && < 0.15
102 , attoparsec >= 0.13.2.2 && < 0.15
103 , bifunctors >= 5.5.3 && < 5.6
103 , bifunctors >= 5.5.3 && < 5.6
104 , case-insensitive >= 1.2.0.11 && < 1.3
104 , case-insensitive >= 1.2.0.11 && < 1.3