diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-28 01:44:58 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2025-11-28 01:44:58 +0000 |
| commit | f053827e0a157f348d9cf834f026a8de322abfe2 (patch) | |
| tree | 4dcde0f1e92dfe26fde131ef0f3f35e677e56b5b /grasp-audit/src/specs/grasp01/push_authorization.rs | |
| parent | 0c1d60a2ad69e79e83d36ed8a001743fde3d6666 (diff) | |
grasp-audit run all tests in audit mode
Diffstat (limited to 'grasp-audit/src/specs/grasp01/push_authorization.rs')
| -rw-r--r-- | grasp-audit/src/specs/grasp01/push_authorization.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs index fad77fb..4599ea5 100644 --- a/grasp-audit/src/specs/grasp01/push_authorization.rs +++ b/grasp-audit/src/specs/grasp01/push_authorization.rs | |||
| @@ -30,6 +30,22 @@ use std::path::Path; | |||
| 30 | pub struct PushAuthorizationTests; | 30 | pub struct PushAuthorizationTests; |
| 31 | 31 | ||
| 32 | impl PushAuthorizationTests { | 32 | impl PushAuthorizationTests { |
| 33 | /// Run all push authorization tests | ||
| 34 | pub async fn run_all( | ||
| 35 | client: &AuditClient, | ||
| 36 | git_data_dir: &Path, | ||
| 37 | relay_domain: &str, | ||
| 38 | ) -> crate::AuditResult { | ||
| 39 | let mut results = crate::AuditResult::new("GRASP-01 Push Authorization Tests"); | ||
| 40 | |||
| 41 | results.add(Self::test_push_authorized_by_owner_state(client, git_data_dir, relay_domain).await); | ||
| 42 | results.add(Self::test_push_rejected_without_state_event(client, git_data_dir, relay_domain).await); | ||
| 43 | results.add(Self::test_push_rejected_wrong_commit(client, git_data_dir, relay_domain).await); | ||
| 44 | results.add(Self::test_push_authorized_by_maintainer_state_only(client, git_data_dir, relay_domain).await); | ||
| 45 | |||
| 46 | results | ||
| 47 | } | ||
| 48 | |||
| 33 | /// Test that push is authorized when state event matches the commit | 49 | /// Test that push is authorized when state event matches the commit |
| 34 | /// | 50 | /// |
| 35 | /// GRASP-01: "MUST accept pushes via this service that match the latest | 51 | /// GRASP-01: "MUST accept pushes via this service that match the latest |