From 623cae575f8c9ce33f2d7fdc2526db495f846acb Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 5 Jan 2026 13:05:17 +0000 Subject: purgatory: add state git data sync --- src/git/authorization.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/git/authorization.rs') diff --git a/src/git/authorization.rs b/src/git/authorization.rs index 6b997d8..e7ea99b 100644 --- a/src/git/authorization.rs +++ b/src/git/authorization.rs @@ -287,6 +287,20 @@ pub async fn fetch_repository_data( }) } +pub fn pubkey_authorised_for_repo_owners( + pubkey: &PublicKey, + db_repo_data: &RepositoryData, +) -> Vec { + let mut repo_owners_authorising_pubkey = HashSet::new(); + let collections = collect_authorized_maintainers(&db_repo_data.announcements); + for (owner, authoised) in collections { + if authoised.contains(&pubkey.to_hex()) { + repo_owners_authorising_pubkey.insert(owner.to_string()); + } + } + repo_owners_authorising_pubkey.iter().cloned().collect() +} + /// Collect authorized maintainers grouped by owner from a set of announcements /// /// For each announcement, returns a map from owner pubkey to authorized maintainers: -- cgit v1.2.3