Skip to content

Commit

Permalink
UnverifiedBiscuit.external_public_keys() now returns PublicKeys
Browse files Browse the repository at this point in the history
Same as `Biscuit`
  • Loading branch information
divarvel committed Jan 27, 2025
1 parent 2f5700a commit a3a040c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions biscuit-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Support for P256 signatures (#108)
- `query_exactly_once()` (#260) (Baran Yildirim)
- include algorithm prefix in public/private key strings (#261)
- `UnverifiedBiscuit.external_public_keys()` now returns `PublicKey`s, not byte vecs (#263)

# `5.0.0`

Expand Down
9 changes: 2 additions & 7 deletions biscuit-auth/src/token/unverified.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,11 @@ impl UnverifiedBiscuit {
/// Blocks carrying an external public key are _third-party blocks_
/// and their contents can be trusted as coming from the holder of
/// the corresponding private key
pub fn external_public_keys(&self) -> Vec<Option<Vec<u8>>> {
pub fn external_public_keys(&self) -> Vec<Option<PublicKey>> {

Check warning on line 219 in biscuit-auth/src/token/unverified.rs

View check run for this annotation

Codecov / codecov/patch

biscuit-auth/src/token/unverified.rs#L219

Added line #L219 was not covered by tests
let mut res = vec![None];

for block in self.container.blocks.iter() {
res.push(
block
.external_signature
.as_ref()
.map(|sig| sig.public_key.to_bytes().to_vec()),
);
res.push(block.external_signature.as_ref().map(|sig| sig.public_key));

Check warning on line 223 in biscuit-auth/src/token/unverified.rs

View check run for this annotation

Codecov / codecov/patch

biscuit-auth/src/token/unverified.rs#L223

Added line #L223 was not covered by tests
}

res
Expand Down

0 comments on commit a3a040c

Please sign in to comment.