From 1866d2bf0ef97c3cb7404ba14466b90104177aa0 Mon Sep 17 00:00:00 2001 From: Trezy Date: Fri, 28 Aug 2026 15:17:20 -0500 Subject: [PATCH] =?UTF-8?q?test:=20i=20dunno=20what=20youre=20talking=20ab?= =?UTF-8?q?out=20i=20would=20never=20leave=20prints=20in=20production=20co?= =?UTF-8?q?de=20=F0=9F=99=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Trezy --- crates/tranquil-pds/src/delegation/scopes.rs | 30 +++++++------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/crates/tranquil-pds/src/delegation/scopes.rs b/crates/tranquil-pds/src/delegation/scopes.rs index a72e061..f68914a 100644 --- a/crates/tranquil-pds/src/delegation/scopes.rs +++ b/crates/tranquil-pds/src/delegation/scopes.rs @@ -441,28 +441,20 @@ mod tests { GrantCoverage::Withheld ); } -} -#[cfg(test)] -mod scratch_transition_probe { - use super::*; #[test] - fn probe() { - let g = "atproto repo:* blob:*/* rpc:* identity:* account:*?action=manage transition:generic transition:chat transition:email"; - println!( - "validate mixed grant: {:?}", - ValidatedDelegationScope::new(g).is_ok() + fn test_grant_may_mix_transition_and_granular_scopes() { + assert!(ValidatedDelegationScope::new(OWNER_FULL_SCOPES).is_ok()); + assert_eq!( + intersect_scopes("atproto transition:generic", OWNER_FULL_SCOPES), + "atproto transition:generic" ); - for s in ["transition:generic", "transition:chat", "transition:email"] { - println!(" {s} -> {:?}", grant_coverage(g, s)); - println!( - " {s} under CURRENT owner -> {:?}", - grant_coverage(OWNER_FULL_SCOPES, s) - ); - } - println!( - "intersect(transition:generic, mixed grant) = {:?}", - intersect_scopes("atproto transition:generic", g) + assert_eq!( + intersect_scopes( + "atproto repo:app.bsky.feed.post?action=create", + OWNER_FULL_SCOPES + ), + "atproto repo:app.bsky.feed.post?action=create" ); } }