[team] Review fixes: a deployment ticket and a MAC on target.request, an unknown author is unsatisfiable under others, a signed request cannot be refused afterwards; TEAM.md limits; v0.18.1

This commit is contained in:
2026-11-17 12:44:54 +01:00
parent f95c768bfa
commit 98d56f4673
10 changed files with 167 additions and 26 deletions
+8
View File
@@ -244,8 +244,13 @@ pub fn evaluate(policy: &Policy, roster: &[RosterMember], env: &str, author: &st
ignored.push(a.clone());
}
}
// `others` needs to know who the author is (core 0.18.1): an empty author, or one no member is, would let the
// author approve their own release under a name the rule cannot see.
let unknown_author = rule.others && roster.len() >= 2 && !roster.iter().any(|m| m.is(author));
let verdict = if rule.approvals == 0 {
Verdict::Allowed(KeyRole::Test)
} else if unknown_author {
Verdict::Unsatisfiable("the release's author is not a member the team knows, so the rule cannot exclude them")
} else if counted.len() >= rule.approvals as usize {
Verdict::Allowed(KeyRole::Release)
} else if eligible.len() < rule.approvals as usize {
@@ -278,5 +283,8 @@ pub fn may_approve(
if rule.others && roster.len() >= 2 && me.is(author) {
return Err(TeamError::NotEligible("the release's author may not approve it here"));
}
if rule.approvals > 0 && rule.others && roster.len() >= 2 && !roster.iter().any(|m| m.is(author)) {
return Err(TeamError::NotEligible("the release's author is not a member the team knows"));
}
Ok(())
}