From 551d4936afca7c4c91e250ca150f7c6e005427a2 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Sat, 30 Oct 2021 20:43:35 +0200 Subject: [PATCH 1/4] Fix tests for some servant-auth pkgs on GHC 9 Turns out the tests broke because of base64-bytestring issue specific to GHC-9 that was fixed in 1.2.1.0. Fixes #1474 --- .../servant-auth-server/servant-auth-server.cabal | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/servant-auth/servant-auth-server/servant-auth-server.cabal b/servant-auth/servant-auth-server/servant-auth-server.cabal index 99499dbb..fb917e54 100644 --- a/servant-auth/servant-auth-server/servant-auth-server.cabal +++ b/servant-auth/servant-auth-server/servant-auth-server.cabal @@ -33,7 +33,7 @@ library build-depends: base >= 4.10 && < 4.16 , aeson >= 1.3.1.1 && < 1.6 - , base64-bytestring >= 1.0.0.1 && < 1.2 + , base64-bytestring >= 1.0.0.1 && < 1.3 , blaze-builder >= 0.4.1.0 && < 0.5 , bytestring >= 0.10.6.0 && < 0.11 , case-insensitive >= 1.2.0.11 && < 1.3 @@ -55,6 +55,13 @@ library , unordered-containers >= 0.2.9.0 && < 0.3 , wai >= 3.2.1.2 && < 3.3 + if impl(ghc >= 9) + build-depends: + -- base64-bytestring 1.2.1.0 contains important fix for GHC-9, lower versions + -- produce wrong results, thus corrupring JWT via jose package. + -- See: https://github.com/haskell/base64-bytestring/pull/46 + base64-bytestring >= 1.2.1.0 + exposed-modules: Servant.Auth.Server Servant.Auth.Server.Internal @@ -87,8 +94,6 @@ test-suite readme default-language: Haskell2010 if impl(ghcjs) buildable: False - if impl(ghc >= 9) - buildable: False test-suite spec type: exitcode-stdio-1.0 @@ -114,8 +119,6 @@ test-suite spec , servant , servant-server , transformers - if impl(ghc >= 9) - buildable: False -- test dependencies build-depends: From 53b1d9d2b67d227c0573df882b4a49d0c9e06221 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Sat, 30 Oct 2021 21:01:01 +0200 Subject: [PATCH 2/4] Enable tests for servant-auth-client Fixes #1474 --- servant-auth/servant-auth-client/servant-auth-client.cabal | 2 -- 1 file changed, 2 deletions(-) diff --git a/servant-auth/servant-auth-client/servant-auth-client.cabal b/servant-auth/servant-auth-client/servant-auth-client.cabal index 6c8484db..edcd030a 100644 --- a/servant-auth/servant-auth-client/servant-auth-client.cabal +++ b/servant-auth/servant-auth-client/servant-auth-client.cabal @@ -59,8 +59,6 @@ test-suite spec , servant-auth , servant , servant-auth-client - if impl(ghc >= 9) - buildable: False -- test dependencies build-depends: From e2e9ce05965ee4e009170a0cb7e186b3ed034e86 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Sat, 30 Oct 2021 21:26:44 +0200 Subject: [PATCH 3/4] Enable servant-auth cookbook --- cabal.project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal.project b/cabal.project index e25a87bb..04b29bd5 100644 --- a/cabal.project +++ b/cabal.project @@ -36,7 +36,7 @@ packages: doc/cookbook/generic doc/cookbook/hoist-server-with-context doc/cookbook/https - -- doc/cookbook/jwt-and-basic-auth/ + doc/cookbook/jwt-and-basic-auth doc/cookbook/pagination -- doc/cookbook/sentry -- Commented out because servant-quickcheck currently doesn't build. From ca6774d797496f84f5f8c5eda66239a1efc13388 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Sat, 30 Oct 2021 21:29:17 +0200 Subject: [PATCH 4/4] Update servant-auth cookbook deps --- doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal b/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal index 55632e90..50ddcb91 100644 --- a/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal +++ b/doc/cookbook/jwt-and-basic-auth/jwt-and-basic-auth.cabal @@ -22,7 +22,7 @@ executable cookbook-jwt-and-basic-auth , servant , servant-client , servant-server - , servant-auth ==0.3.* + , servant-auth == 0.4.* , servant-auth-server >= 0.3.1.0 , warp >= 3.2 , wai >= 3.2