Repository navigation
fix(a2aclient): preserve REST endpoint query parameters - #480
Closed
Harshil-1603 wants to merge 1 commit into
Closed
Harshil-1603 wants to merge 1 commit into
Harshil-1603 wants to merge 1 commit into
Conversation
Member
|
Why would anyone publish an api key in a public agent card? The spec already provides mechanism (securitySchemes) for advertising how api key needs to be passed in the query. |
yarolegovich
added a commit
that referenced
this pull request
Nov 4, 2026
REST calls interpolate task and push-config IDs into a path before parsing it as a URL, so reserved characters such as `/`, `?`, `#`, and `%` change the route or query. The native client's tenant segment can be affected in the same way. Escape identifier segments in the native and v0.3 clients, preserve those escapes when joining the endpoint path, and escape native tenant IDs. Route-pattern builders retain their existing behavior. Real HTTP regressions check that Go's ServeMux receives the original opaque IDs and that operation query parameters remain intact. Validation: regression fails on the base revision and passes after the fix; full `go test -race -mod=readonly -count=1 -shuffle=on ./...`; `go mod tidy -diff`; `go build -mod=readonly ./...`; `go vet ./...`; golangci-lint v2.11.4 (0 issues); separate `examples/clustermode` build; `git diff --check`. This is independent of #480, which preserves endpoint query parameters. Both touch URL construction, but this PR changes path-segment handling only. AI assistance: prepared with Codex and verified using the checks above. --------- Co-authored-by: Harshil <[email protected]> Co-authored-by: Yaroslav Shevchuk <[email protected]>
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.
REST requests currently replace the advertised endpoint's query string with the operation's query parameters. An endpoint such as
https://host/agent?api_key=...therefore loses its authentication parameter, including for operations with no query parameters.Merge the operation parameters into a copy of the endpoint query. Explicit operation parameters override endpoint defaults, repeated unrelated values survive, and the caller's endpoint URL remains unchanged.
Both new HTTP regression cases fail before the fix. The full shuffled race-enabled suite, root and example-module builds,
go mod tidy -diff, golangci-lint 2.11.4, andgit diff --checkpass locally. Tests use a local HTTP server; no external service credentials are involved.AI assistance: this patch and its validation were prepared with OpenAI Codex (GPT-6).