From b3ab8be9b608d35c8f32af70e3c1d323547a6d94 Mon Sep 17 00:00:00 2001 From: Saoirse Aronson Date: Fri, 12 Sep 2025 12:34:10 +0200 Subject: [PATCH 1/2] Scopes are deserialized twice --- biscuit-auth/src/format/convert.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/biscuit-auth/src/format/convert.rs b/biscuit-auth/src/format/convert.rs index 88c3ed30..ce4c7863 100644 --- a/biscuit-auth/src/format/convert.rs +++ b/biscuit-auth/src/format/convert.rs @@ -113,9 +113,6 @@ pub fn proto_block_to_token_block( detected_schema_version.check_compatibility(version)?; - let scopes: Result, _> = - input.scope.iter().map(proto_scope_to_token_scope).collect(); - Ok(Block { symbols, facts, From ba58ca18f941acc60e7346e5f155b7218bf0f5f3 Mon Sep 17 00:00:00 2001 From: Clement Delafargue Date: Tue, 16 Sep 2025 11:58:08 +0200 Subject: [PATCH 2/2] fix remaining extraneous scope deserialization and leftover try operator --- biscuit-auth/src/format/convert.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/biscuit-auth/src/format/convert.rs b/biscuit-auth/src/format/convert.rs index ce4c7863..c2e3fe52 100644 --- a/biscuit-auth/src/format/convert.rs +++ b/biscuit-auth/src/format/convert.rs @@ -122,7 +122,7 @@ pub fn proto_block_to_token_block( version, external_key, public_keys, - scopes: scopes?, + scopes, }) } @@ -189,9 +189,6 @@ pub fn proto_snapshot_block_to_token_block( detected_schema_version.check_compatibility(version)?; - let scopes: Result, _> = - input.scope.iter().map(proto_scope_to_token_scope).collect(); - let external_key = match &input.external_key { None => None, Some(key) => Some(PublicKey::from_proto(key)?), @@ -206,7 +203,7 @@ pub fn proto_snapshot_block_to_token_block( version, external_key, public_keys: PublicKeys::default(), - scopes: scopes?, + scopes, }) } pub fn authorizer_to_proto_authorizer(input: &AuthorizerPolicies) -> schema::AuthorizerPolicies {