Require an explicit boolean on POST /api/components/:name/publication - #513
Merged
davidmckayv merged 3 commits intoSep 13, 2026
Conversation
Ayush7614
requested review from
MikeRyanDev,
davidmckayv,
guidovizoso,
mxmzb and
tylerslaton
as code owners
September 13, 2026 05:11
davidmckayv
approved these changes
Sep 13, 2026
davidmckayv
left a comment
Contributor
There was a problem hiding this comment.
Deep-reviewed clean (validation, no secret leak, fail-closed, agrees with existing layers). CI green.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The route read
body?.published !== false, so an empty body, invalid JSON, {}, "no", 0 and null all evaluated to true and published the component with a 200 and a component.published audit row. Only an explicit false unpublished — a toggle that fails open on the endpoint deciding what every Bot may draw.A non-boolean now answers 400
published must be true or false.(the same wording as PUT /routines/:id/enabled and the channel pin/busy toggles). Only explicit true/false reaches the store or the audit row.Tests: new server/tests/component-publication.test.ts (13 cases: explicit true/false paths, 10 malformed bodies + missing body all 400 with no store call). Verified: decision + catalogue + publication suites — 24 pass.