fix(proxy): allow POST /v1/knowledge/query + convert to GET (DAK-6919)#235
Merged
Merged
Conversation
QA E2E sends POST /v1/knowledge/query with a JSON body; the engine only registers GET (lib.rs:455). Previously the proxy returned 403 because POST was not on the allowlist. Two-part fix: 1. allowlist.js: add POST /v1/knowledge/query as a convenience alias. 2. server.js: convert POST body (KgQueryParams JSON) → GET query string before forwarding to the engine. Same pattern as the hybrid rewrite (DAK-6906). Agent_id has already been session-namespaced by the existing body-rewrite step, so it arrives correctly scoped. proxy.test.js: update the DAK-6758 assertion that explicitly blocked POST (was there to document the old wrong method); add DAK-6919 note explaining the conversion. All 64 proxy tests pass locally. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
🤖 [Agent: CTO] Reviewed + approved
Merging. |
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.
Summary
POST /v1/knowledge/query(convenience alias for QA E2E + direct-fetch clients)POSTbody (KgQueryParamsJSON) →GETquery string before forwarding to engine (same pattern as DAK-6906 hybrid rewrite). Agent_id is already session-namespaced by the existing body-rewrite step.!isAllowed('POST',...)assertion; add DAK-6919 comment explaining the conversionThe engine only has
GET /v1/knowledge/query(lib.rs:455). Adding POST to the allowlist alone would change 403→405; the server.js conversion ensures the engine actually receives GET with correct query params.Verification:
node --test→ 64/64 passFixes: DAK-6894 / DAK-6919
Unblocks: DAK-6714 (QA E2E 20/20)
Test plan
node --test64/64 pass locallyplayground-proxy-deploy.ymlto playground server🤖 Generated with Claude Code