Skip to content

Commit 85c0931

Browse files
authored
Scopes are deserialized twice (#310)
Scopes are deserialized twice
1 parent 3ad5966 commit 85c0931

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

biscuit-auth/src/format/convert.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,6 @@ pub fn proto_block_to_token_block(
113113

114114
detected_schema_version.check_compatibility(version)?;
115115

116-
let scopes: Result<Vec<Scope>, _> =
117-
input.scope.iter().map(proto_scope_to_token_scope).collect();
118-
119116
Ok(Block {
120117
symbols,
121118
facts,
@@ -125,7 +122,7 @@ pub fn proto_block_to_token_block(
125122
version,
126123
external_key,
127124
public_keys,
128-
scopes: scopes?,
125+
scopes,
129126
})
130127
}
131128

@@ -192,9 +189,6 @@ pub fn proto_snapshot_block_to_token_block(
192189

193190
detected_schema_version.check_compatibility(version)?;
194191

195-
let scopes: Result<Vec<Scope>, _> =
196-
input.scope.iter().map(proto_scope_to_token_scope).collect();
197-
198192
let external_key = match &input.external_key {
199193
None => None,
200194
Some(key) => Some(PublicKey::from_proto(key)?),
@@ -209,7 +203,7 @@ pub fn proto_snapshot_block_to_token_block(
209203
version,
210204
external_key,
211205
public_keys: PublicKeys::default(),
212-
scopes: scopes?,
206+
scopes,
213207
})
214208
}
215209
pub fn authorizer_to_proto_authorizer(input: &AuthorizerPolicies) -> schema::AuthorizerPolicies {

0 commit comments

Comments
 (0)