diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f36f92d..15962d9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -20,6 +20,17 @@ jobs: test: name: Test Suite runs-on: ubuntu-latest + strategy: + matrix: + feature: + - v1_local + - v1_public + - v2_local + - v2_public + - v3_local + - v3_public + - v4_local + - v4_public steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 @@ -30,38 +41,22 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test - args: --features v1_local - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v1_public - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v2_local - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v2_public - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v3_local - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v3_public - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v4_local - - uses: actions-rs/cargo@v1 - with: - command: test - args: --features v4_public + args: --no-default-features --features ${{ matrix.feature }} + clippy: name: Clippy runs-on: ubuntu-latest + strategy: + matrix: + feature: + - v1_local + - v1_public + - v2_local + - v2_public + - v3_local + - v3_public + - v4_local + - v4_public steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 @@ -73,7 +68,8 @@ jobs: - uses: actions-rs/cargo@v1 with: command: clippy - args: -- -D warnings + args: --no-default-features --features ${{ matrix.feature }} -- -D warnings + audit: name: Security Audit runs-on: ubuntu-latest @@ -88,3 +84,4 @@ jobs: - uses: actions-rs/audit-check@v1.2.0 with: token: ${{ secrets.GITHUB_TOKEN }} + - run: cargo audit diff --git a/src/core/paseto.rs b/src/core/paseto.rs index 8945d9a..c53b541 100644 --- a/src/core/paseto.rs +++ b/src/core/paseto.rs @@ -125,8 +125,8 @@ impl<'a, Version: VersionTrait, Purpose: PurposeTrait> Paseto<'a, Version, Purpo /// # //now let's try to decrypt it /// # let json = Paseto::::try_decrypt(&token, &key, Footer::from("Supah doopah!"), None)?; /// # assert_eq!(payload, json); - /// # Ok::<(),anyhow::Error>(()) /// } + /// # Ok::<(),anyhow::Error>(()) /// ``` pub fn set_footer(&mut self, footer: Footer<'a>) -> &mut Self { self.footer = Some(footer); diff --git a/src/core/paseto_impl/v2_local.rs b/src/core/paseto_impl/v2_local.rs index c311f24..52b8167 100644 --- a/src/core/paseto_impl/v2_local.rs +++ b/src/core/paseto_impl/v2_local.rs @@ -78,7 +78,7 @@ impl<'a> Paseto<'a, V2, Local> { //create the blake2 context to generate the nonce let mut blake2 = Blake2bMac::new_from_slice(nonce.as_ref())?; - blake2.update(&*self.payload); + blake2.update(&self.payload); let mut context = [0u8; 24]; blake2.finalize_into((&mut context).into()); diff --git a/tests/version4_test_vectors.rs b/tests/version4_test_vectors.rs index 4fefd41..ae24d06 100644 --- a/tests/version4_test_vectors.rs +++ b/tests/version4_test_vectors.rs @@ -1,6 +1,6 @@ #[cfg(all(test, feature = "v4"))] mod v4_test_vectors { - use anyhow::{Error, Result}; + use anyhow::{Result}; use serde_json::json; use rusty_paseto::core::*; @@ -360,7 +360,7 @@ mod v4_test_vectors { } Err(thiserror) => { eprintln!("here's the error: {}", thiserror); - Err(Error::from(thiserror)) + Err(anyhow::Error::from(thiserror)) } } }