Skip to content

Refuse mistyped server fields on POST /api/plugins/servers* with 400 - #543

Merged
davidmckayv merged 2 commits into
CopilotKit:mainfrom
Ayush7614:feat/plugins-servers-strict-validation
Sep 15, 2026
Merged

davidmckayv merged 2 commits into
CopilotKit:mainfrom
Ayush7614:feat/plugins-servers-strict-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

POST /servers truthiness-checked key and passed instanceHost and credentialId straight to the store, where input.credentialId?.trim() throws a TypeError on a number or object and escapes the mapped-error catch as a 500. POST /servers/custom did the same for credentialId.

This change validates key as a trimmed non-empty string and optional instanceHost and credentialId as trimmed non-empty strings when present, before any store call or audit row.

Verified: bun test server/tests/plugin-servers-validation.test.ts — 15 pass, 0 fail. Biome lint and format clean. No new dependencies.

POST /servers truthiness-checked key and passed instanceHost and
credentialId straight to the store, where input.credentialId?.trim()
throws a TypeError on a number or object and escapes the mapped-error
catch as a 500. POST /servers/custom did the same for credentialId.

Validate key as a trimmed non-empty string and optional instanceHost
and credentialId as trimmed non-empty strings when present, before
any store call or audit row. Adds route-level regression tests proving
numbers, objects, arrays and whitespace-only values answer 400 and
never reach the store, plus a trimming happy path.

@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.

Code-verified clean; CI green on this sha.

@davidmckayv
davidmckayv merged commit 93c762d into CopilotKit:main Sep 15, 2026
15 checks passed
davidmckayv added a commit that referenced this pull request Sep 15, 2026
…564)

The Unreleased changelog was missing several changes that landed since v0.0.11: the Composio
connector (#481), the removal of a skill's grants when it is uninstalled (#563), and the
request-validation sweep that answers a malformed request with a 400 rather than coercing it or
letting it through (#543-#548, #550), including the one fail-open it closed. Added, each checked
against the code.

The README's Governed MCP bullet named only Google Drive and Notion; Composio brokers a few hundred
more apps in the catalogue now, so it says so.
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