Releases: aidantwoods/go-paseto
v1.2.0
What's Changed
- Update ci.yml by @ilyabrin in #9
- Validate ed25519 private keys during import by @aidantwoods in #8
- Add sentinel error types by @aidantwoods in #12
New Contributors
Full Changelog: v1.1.3...v1.2.0
Sentinel Errors
Introduces two specialisations on errors that may be returned: TokenError
and RuleError
. Note that some error
s will still be returned by the library that are in neither of these specialisations, and so you should still fallback to general error handling (not assume one of these will always be returned).
A TokenError
will be returned if the token is outright invalid in some way, whether that be due to formatting, a cryptographic issue, or some other issue which renders the token invalid.
A RuleError
will be returned if a token fails one of the specified rules, but is otherwise valid (including cryptographically).
Distinguishing between these two error types is not mandatory: it is perfectly safe to just handle a general error without inspecting it. Being able to inspect an error may be useful for some use cases, for example if a different handling action is desired depending on whether the token was invalid or whether a rule failure occurred. Note that if you do look for one of these errors, you should additionally include code to handle general errors as a fallback: you should expect new errors that do not fall into either of these two categories to be returned in the future.
v1.1.3
What's Changed
- Added new
NotBeforeNbf
rule, which can be used the check the current time is after or equal to the token'snbf
claim. - Clarified that
NotExpired
checks according to the time when the rule is run, not when the rule is created
Full Changelog: v1.1.2...v1.1.3
v1.1.2
What's Changed
- Testing against update PASETO test vectors #5
- Error messages are now slightly more helpful
Full Changelog: v1.1.1...v1.1.2
v1.1.1
v1.1.0
v1.0.1
Version 1.0.1
- Documentation updates
- No longer export the
Message
type: this was added for consistency with the swift-paseto library, but I opted to simplify the API here considerably by not exporting the low level Paseto crypto operations. TheMessage
type only really makes sense when using those low level operations.
Stable Release
Version 1 stable release!
Support for common claims validators, full support for v2 and v4, and partial support for v3. Full support for v3 expected to be added in a later feature release.