secrets: validate CENTRALIS_TEAM at render time, like CENTRALIS_TOKENS #144
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Jinemi/thermograph#144
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/centralis-team-validation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CENTRALIS_TOKENShas a parse-and-prove check in both renderers because it is JSON, full of double quotes, living in a file bash expands, and because Centralis fails closed on it.CENTRALIS_TEAMis the same kind of value with none of the same guard.It is the allowlist for Google sign-in. Centralis'
buildOAuth()requires a Google client and at least one team member, so an empty or malformed team does not fail loudly — it turns OAuth off and leaves the server bearer-token-only, which looks exactly like never having configured it.The sharper failure is a partial one.
parseTeam()(centralissrc/config.ts:381-423) skips an unparseable entry with aconsole.errorand carries on, so an address with a typo'd domain drops exactly one person, behind a log line on a container start nobody watches. EntriesparseTeamwould skip are therefore refused here, where a human is reading the output.Accepts all three shapes
parseTeamaccepts —email->role,email->object, and an array of objects — and matches its case-insensitive duplicate detection. Rejects invalid JSON, a non-object/array, an entry without an@, a duplicate address, and an empty team.Added to both renderers with identical logic (verified by diffing the blocks with comments stripped). The parity argument this migration rests on is that the two backends produce the same file; a validation present on only one side means one backend can write a file the other would have refused.
Verification
Unit-tested the validator against 10 inputs — all three valid shapes, role-omitted, unset, invalid JSON, non-email, duplicate address, empty object, scalar — all behave as intended.
End to end against the live vault with
verify-centralis-render.sh prod:That is also the first time the Centralis renderer has been run against a live vault since it was merged.
2194aaa1c4to7b3ea69ef9View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.