upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/git
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-05 13:05:17 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-05 13:05:17 +0000
commit623cae575f8c9ce33f2d7fdc2526db495f846acb (patch)
tree41b346a136a6c3d56fcd7b8e522fab96a3da7b67 /src/git
parent11b1655638b5a328662187a27f85a84df60fc759 (diff)
purgatory: add state git data sync
Diffstat (limited to 'src/git')
-rw-r--r--src/git/authorization.rs14
1 files changed, 14 insertions, 0 deletions
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(
287 }) 287 })
288} 288}
289 289
290pub fn pubkey_authorised_for_repo_owners(
291 pubkey: &PublicKey,
292 db_repo_data: &RepositoryData,
293) -> Vec<String> {
294 let mut repo_owners_authorising_pubkey = HashSet::new();
295 let collections = collect_authorized_maintainers(&db_repo_data.announcements);
296 for (owner, authoised) in collections {
297 if authoised.contains(&pubkey.to_hex()) {
298 repo_owners_authorising_pubkey.insert(owner.to_string());
299 }
300 }
301 repo_owners_authorising_pubkey.iter().cloned().collect()
302}
303
290/// Collect authorized maintainers grouped by owner from a set of announcements 304/// Collect authorized maintainers grouped by owner from a set of announcements
291/// 305///
292/// For each announcement, returns a map from owner pubkey to authorized maintainers: 306/// For each announcement, returns a map from owner pubkey to authorized maintainers: