upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit/src/specs/grasp01/push_authorization.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-12 12:57:44 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-12 12:57:44 +0000
commitdcaaa0c44c46f963929ab0baa91f63759ec702dc (patch)
tree1808621ff43eb01acaabe091033672d347bfbf67 /grasp-audit/src/specs/grasp01/push_authorization.rs
parent3fd6ce4149d567c67009b0332ca76c0cd6f51055 (diff)
refactor(grasp-audit): split ValidRepo into Sent/Served, add tolerant purgatory
- Rename ValidRepo to ValidRepoSent (announcement sent, may be in purgatory) - Add ValidRepoServed (announcement queryable after git data pushed) - Add send_event_and_note_purgatory() for tolerant purgatory detection - Update fixtures to use tolerant method instead of strict assertion - Update event_acceptance_policy tests to use ValidRepoServed This enables tests to pass regardless of purgatory implementation status while still having explicit purgatory tests that verify the behavior.
Diffstat (limited to 'grasp-audit/src/specs/grasp01/push_authorization.rs')
-rw-r--r--grasp-audit/src/specs/grasp01/push_authorization.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/grasp-audit/src/specs/grasp01/push_authorization.rs b/grasp-audit/src/specs/grasp01/push_authorization.rs
index be354a0..78ef471 100644
--- a/grasp-audit/src/specs/grasp01/push_authorization.rs
+++ b/grasp-audit/src/specs/grasp01/push_authorization.rs
@@ -208,7 +208,7 @@ async fn setup_pr_test_repo(
208) -> Result<(PathBuf, String, String, String), String> { 208) -> Result<(PathBuf, String, String, String), String> {
209 // Get fixtures 209 // Get fixtures
210 let repo_event = ctx 210 let repo_event = ctx
211 .get_fixture(FixtureKind::ValidRepo) 211 .get_fixture(FixtureKind::ValidRepoSent)
212 .await 212 .await
213 .map_err(|e| format!("Failed to get repo announcement: {}", e))?; 213 .map_err(|e| format!("Failed to get repo announcement: {}", e))?;
214 214
@@ -407,7 +407,7 @@ impl PushAuthorizationTests {
407 let ctx = TestContext::new(client); 407 let ctx = TestContext::new(client);
408 408
409 // Create repository (no state event) 409 // Create repository (no state event)
410 let repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 410 let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
411 Ok(r) => r, 411 Ok(r) => r,
412 Err(e) => { 412 Err(e) => {
413 return TestResult::new( 413 return TestResult::new(
@@ -956,7 +956,7 @@ impl PushAuthorizationTests {
956 // ============================================================ 956 // ============================================================
957 let ctx = TestContext::new(client); 957 let ctx = TestContext::new(client);
958 958
959 let repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 959 let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
960 Ok(r) => r, 960 Ok(r) => r,
961 Err(e) => { 961 Err(e) => {
962 return TestResult::new( 962 return TestResult::new(
@@ -1110,7 +1110,7 @@ impl PushAuthorizationTests {
1110 let pr_event_id = pr_event.id.to_hex(); 1110 let pr_event_id = pr_event.id.to_hex();
1111 1111
1112 // Get repo info for cloning (fresh clone for verification) 1112 // Get repo info for cloning (fresh clone for verification)
1113 let repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 1113 let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
1114 Ok(r) => r, 1114 Ok(r) => r,
1115 Err(e) => { 1115 Err(e) => {
1116 return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc) 1116 return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc)
@@ -1198,7 +1198,7 @@ impl PushAuthorizationTests {
1198 let pr_event_id = pr_event.id.to_hex(); 1198 let pr_event_id = pr_event.id.to_hex();
1199 1199
1200 // Get repo info for cloning (fresh clone for this test) 1200 // Get repo info for cloning (fresh clone for this test)
1201 let repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 1201 let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
1202 Ok(r) => r, 1202 Ok(r) => r,
1203 Err(e) => { 1203 Err(e) => {
1204 return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc) 1204 return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc)
@@ -1289,7 +1289,7 @@ impl PushAuthorizationTests {
1289 let pr_event_id = pr_event.id.to_hex(); 1289 let pr_event_id = pr_event.id.to_hex();
1290 1290
1291 // Get repo info for cloning (fresh clone for this test) 1291 // Get repo info for cloning (fresh clone for this test)
1292 let repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 1292 let repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
1293 Ok(r) => r, 1293 Ok(r) => r,
1294 Err(e) => { 1294 Err(e) => {
1295 return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc) 1295 return TestResult::new(test_name, SpecRef::GitAcceptRefsNostrEventId, desc)
@@ -1425,7 +1425,7 @@ impl PushAuthorizationTests {
1425 // ============================================================ 1425 // ============================================================
1426 // Step 2: Extract repo_id and owner npub from ValidRepo (cached by fixture) 1426 // Step 2: Extract repo_id and owner npub from ValidRepo (cached by fixture)
1427 // ============================================================ 1427 // ============================================================
1428 let valid_repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 1428 let valid_repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
1429 Ok(e) => e, 1429 Ok(e) => e,
1430 Err(e) => { 1430 Err(e) => {
1431 return TestResult::new(test_name, SpecRef::GitSetHeadOnReceive, desc) 1431 return TestResult::new(test_name, SpecRef::GitSetHeadOnReceive, desc)
@@ -1528,7 +1528,7 @@ impl PushAuthorizationTests {
1528 // ============================================================ 1528 // ============================================================
1529 // Step 2: Extract repo_id and owner npub from ValidRepo (cached by fixture) 1529 // Step 2: Extract repo_id and owner npub from ValidRepo (cached by fixture)
1530 // ============================================================ 1530 // ============================================================
1531 let valid_repo = match ctx.get_fixture(FixtureKind::ValidRepo).await { 1531 let valid_repo = match ctx.get_fixture(FixtureKind::ValidRepoSent).await {
1532 Ok(e) => e, 1532 Ok(e) => e,
1533 Err(e) => { 1533 Err(e) => {
1534 return TestResult::new(test_name, SpecRef::GitSetHeadOnReceive, desc) 1534 return TestResult::new(test_name, SpecRef::GitSetHeadOnReceive, desc)