From 2e0d6c89bb9ad33abcfbc825788c76ce7943adcc Mon Sep 17 00:00:00 2001 From: Janus Troelsen Date: Wed, 2 Nov 2022 17:49:16 -0500 Subject: [PATCH] Adapt tests to jose-0.10 --- .../servant-auth-server/test/Servant/Auth/ServerSpec.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs b/servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs index 1810e64d..1b13993b 100644 --- a/servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs +++ b/servant-auth/servant-auth-server/test/Servant/Auth/ServerSpec.hs @@ -6,13 +6,12 @@ module Servant.Auth.ServerSpec (spec) where #endif import Control.Lens -import Control.Monad.Except (runExceptT) import Control.Monad.IO.Class (liftIO) import Crypto.JOSE (Alg (HS256, None), Error, JWK, JWSHeader, KeyMaterialGenParam (OctGenParam), ToCompact, encodeCompact, - genJWK, newJWSHeader) + genJWK, newJWSHeader, runJOSE) import Crypto.JWT (Audience (..), ClaimsSet, NumericDate (NumericDate), SignedJWT, @@ -540,7 +539,7 @@ addJwtToHeader jwt = case jwt of $ defaults & header "Authorization" .~ ["Bearer " <> BSL.toStrict v] createJWT :: JWK -> JWSHeader () -> ClaimsSet -> IO (Either Error Crypto.JWT.SignedJWT) -createJWT k a b = runExceptT $ signClaims k a b +createJWT k a b = runJOSE $ signClaims k a b addJwtToCookie :: ToCompact a => CookieSettings -> Either Error a -> IO Options addJwtToCookie ccfg jwt = case jwt >>= (return . encodeCompact) of