paseto 0.1.0.0 → 0.1.1.0
raw patch · 5 files changed
+32/−32 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- paseto.cabal +18/−15
- src/Crypto/Paseto/Keys/V3/Internal.hs +1/−1
- src/Crypto/Paseto/Token/Validation.hs +1/−2
- test/Test/Crypto/Paseto/Token/Validation.hs +8/−14
CHANGELOG.md view
@@ -1,5 +1,9 @@ # ChangeLog for paseto +## 0.1.1.0 -- 2024-10-27++- Add support for GHC 8.10.1.+ ## 0.1.0.0 -- 2024-09-22 - Initial release.
paseto.cabal view
@@ -1,12 +1,12 @@ cabal-version: 3.4 name: paseto-version: 0.1.0.0+version: 0.1.1.0 synopsis: Platform-Agnostic Security Tokens description: Haskell implementation of PASETO (Platform-Agnostic Security Tokens).- .+ The recommended entry point for this library is "Crypto.Paseto".- .+ For more information about this library and a rundown on how to use it, check out the [README on GitHub](https://github.com/intricate/paseto-haskell#readme).@@ -18,6 +18,7 @@ homepage: https://github.com/intricate/paseto-haskell bug-reports: https://github.com/intricate/paseto-haskell/issues build-type: Simple+tested-with: GHC == 9.4.8, GHC == 8.10.1 extra-source-files: README.md extra-doc-files: CHANGELOG.md @@ -37,6 +38,7 @@ -Wpartial-fields -Wredundant-constraints -Wunused-packages+ -Wno-unticked-promoted-constructors exposed-modules: Crypto.Paseto Crypto.Paseto.Keys@@ -58,20 +60,20 @@ Data.Binary.Put.Integer build-depends: base >= 4.14 && < 5- , aeson >= 2.2.3 && < 2.3- , base16-bytestring >= 1.0.2 && < 1.1+ , aeson >= 2.0.1.0 && < 2.3+ , base16-bytestring >= 1.0.1 && < 1.1 , base64-bytestring >= 1.2.1 && < 1.3- , basement >= 0.0.16 && < 0.1- , binary >= 0.8.9 && < 0.9- , bytestring >= 0.11.5 && < 0.12- , containers >= 0.6.7 && < 0.7- , crypton >= 1.0.0 && < 1.1- , deepseq >= 1.4.8 && < 1.5- , memory >= 0.18.0 && < 0.19+ , basement >= 0.0.11 && < 0.1+ , binary >= 0.8.7 && < 0.9+ , bytestring >= 0.11 && < 0.12+ , containers >= 0.6.0.1 && < 0.7+ , crypton >= 0.34 && < 1.1+ , deepseq >= 1.4.4 && < 1.5+ , memory >= 0.15.0 && < 0.19 , mtl >= 2.2.2 && < 2.3- , parsec >= 3.1.16 && < 3.2- , text >= 2.0.2 && < 2.1- , time >= 1.12.2 && < 1.13+ , parsec >= 3.1.14 && < 3.2+ , text >= 1.2.3.2 && < 2.2+ , time >= 1.11 && < 1.13 , transformers-except >= 0.1.4 && < 0.2 test-suite paseto-test@@ -93,6 +95,7 @@ -Wincomplete-uni-patterns -Wunused-imports -Wunused-packages+ -Wno-unticked-promoted-constructors other-modules: Test.Crypto.Paseto.Keys.Gen Test.Crypto.Paseto.Keys.V3.Gen
src/Crypto/Paseto/Keys/V3/Internal.hs view
@@ -237,7 +237,7 @@ <> T.pack (show actual) <> "." CompressedPointDecodingModularSquareRootError ->- "Failed to recover the x-coordinate from the compressed point."+ "Failed to recover the y-coordinate from the compressed point." CompressedPointDecodingInvalidPointError _ -> "Decoded point is invalid for the curve."
src/Crypto/Paseto/Token/Validation.hs view
@@ -53,7 +53,6 @@ import qualified Data.Aeson as Aeson import qualified Data.ByteString as BS import Data.Either ( lefts )-import qualified Data.List as L import Data.List.NonEmpty ( NonEmpty ) import qualified Data.List.NonEmpty as NE import Data.Text ( Text )@@ -226,7 +225,7 @@ -- At the moment, the only default rule is checking 'validAt' for the current -- system time ('getCurrentTime'). getDefaultValidationRules :: IO [ValidationRule]-getDefaultValidationRules = L.singleton . validAt <$> getCurrentTime+getDefaultValidationRules = pure . validAt <$> getCurrentTime -- | Validate a list of rules against a collection of claims. --
test/Test/Crypto/Paseto/Token/Validation.hs view
@@ -20,7 +20,6 @@ import Data.Either ( isLeft ) import Data.Fixed ( Fixed (..), Pico, resolution ) import Data.List.NonEmpty ( NonEmpty )-import qualified Data.List.NonEmpty as NE import Data.Time.Clock ( NominalDiffTime, addUTCTime, nominalDiffTimeToSeconds ) import Hedgehog ( MonadTest@@ -131,7 +130,7 @@ diff <- genNominalDiffTime (Range.constant 1 100000) pure (addUTCTime diff expClaimTime) assertErrors- (NE.singleton $ ValidationExpirationError exp)+ (pure $ ValidationExpirationError exp) (validate [notExpired badTime] claims) prop_validAt :: Property@@ -141,7 +140,7 @@ iatTimeDiff <- forAll $ genNominalDiffTime (Range.constant 1 100000) let iatTime = addUTCTime iatTimeDiff timeBeforeIssue - nbfTimeDiff <- forAll $ genNominalDiffTime (Range.constant 0 100000)+ nbfTimeDiff <- forAll $ genNominalDiffTime (Range.constant 1 100000) let nbfTime = addUTCTime nbfTimeDiff iatTime expTimeDiff <- forAll $ genNominalDiffTime (Range.constant 1 100000)@@ -170,20 +169,15 @@ diff <- genNominalDiffTime (Range.constant 0 ((nominalDiffTimeToSecondsI iatTimeDiff) - 1)) pure (addUTCTime diff timeBeforeIssue) assertErrors- (NE.singleton $ ValidationIssuedAtError iat)+ (pure $ ValidationIssuedAtError iat) (validate [validAt badTimeBeforeIat] claims) -- Expected failure case (time is before `nbf`)- badTimeBeforeNbf <- forAll $- case nbfTimeDiff of- 0 -> do- diff <- genNominalDiffTime (Range.constant 0 ((nominalDiffTimeToSecondsI iatTimeDiff) - 1))- pure (addUTCTime diff timeBeforeIssue)- _ -> do- diff <- genNominalDiffTime (Range.constant 0 ((nominalDiffTimeToSecondsI nbfTimeDiff) - 1))- pure (addUTCTime diff iatTime)+ badTimeBeforeNbf <- forAll $ do+ diff <- genNominalDiffTime (Range.constant 0 ((nominalDiffTimeToSecondsI nbfTimeDiff) - 1))+ pure (addUTCTime diff iatTime) assertErrors- (NE.singleton $ ValidationNotBeforeError nbf)+ (pure $ ValidationNotBeforeError nbf) (validate [validAt badTimeBeforeNbf] claims) -- Expected failure case (expired claims)@@ -191,7 +185,7 @@ diff <- genNominalDiffTime (Range.constant 1 100000) pure (addUTCTime diff expTime) assertErrors- (NE.singleton $ ValidationExpirationError exp)+ (pure $ ValidationExpirationError exp) (validate [validAt badTimeAfterExp] claims) ------------------------------------------------------------------------------