diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-27 15:23:59 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-27 15:23:59 +0000 |
| commit | 09025b8435f673779ce109e2fb72ce48a13bf28e (patch) | |
| tree | 65f1a988db805b3c58c08cb0cf782f3430aa4df4 /grasp-audit/src | |
| parent | 233feae6af4b291e4860a1ddf9df2ccf82e57c2f (diff) | |
fix(auth): accept state announcements from maintainers
Updated get_maintainers_recursive() to properly handle maintainers listed
in accepted repository announcements:
1. Separated 'visited' set (cycle prevention) from 'maintainers' set (result)
2. Maintainers listed in an announcement's 'maintainers' tag are now added
to the maintainer set immediately, even without their own announcement
3. Recursively traverse maintainer chains to handle multi-level delegation
Also fixed RecursiveMaintainerRepoAndState fixture to publish the
maintainer's announcement (which lists the recursive maintainer) before
publishing the recursive maintainer's announcement, establishing the
proper trust chain: Owner -> Maintainer -> RecursiveMaintainer
Test results: 7/7 push authorization tests passing
Diffstat (limited to 'grasp-audit/src')
| -rw-r--r-- | grasp-audit/src/fixtures.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/grasp-audit/src/fixtures.rs b/grasp-audit/src/fixtures.rs index 3e21eae..45a413d 100644 --- a/grasp-audit/src/fixtures.rs +++ b/grasp-audit/src/fixtures.rs | |||
| @@ -533,6 +533,12 @@ impl<'a> TestContext<'a> { | |||
| 533 | .ok_or_else(|| anyhow::anyhow!("Missing d tag in owner repo announcement"))? | 533 | .ok_or_else(|| anyhow::anyhow!("Missing d tag in owner repo announcement"))? |
| 534 | .to_string(); | 534 | .to_string(); |
| 535 | 535 | ||
| 536 | // Build and send the maintainer's repo announcement first | ||
| 537 | // This establishes the chain: Owner -> Maintainer -> RecursiveMaintainer | ||
| 538 | // The maintainer's announcement lists the recursive maintainer in its maintainers tag | ||
| 539 | let maintainer_announcement = self.build_maintainer_announcement(&repo_id).await?; | ||
| 540 | self.client.send_event(maintainer_announcement).await?; | ||
| 541 | |||
| 536 | // Build and send the recursive maintainer's repo announcement | 542 | // Build and send the recursive maintainer's repo announcement |
| 537 | let recursive_maintainer_announcement = self.build_recursive_maintainer_announcement(&repo_id).await?; | 543 | let recursive_maintainer_announcement = self.build_recursive_maintainer_announcement(&repo_id).await?; |
| 538 | self.client.send_event(recursive_maintainer_announcement).await?; | 544 | self.client.send_event(recursive_maintainer_announcement).await?; |