From 579ad6f50d30f2024081ab6305ca85c7110efaf1 Mon Sep 17 00:00:00 2001 From: Bendik Aagaard Lynghaug Date: Wed, 30 Sep 2026 14:09:49 +0200 Subject: [PATCH] The lint lets an invite form ask for a phone number instead of an address Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01GT37Z1Xtfd9pUuQtMTg6Yt --- CHANGELOG.md | 4 ++++ src/content/validate.rs | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d2338b..34d4199 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ One line per change, grouped by the release that shipped it. Newest first. A release is a Cargo.toml bump plus a `v` tag; the content repos pin the tag they run (see the end of this file). +## 0.5.10 (2026-09-30) + +- The lint lets an invite form collect a required `phone` in place of a required `email`: memberships know a person by number first. + ## 0.5.9 (2026-09-30) - With memberships as the people backend and a Kanidm token still set, an invite makes the Kanidm account as well (no group, the one-time link in the mail): Kanidm makes people, portal makes members, and a site can switch to memberships before its sign-in provider is one everyone already has. diff --git a/src/content/validate.rs b/src/content/validate.rs index 3775e5f..83f0732 100644 --- a/src/content/validate.rs +++ b/src/content/validate.rs @@ -278,9 +278,12 @@ pub fn validate_questions( .flat_map(|f| &f.requirements) .any(|r| r.name == name && !r.optional) }; - if !has("name") || !has("email") { + // A person is known by a phone number or an address; + // either will do, since memberships key on the number + // first and Kanidm on the address. + if !has("name") || !(has("email") || has("phone")) { anyhow::bail!( - "question {:?} alternative {:?}: an invite must collect required `name` and `email` fields", + "question {:?} alternative {:?}: an invite must collect a required `name` and a required `email` or `phone` field", question.id, alternative.name ); }