upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/nostr/policy/mod.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-02-23 13:29:47 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-02-23 13:29:47 +0000
commit65ac6ef83205c41653e6ffe2acd664f968926fb2 (patch)
treec31301c599dfaffd75e61af3f6004d1b95373a72 /src/nostr/policy/mod.rs
parentc368f9132a16d45a17ad55943e4b68ba85a6835b (diff)
feat: remove purgatory announcements on NIP-09 deletion events
Kind 5 deletion events signed by the announcement author now evict the corresponding purgatory entry and delete the bare repository from disk. Both NIP-09 reference styles are supported: - e tag (event ID): matches the purgatory entry whose event ID equals the tag value - a tag (coordinate 30617:<pubkey>:<identifier>): matches by coordinate, only removes entries with created_at <= deletion event created_at per NIP-09 spec Author-only enforcement: coordinate pubkey and e-tag owner must match the deletion event pubkey; third-party deletion attempts are silently ignored. Includes 6 unit tests and 2 integration tests (event ID and coordinate paths).
Diffstat (limited to 'src/nostr/policy/mod.rs')
-rw-r--r--src/nostr/policy/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nostr/policy/mod.rs b/src/nostr/policy/mod.rs
index 1566b6c..f5b981a 100644
--- a/src/nostr/policy/mod.rs
+++ b/src/nostr/policy/mod.rs
@@ -6,11 +6,13 @@
6/// - `PrEventPolicy` - PR/PR Update validation 6/// - `PrEventPolicy` - PR/PR Update validation
7/// - `RelatedEventPolicy` - Forward/backward reference checking 7/// - `RelatedEventPolicy` - Forward/backward reference checking
8mod announcement; 8mod announcement;
9mod deletion;
9mod pr_event; 10mod pr_event;
10mod related; 11mod related;
11mod state; 12mod state;
12 13
13pub use announcement::{AnnouncementPolicy, AnnouncementResult}; 14pub use announcement::{AnnouncementPolicy, AnnouncementResult};
15pub use deletion::DeletionPolicy;
14pub use pr_event::PrEventPolicy; 16pub use pr_event::PrEventPolicy;
15pub use related::{ReferenceResult, RelatedEventPolicy}; 17pub use related::{ReferenceResult, RelatedEventPolicy};
16pub use state::{StatePolicy, StateResult}; 18pub use state::{StatePolicy, StateResult};