Skip to content

Commit

Permalink
Pricipals are now based on project, not platform
Browse files Browse the repository at this point in the history
  • Loading branch information
milliams committed Aug 20, 2024
1 parent c3f23b7 commit 28bb9f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -278,6 +279,7 @@ async fn sign(
.collect::<Vec<String>>(),
)
})
.filter(|(_, platforms)| !platforms.is_empty())
.collect();

// Mutate the platform config to have the alias as its name
Expand All @@ -290,8 +292,8 @@ async fn sign(
let short_name = claims.short_name;

let principals: Vec<String> = 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!(
Expand Down

0 comments on commit 28bb9f0

Please sign in to comment.