diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-23 13:29:47 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-02-23 13:29:47 +0000 |
| commit | 65ac6ef83205c41653e6ffe2acd664f968926fb2 (patch) | |
| tree | c31301c599dfaffd75e61af3f6004d1b95373a72 /src/nostr/policy/mod.rs | |
| parent | c368f9132a16d45a17ad55943e4b68ba85a6835b (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.rs | 2 |
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 |
| 8 | mod announcement; | 8 | mod announcement; |
| 9 | mod deletion; | ||
| 9 | mod pr_event; | 10 | mod pr_event; |
| 10 | mod related; | 11 | mod related; |
| 11 | mod state; | 12 | mod state; |
| 12 | 13 | ||
| 13 | pub use announcement::{AnnouncementPolicy, AnnouncementResult}; | 14 | pub use announcement::{AnnouncementPolicy, AnnouncementResult}; |
| 15 | pub use deletion::DeletionPolicy; | ||
| 14 | pub use pr_event::PrEventPolicy; | 16 | pub use pr_event::PrEventPolicy; |
| 15 | pub use related::{ReferenceResult, RelatedEventPolicy}; | 17 | pub use related::{ReferenceResult, RelatedEventPolicy}; |
| 16 | pub use state::{StatePolicy, StateResult}; | 18 | pub use state::{StatePolicy, StateResult}; |