Skip to content

Require an explicit boolean on POST /api/components/:name/publication - #513

Merged
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Ayush7614:fix/component-publication-boolean-validation
Sep 13, 2026
Merged

Require an explicit boolean on POST /api/components/:name/publication#513
davidmckayv merged 3 commits into
CopilotKit:mainfrom
Ayush7614:fix/component-publication-boolean-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

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.

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep-reviewed clean (validation, no secret leak, fail-closed, agrees with existing layers). CI green.

@davidmckayv
davidmckayv merged commit 00b9c0d into CopilotKit:main Sep 13, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants