Skip to content

Commit

Permalink
Merge branch 'v4_public'
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrodzilla committed May 29, 2024
2 parents 8ad91a5 + 7e235c4 commit 448738a
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
57 changes: 27 additions & 30 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -88,3 +84,4 @@ jobs:
- uses: actions-rs/audit-check@v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- run: cargo audit
2 changes: 1 addition & 1 deletion src/core/paseto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ impl<'a, Version: VersionTrait, Purpose: PurposeTrait> Paseto<'a, Version, Purpo
/// # //now let's try to decrypt it
/// # let json = Paseto::<V4, Local>::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);
Expand Down
2 changes: 1 addition & 1 deletion src/core/paseto_impl/v2_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
4 changes: 2 additions & 2 deletions tests/version4_test_vectors.rs
Original file line number Diff line number Diff line change
@@ -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::*;
Expand Down Expand Up @@ -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))
}
}
}
Expand Down

0 comments on commit 448738a

Please sign in to comment.