diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 1e55f43..6f49314 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -31,6 +31,6 @@ jobs: args: '-- --test-threads 1' - name: Upload to codecov.io - uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 + uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 with: fail_ci_if_error: true \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0bb1810..96c7466 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: matrix: rust: - stable - - 1.57.0 # MSRV + - 1.59.0 # MSRV - nightly runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 61615db..1a0f8be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,14 @@ +### 0.6.1 + +__Date:__ September 20, 2022. + +__Changelog:__ +- Bump MSRV to `1.59.0` +- `clippy` fixes +- Add `rust-version` field to `Cargo.toml` +- Update copyright year to 2022 + + ### 0.6.0 __Date:__ June 20, 2022. diff --git a/Cargo.toml b/Cargo.toml index 5324a5d..cca4b17 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pasetors" -version = "0.6.0" # Update html_root_url in lib.rs along with this. +version = "0.6.1" # Update html_root_url in lib.rs along with this. authors = ["brycx "] edition = "2018" description = "PASETO: Platform-Agnostic Security Tokens (in Rust)" @@ -10,6 +10,7 @@ readme = "README.md" repository = "https://github.com/brycx/pasetors" documentation = "https://docs.rs/pasetors" license = "MIT" +rust-version = "1.59.0" # Update CI test along with this. [package.metadata.docs.rs] all-features = true diff --git a/LICENSE b/LICENSE index eab089e..5542621 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2021 brycx +Copyright (c) 2020-2022 brycx Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 57882c1..69c1626 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Tests](https://github.com/brycx/pasetors/workflows/Tests/badge.svg) [![Documentation](https://docs.rs/pasetors/badge.svg)](https://docs.rs/pasetors/) [![Crates.io](https://img.shields.io/crates/v/pasetors.svg)](https://crates.io/crates/pasetors) [![Safety Dance](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) [![MSRV](https://img.shields.io/badge/MSRV-1.57-informational.svg)](https://img.shields.io/badge/MSRV-1.57-informational) [![codecov](https://codecov.io/gh/brycx/pasetors/branch/master/graph/badge.svg)](https://codecov.io/gh/brycx/pasetors) +![Tests](https://github.com/brycx/pasetors/workflows/Tests/badge.svg) [![Documentation](https://docs.rs/pasetors/badge.svg)](https://docs.rs/pasetors/) [![Crates.io](https://img.shields.io/crates/v/pasetors.svg)](https://crates.io/crates/pasetors) [![Safety Dance](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/) [![MSRV](https://img.shields.io/badge/MSRV-1.59.0-informational.svg)](https://img.shields.io/badge/MSRV-1.59.0-informational) [![codecov](https://codecov.io/gh/brycx/pasetors/branch/master/graph/badge.svg)](https://codecov.io/gh/brycx/pasetors) ### PASETOrs @@ -26,7 +26,7 @@ This library includes: This library has **not undergone any third-party security audit**. Usage is at **own risk**. ### Minimum Supported Rust Version -Rust 1.57 or later is supported however, the majority of testing happens with latest stable Rust. +Rust 1.59.0 or later is supported however, the majority of testing happens with latest stable Rust. MSRV may be changed at any point and will not be considered a SemVer breaking change. diff --git a/src/claims.rs b/src/claims.rs index d5eb96a..35de5ba 100644 --- a/src/claims.rs +++ b/src/claims.rs @@ -6,7 +6,7 @@ use std::collections::HashMap; use time::format_description::well_known::Rfc3339; use time::{Duration, OffsetDateTime}; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// A collection of claims that are passed as payload for a PASETO token. pub struct Claims { list_of: HashMap, @@ -224,7 +224,7 @@ impl Claims { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// The validation rules that are used to validate a set of [`Claims`]. pub struct ClaimsValidationRules { validate_currently_valid: bool, diff --git a/src/errors.rs b/src/errors.rs index 139ed35..f970ff3 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,4 +1,4 @@ -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] /// Errors for token operations. pub enum Error { /// Error for a token with an invalid format. diff --git a/src/footer.rs b/src/footer.rs index 66be4f2..cff1998 100644 --- a/src/footer.rs +++ b/src/footer.rs @@ -7,7 +7,7 @@ use regex::Regex; use serde_json::Value; use std::collections::HashMap; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// A footer with optional claims that are JSON-encoded. pub struct Footer { list_of: HashMap, diff --git a/src/lib.rs b/src/lib.rs index eb66e96..966fa17 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -183,7 +183,7 @@ unused_qualifications, overflowing_literals )] -#![doc(html_root_url = "https://docs.rs/pasetors/0.6.0")] +#![doc(html_root_url = "https://docs.rs/pasetors/0.6.1")] #![cfg_attr(docsrs, feature(doc_cfg))] #[macro_use] diff --git a/src/token.rs b/src/token.rs index 2719c33..550e040 100644 --- a/src/token.rs +++ b/src/token.rs @@ -31,11 +31,11 @@ pub(crate) mod private { } } -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// A public token. pub struct Public; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// A local token. pub struct Local; @@ -87,7 +87,7 @@ impl Purpose for Local { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] /// A [`TrustedToken`] is returned by either a `verify()` or `decrypt()` operation and represents /// a validated token. /// @@ -188,7 +188,7 @@ impl TryFrom<&TrustedToken> for Footer { } } -#[derive(Clone, Debug, PartialEq)] +#[derive(Clone, Debug, PartialEq, Eq)] /// [`UntrustedToken`] can parse PASETO tokens in order to extract individual parts of it. /// /// A use-case for this would be parsing the tokens footer, if this is not known before receiving it. Then, diff --git a/src/version2.rs b/src/version2.rs index ad29067..bbb0206 100644 --- a/src/version2.rs +++ b/src/version2.rs @@ -19,7 +19,7 @@ use orion::hazardous::mac::blake2b; use orion::hazardous::mac::poly1305::POLY1305_OUTSIZE; use orion::hazardous::stream::xchacha20::XCHACHA_NONCESIZE; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// Version 2 of the PASETO spec. pub struct V2; diff --git a/src/version3.rs b/src/version3.rs index a306f6f..3f563fa 100644 --- a/src/version3.rs +++ b/src/version3.rs @@ -33,7 +33,7 @@ use p384::PublicKey; use rand_core::OsRng; use sha2::Digest; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// Version 3 of the PASETO spec. pub struct V3; diff --git a/src/version4.rs b/src/version4.rs index f6d31ab..e2d2a3e 100644 --- a/src/version4.rs +++ b/src/version4.rs @@ -21,7 +21,7 @@ use orion::hazardous::stream::xchacha20; use xchacha20::Nonce as EncNonce; use xchacha20::SecretKey as EncKey; -#[derive(Debug, PartialEq, Clone)] +#[derive(Debug, PartialEq, Eq, Clone)] /// Version 4 of the PASETO spec. pub struct V4;