packages feed

oidc-client 0.4.0.0 → 0.4.0.1

raw patch · 4 files changed

+18/−5 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -4,8 +4,12 @@  Nothing yet. -## [0.4.0.0]+## [0.4.0.1]+### Fixed+- Allow for multiple algorithms in the JWK Set. See [#28](https://github.com/krdlab/haskell-oidc-client/pull/28).+- Support GHC < 8.4. See [#30](https://github.com/krdlab/haskell-oidc-client/issues/30). +## [0.4.0.0] ### Added - Added a validation of 'nonce' parameter. See [#24](https://github.com/krdlab/haskell-oidc-client/pull/24). - Made optional claims available. See [#24](https://github.com/krdlab/haskell-oidc-client/pull/24).@@ -19,12 +23,14 @@ ## [0.3.0.1] ### Changed - 'expires_in' can now parsed both String and Decimal number. See [#15](https://github.com/krdlab/haskell-oidc-client/pull/15).+ ### Fixed - Improved error messages. See [#15](https://github.com/krdlab/haskell-oidc-client/pull/15).  ## [0.3.0.0] ### Changed - Changed `Configuration` fileds. See [#11](https://github.com/krdlab/haskell-oidc-client/pull/11).+ ### Fixed - Fixed Hackage tarball. See [#13](https://github.com/krdlab/haskell-oidc-client/pull/13). 
oidc-client.cabal view
@@ -1,5 +1,5 @@ name:               oidc-client-version:            0.4.0.0+version:            0.4.0.1 synopsis:           OpenID Connect 1.0 library for RP homepage:           https://github.com/krdlab/haskell-oidc-client stability:          experimental
src/Web/OIDC/Client/CodeFlow.hs view
@@ -23,8 +23,9 @@ import           Data.Aeson                         (FromJSON, eitherDecode) import qualified Data.ByteString.Char8              as B import qualified Data.ByteString.Lazy.Char8         as BL+import           Data.Either                        (partitionEithers) import           Data.List                          (nub)-import           Data.Maybe                         (isNothing, listToMaybe)+import           Data.Maybe                         (isNothing) import           Data.Monoid                        ((<>)) import           Data.Text                          (Text, pack, unpack) import           Data.Text.Encoding                 (decodeUtf8)@@ -169,11 +170,16 @@     let jwks = P.jwkSet . oidcProvider $ oidc         token = Jwt.unJwt jwt'         alg = fmap (Jwt.JwsEncoding . P.getJwsAlg)-                . listToMaybe                 . P.idTokenSigningAlgValuesSupported                 . P.configuration                 $ oidcProvider oidc-    decoded <- Jwt.decode jwks alg token+    decoded <-+        (\x -> case partitionEithers x of+            (_    , k : _) -> Right k+            (e : _, _    ) -> Left e+            ([]   , []   ) -> Left $ Jwt.KeyError "No Keys available for decoding" +        )+        <$> traverse (\alg' -> Jwt.decode jwks (Just alg') token) alg     case decoded of         Right (Unsecured payload)      -> throwM $ UnsecuredJwt payload         Right (Jws (_header, payload)) -> parsePayload payload
src/Web/OIDC/Client/Discovery/Provider.hs view
@@ -17,6 +17,7 @@ import           Data.Aeson.TH         (Options (..), defaultOptions,                                         deriveFromJSON) import           Data.Aeson.Types      (camelTo2)+import           Data.Monoid           ((<>)) import           Data.Text             (Text, unpack) import           Jose.Jwa              (JwsAlg (..)) import           Jose.Jwk              (Jwk)