diff options
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 |