diff options
Diffstat (limited to 'src/nostr/policy/state.rs')
| -rw-r--r-- | src/nostr/policy/state.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/nostr/policy/state.rs b/src/nostr/policy/state.rs index f94f004..4bfb513 100644 --- a/src/nostr/policy/state.rs +++ b/src/nostr/policy/state.rs | |||
| @@ -10,7 +10,7 @@ use nostr_relay_builder::prelude::Event; | |||
| 10 | 10 | ||
| 11 | use super::PolicyContext; | 11 | use super::PolicyContext; |
| 12 | use crate::git; | 12 | use crate::git; |
| 13 | use crate::git::authorization::fetch_repository_data; | 13 | use crate::git::authorization::fetch_repository_data_with_purgatory; |
| 14 | use crate::nostr::events::{validate_state, RepositoryAnnouncement, RepositoryState}; | 14 | use crate::nostr::events::{validate_state, RepositoryAnnouncement, RepositoryState}; |
| 15 | 15 | ||
| 16 | /// Result of state policy evaluation | 16 | /// Result of state policy evaluation |
| @@ -76,7 +76,13 @@ impl StatePolicy { | |||
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | // Get all repositories and state events from db with identifier | 78 | // Get all repositories and state events from db with identifier |
| 79 | let db_repo_data = fetch_repository_data(&self.ctx.database, &state.identifier).await?; | 79 | // Include purgatory announcements for authorization |
| 80 | let db_repo_data = fetch_repository_data_with_purgatory( | ||
| 81 | &self.ctx.database, | ||
| 82 | &self.ctx.purgatory, | ||
| 83 | &state.identifier, | ||
| 84 | ) | ||
| 85 | .await?; | ||
| 80 | 86 | ||
| 81 | // CRITICAL: Check if author is authorized via maintainer set | 87 | // CRITICAL: Check if author is authorized via maintainer set |
| 82 | // State events MUST be rejected if author is not in maintainer set of any accepted announcement | 88 | // State events MUST be rejected if author is not in maintainer set of any accepted announcement |