Repository navigation
feat: enforce SDK security and exercise secure SUT scenarios - #308
Conversation
|
@codex review this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37f4146d98
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR again |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8666d79735
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Preserve curl transfer diagnostics by relying on callers to reset handles before installing their error buffers. Reject task-bearing stream events without IDs while allowing taskless messages, with regression coverage for unary/streaming errors and ordinary/timed stream reads. Consolidate security documentation and signed-card payload fixtures. Keep the security executor private to the SUT and inherit ordinary operations instead of forwarding them. Reduce the PR from 62 to 55 files and remove 248 net lines without dropping security coverage. Validation: CI formatting, clang-tidy, verify_changes.sh (744 checks, zero failures, two intentional skips), multi-config regressions (32 passed), performance smoke (54 rows, zero errors), dependency scan, and upstream TCK on both stores (249 passed, 16 conditional skips; 80.9% mandatory compliance per the approved interim target).
|
@codex review this PR again |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90523002de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Check actual GetTask and CancelTask response ownership before release. Share authorized task lookup across requests, associated messages, streams and list loading; normalize missing-task errors while preserving other store failures. Add regressions for foreign executor responses and serialized error messages on all three bindings. Simplify the private SUT executor, reuse listed metadata during credential polling, and consolidate vector provenance into the shorter security guide. The PR now changes 54 files instead of 55 (62 originally), with all features retained. Validation: CI formatting, clang-tidy and verify_changes.sh passed (749 CTest checks, zero failures, two intentional skips). Multi-config: 40 passed. Performance: 54 rows, zero errors. Refreshed dependency scan: zero vulnerabilities. Original upstream TCK: 249 passed and 16 skipped per store, 80.9% mandatory compliance under the approved interim target. Regressions fail against the previous implementation and pass with the fixes.
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb0a92c62b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Authorize every returned push-notification configuration using the authoritative task store, including all list entries and missing-ID rejection. Make response authorization exhaustive across payload variants. Retain the authenticated principal across before/after interceptors, executor callbacks, response checks and stream setup. Preserve application-managed identity behavior when no SDK security policy is configured. Advertise a separate public gRPC target in the TLS fixture and exercise it through Agent Card discovery with certificate verification enabled. Leave JSON parsing and dependencies unchanged. Validation: CI formatting, clang-tidy and verify_changes.sh passed with 761 CTest checks, zero failures and two intentional skips. Multi-config: 52 passed. Performance: 54 rows, zero errors. Dependency scan: zero vulnerabilities. Original TCK on both stores: 249 passed, 16 conditional skips and 80.9% mandatory compliance under the approved interim target.
|
@codex review this PR again |
|
TODO: consider simdjson again |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11ecf604f3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR again |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 71d5ae53f9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review this PR again |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Double check |
Build signing inputs as unsigned bytes and use a fixed-size Ed25519 signature array. Document the remaining permitted character-alias views and validate OpenSSL integer size limits. Cover malformed and noncanonical signature encodings.
|
@codex review this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 55fa1fc372
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Preserve history-based GetTask and SendMessage authorization before response and audit projections. Reject authorization-service cancellation of ordinary tasks and reserve disjoint SUT/proxy ports. Simplify visible task selection and signing validation, borrow canonicalization members, and remove redundant TLS/discovery test combinations while keeping every cross-binding pair.
|
@codex review this PR again |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Stacked on #308; targets `feat/305-sdk-security-scenarios`. Agent Card signing now parses JSON with simdjson instead of the custom syntax scanner and protobuf `Value` parser. Other SDK JSON parsing paths stay unchanged. - Keep simdjson 3.0+ optional with `A2A_ENABLE_SIGNING`; add it to the vcpkg signing feature, Linux security installer and exported package dependencies. Windows CI now builds signing too. - Remove `json_canonicalization.cpp`, both old headers, the standalone test file/target and the unused strict syntax scanner. Canonicalization is private to signing; independent RFC 8785 and Python/Go interoperability coverage lives in the signing suite. - Preserve unknown signed fields, decoded duplicate-key rejection, Unicode validation, signature exclusion, size/depth limits and rotation behavior. Use On-Demand `get_double()` so integer tokens beyond 64 bits retain JCS binary64 behavior. Borrow decoded JWS strings and use sorted lookup for header overlaps. **Canonicalization detail:** simdjson is a parser, not an RFC 8785 implementation. A private serializer still supplies UTF-16 key ordering, JCS string escaping and ECMAScript number formatting; simdjson minification alone would produce incorrect signatures. CI compatibility fix: Ubuntu's simdjson 3.6.4 requires an explicit argument on raw `field::unescaped_key()`, while 3.0.1 and 3.12.3 accepted the previous call. Decode keys through the stable `simdjson_result<field>` API before unwrapping the value. This preserves strict Unicode handling without version checks or another abstraction; malformed surrogate-key regressions cover that behavior. Windows also selected OpenSSL 1.1.1i and simdjson 0.8.2 from the historical baseline. A scoped, pinned registry now selects OpenSSL 3.6.5 and current CMake helpers; simdjson is pinned to the tested 3.12.3 version. The gRPC/protobuf/curl baseline is unchanged. Default and signing-enabled dependency plans were validated on Linux; MSVC compilation is checked by CI. Validation on Linux: The replacement [Ubuntu 24.04 TCK CI run](https://github.com/MisterVVP/a2a-cpp/actions/runs/39219089247) passed, including security validation and mandatory suites for both stores. - Exact CI clang-format, full clang-tidy and `./scripts/verify_changes.sh`: passed; 796 checks, zero failures, two intentional in-process HTTP TLS skips. Live TLS/security scenarios passed for both stores. - Simdjson 3.0.1 and optimized 3.12.3 builds: all 29 focused tests passed. The exact Ubuntu 24.04 simdjson 3.6.4 package also passed the CI build/security step (105 checks). The retained corpus has 57 independent vectors; another 1,999 generated cases matched an ECMAScript oracle byte for byte. - Fresh installed-package consumer signed and verified through `a2a::signing`; obsolete headers were absent. Signing-disabled TCK builds passed with simdjson discovery explicitly disabled. - Original upstream TCK, both stores: 249 passed / 16 skipped each; mandatory 80.9%, overall 80.0%, within the approved interim target. Upstream security groups remain NOT TESTED. - Trivy recognized both the Ubuntu/local dependency pair (simdjson 3.6.4, OpenSSL 3.5.7) and the pinned vcpkg pair (simdjson 3.12.3, OpenSSL 3.6.5): no known vulnerabilities reported. Clang 19 lint uses simdjson 3.12.3; Ubuntu 3.6.4 was validated with GCC because its upstream formatter header fails Clang 19 independently of SDK code. Windows/MSVC execution awaits CI. A later full-suite run exposed an existing HTTP streaming teardown race: `SharedHttpClientTest.OneClientKeepsSixtyFourStreamsOnBoundedSharedThreads` passed its assertions, then aborted with `Resource deadlock avoided`. The same failure reproduced on trial 8 in the preserved pre-change executable dated October 15. HTTP streaming implementation/tests are unchanged in this PR; the failure is recorded separately from signing validation. Local optimized microbenchmarks against preserved #308 binaries, one pinned CPU, alternating before/after runs (microseconds/call): | Case | #308 | This branch | | --- | ---: | ---: | | Canonicalize 686-byte signed card | 46.640 | 5.212 | | Canonicalize 256 short Unicode keys | 392.220 | 68.187 | | Canonicalize 256 long Unicode keys | 763.237 | 289.347 | | Verify shared Python/Go signed card | 226.337 | 144.649 | These are fixture-level measurements, not transport-throughput claims. General JSON parsing migration remains deferred until after #308 merges. Authorship: implementation, tests, configuration and documentation generated by an AI agent (Codex).
|
@codex review this PR again |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Addresses #305; builds on merged #307 and includes the signing refactor from #310.
Adds SDK security enforcement and live security scenarios across HTTP+JSON, JSON-RPC and gRPC, using both in-memory and PostgreSQL task stores.
auth_requiredstates and pending messages, apply revision-checked transitions, and coordinate live subscriptions with authorization changes. Cancellation through this service requires an authorization-managed task.Secured
GetTaskand unarySendMessageauthorize the full response before applying history limits and invoking audit hooks. Owned task responses that have not been stored remain supported without extra store lookups.Dependencies and scope
Signing is disabled by default. Enabling
A2A_ENABLE_SIGNINGand linkinga2a::signingadds OpenSSL 3.0+ for Ed25519 and simdjson 3.0+ for strict JSON parsing. No nlohmann/json dependency is introduced.Simdjson replaces the signing path's custom syntax scanner and protobuf
Valueparsing. A private serializer still implements JCS key ordering, escaping and number formatting: simdjson itself does not provide RFC 8785 canonicalization. The old public canonicalization API and standalone implementation/tests are removed; independent vectors remain in the signing suite. Broader SDK JSON parsing changes are deferred.A scoped vcpkg registry selects OpenSSL 3.6.5 and pins simdjson to tested version 3.12.3, with current CMake helpers; the existing gRPC/protobuf/curl baseline remains unchanged. nginx and the OpenSSL CLI are live-test tools.
Implementation details and vector provenance: security scenarios guide.
Validation
1221085: CI passed, including Windows/MSVC, macOS, Linux build/lint/tests, sanitizers, interoperability and performance checks. TCK, CodeQL, docs and tutorials also passed.verify_changes.shpassed; 796 checks, zero failures, with two intentional in-process HTTP TLS skips. Live security/TLS scenarios passed for both stores.Limits
Applications supply identity validation, permissions, credentials and trusted-key policy. Signing supports Ed25519 without critical JWS extensions; empty/default-field interoperability awaits a2aproject/A2A#2122. Exact visible task counts still scan matching tasks; pagination/ordering follow-up is #309. An intermittent HTTP streaming teardown failure also reproduced in a pre-signing-refactor binary; details are recorded in #310.
Authorship: substantive code, tests, documentation and configuration were generated by an AI agent (
AI agent).