From 28bb9f09b705ea791e168bf472aa5005e84fdd29 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Tue, 20 Aug 2024 17:46:14 +0100 Subject: [PATCH] Pricipals are now based on project, not platform --- CHANGELOG.md | 2 ++ src/main.rs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a1f5d3..318b178 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Fixed +- Pricipals are based on project, not platform. ## [0.1.3] - 2024-08-20 ### Added diff --git a/src/main.rs b/src/main.rs index bdd00c0..69c6602 100644 --- a/src/main.rs +++ b/src/main.rs @@ -260,6 +260,7 @@ async fn sign( // Filter the list of platforms in each project so that only those // that are referenced in the relevant platforms list are kept. // It also alters the platform name into its alias. + // Finally remove any projects which now have an empty list of platforms. let projects: Projects = claims .projects .iter() @@ -278,6 +279,7 @@ async fn sign( .collect::>(), ) }) + .filter(|(_, platforms)| !platforms.is_empty()) .collect(); // Mutate the platform config to have the alias as its name @@ -290,8 +292,8 @@ async fn sign( let short_name = claims.short_name; let principals: Vec = projects - .values() - .flat_map(|ps| ps.iter().map(|p| format!("{short_name}.{}", p))) + .keys() + .map(|p| format!("{short_name}.{}", p)) .collect(); if principals.is_empty() { error!(