Commit Graph

35 Commits

Author SHA1 Message Date
Vincent Prouillet 255c740e47 Add required_spec_claims (#225) 2022-02-02 22:10:11 +01:00
Andrew Walbran 7301e928b0 Implement Clone, Eq and PartialEq for Error. (#218)
* Implement Eq and PartialEq for Error.

* Implement Clone for Error.

serde_json::Error doesn't implement Clone, so wrapped it in an Arc.
2022-02-02 22:10:11 +01:00
Matteo Bertucci 94fef12259 Docs: fix copy paste error in ErrorKind::InvalidSubject (#196)
The documentation for `ErrorKind::InvalidSubject` mentioned the `aud` claim instead of `sub`. This commit fixes it.
2022-02-02 22:10:11 +01:00
Vincent Prouillet b6dafd63dd Make Validation::algorithms an error if empty 2022-02-02 22:10:11 +01:00
Vincent Prouillet d2c8ae3f11 Impl PartialEq for ErrorKind
Closes #125
2022-02-02 22:10:11 +01:00
Vincent Prouillet 30571cafd2 Keep RSA key error message from ring
Closes #164
2022-02-02 22:10:11 +01:00
Piotr Maks 90b9700748
Clippy (#146)
* Bump minimum required Rust version to 1.40

Motivation for this change is use of `#[non_exhaustive]` attribute that
was stabilized in Rust 1.40.0

* Migrate benchmarks to criterion

Remove use of unstable features in favour of criterion benchmarks

* Enable clippy in Github Actions

* Fix clippy::manual_non_exhaustive

Remove manual implementations of the non-exhaustive pattern. Instead
use the `#[non_exhaustive]` attribute.

* Allow reexport of deprecated function

Silence rustc `deprecated` working in function reexport

* Remove redundant clone

* Fix various clippy warnings

* Remove redundant pattern
* Use `unreachable!()` to fail test
* No need to add `&` to all patterns
2020-08-31 12:04:57 +02:00
Vincent Prouillet 6262b4700b Slight tweaks 2020-06-30 19:58:11 +02:00
Hexilee a750d5586f fix issue 120: DecodingKey can be converted to static 2020-02-28 01:26:58 +08:00
FujiApple 2f359b515c - Fix recursive `Display::fmt` implementation on `Error` to avoid stack overflow
- Added unit test to cover a sample case
2020-01-31 13:11:40 +08:00
Vincent Prouillet c2f6093309 Get rid of deprecrated std error description 2020-01-27 20:52:46 -08:00
Vincent Prouillet 689cc6d32e Validate key type with algo in encode/decode 2020-01-13 19:41:06 +01:00
Vincent Prouillet 51dacd9bc4 Update docs 2019-11-14 19:43:43 +01:00
Vincent Prouillet e3632b3a2c Remove Key approach in favour of &[u8] with pem 2019-11-06 22:32:13 +00:00
Vincent Prouillet 73d96357c3 Simplify header decoding 2019-11-03 16:13:22 +00:00
Vincent Prouillet 20013a4e4f Fixed conflicts 2019-06-16 18:00:00 +02:00
Kan-Ru Chen c26bdf7e06 Support for RSASSA-PSS signing algorithm
As specified in https://tools.ietf.org/html/rfc7518#section-3.5

- PS256 - RSASSA-PSS using SHA-256 hash algorithm
- PS384 - RSASSA-PSS using SHA-384 hash algorithm
- PS512 - RSASSA-PSS using SHA-512 hash algorithm
2019-06-08 03:08:54 +09:00
Jake Shadle 6cfb5c7c0e Add Key trait and the supported formats 2019-05-15 16:19:38 +02:00
Vincent Prouillet b4e0ae5f6d
Merge branch 'next' into master 2019-03-22 09:24:02 +01:00
Vincent Prouillet be27206088 Remove iat validation, it isnt supposed to be done 2019-02-04 18:44:08 +01:00
Jasper Bryant-Greene 9883fab729 implemented ECDSA signing, updated ring to 0.14 alpha 2019-01-09 09:46:06 +08:00
Vincent Prouillet 8f0809318d rustfmt 2018-10-28 19:58:35 +01:00
himanoa 4bd4c8b3de feat: Implement FromStr trait for Algorithm 2018-08-31 03:53:55 +09:00
Vincent Prouillet 109978ab6b Remove error-chain
Fix #52, #56, #57
2018-07-25 14:46:30 +02:00
Vincent Prouillet 8c492f1413 Update base64 crate 2017-04-23 14:16:38 +09:00
Vincent Prouillet fc9f83b837 No need to pass an algorithm to decode 2017-04-22 15:21:44 +09:00
Vincent Prouillet 35fd9d63cc Add some docs 2017-04-13 10:08:07 +09:00
Vincent Prouillet 410499e6b6 Add validation 2017-04-12 17:51:05 +09:00
Vincent Prouillet f7d0a7a002 Work on RSA 2017-04-11 12:40:55 +09:00
Vincent Prouillet e3a4294e85 Move to serde + base64
Remove Part trait
Move tests to tests directory
Reorganise code
2017-04-11 12:40:40 +09:00
Jonathan Fok kan 438d264fa9 Implemented std::error::Error for jwt::errors::Error 2016-02-28 12:30:39 -05:00
Vincent Prouillet b3663e90c6 Uncomment alg comparison 2015-11-02 21:22:21 +00:00
Vincent Prouillet d29f670989 Add mini docs 2015-11-01 22:59:42 +00:00
Vincent Prouillet 3452ba26d1 Add basic working code 2015-11-01 22:31:46 +00:00
Vincent Prouillet 7585a7f0f9 Initial commit 2015-10-31 15:37:15 +00:00