Skip to content

Commit 6483588

Browse files
test(media): cover removed members and document audit recovery
Signed-off-by: Nikolaj Goodger <[email protected]>
1 parent 66fcf2d commit 6483588

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

‎crates/buzz-test-client/tests/e2e_media_extended.rs‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,39 @@ async fn test_private_channel_attachment_unreadable_to_non_members() {
899899
);
900900
}
901901

902+
// Exercise the actual membership tombstone, not just never-joined readers.
903+
let recipient = BuzzTestClient::connect(&relay_ws_url(), &outsider)
904+
.await
905+
.unwrap();
906+
let mut membership = BuzzTestClient::connect(&relay_ws_url(), &owner)
907+
.await
908+
.unwrap();
909+
for (kind, expected) in [(9000, 200), (9001, 404)] {
910+
let change = EventBuilder::new(Kind::from(kind), "")
911+
.tags([
912+
Tag::parse(["h", &channel_id]).unwrap(),
913+
Tag::parse(["p", &outsider.public_key().to_hex()]).unwrap(),
914+
])
915+
.sign_with_keys(&owner)
916+
.unwrap();
917+
let result = membership.send_event(change).await.unwrap();
918+
assert!(
919+
result.accepted,
920+
"membership change rejected: {}",
921+
result.message
922+
);
923+
for method in [Method::GET, Method::HEAD] {
924+
assert_eq!(
925+
read_status(&http, &outsider, method.clone(), url).await,
926+
expected,
927+
"removed private-channel members must lose media access"
928+
);
929+
assert_eq!(read_status(&http, &owner, method, url).await, 200);
930+
}
931+
}
932+
membership.disconnect().await.unwrap();
933+
recipient.disconnect().await.unwrap();
934+
902935
let outsider_channel = create_channel(&http, &outsider, "outsider-media", "open").await;
903936
let mut outsider_client = BuzzTestClient::connect(&relay_ws_url(), &outsider)
904937
.await

‎docs/operator-media-access.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ Changing read modes does not revoke grants, and preventing reevaluation later do
4040
Any unwanted existing grants need a provenance-based repair before enforcement.
4141
Every invocation restarts the scan from the beginning; rows are deduplicated, but earlier authorization decisions are not preserved.
4242

43-
Previously unshared uploads without uploader proof still need an upload of the exact bytes before they can be shared.
44-
Historical uploader backfill and unparsed-reference recovery remain separate work.
43+
Before recording shares, the backfill restores uploader proof from retained server
44+
`media_uploaded` audit rows with an attributed 32-byte pubkey and a valid SHA-256 object ID.
45+
It scans each community's audit sequence in bounded batches and skips quiescing/deleting communities.
46+
Missing, malformed, or unattributed audit evidence grants no ownership; those files still
47+
need an upload of the exact bytes. Unparsed references need separate repair before enforcement.
4548
To roll back file denials, set `off` or `log-only` and restart every pod.
4649

4750
## Open reports

0 commit comments

Comments
 (0)