Repository navigation
fix(cli,transport): reject duplicate JSON keys, non-finite constants, and non-string coercion in CLI and HTTP transport (#272) - #275
Conversation
|
🟡 Contributor Check: MEDIUM
Automated check by AgenTrust Contributor Check. |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed exact head c36e4bb40037199f49dfc8b069f7eb96a5ca587e in an isolated checkout.
The CLI and unauthenticated HTTP JSON boundaries now reject duplicate members/non-finite constants, and required record/offer identifiers are checked as strings rather than coerced with str(). The authenticated task route retains its existing canonical decoder. No blocking source finding in the changed paths.
Fresh hash-locked Python 3.12.10 validation: 777 unit tests passed, 16 skipped; pip check, Ruff, mypy and Bandit passed. Sign-offs are present. git diff --check reports an extra blank line at test_lineage_cli.py EOF only. Required hosted checks and maintainer gates still need completion.
Reviewed with OpenAI Codex.
|
@drk-ram Kindly resolve conflicts and rebase on main |
c36e4bb to
1889ce4
Compare
|
@rajnisht7 Rebased onto |
carloshvp
left a comment
There was a problem hiding this comment.
Reviewed current head 37262598375ff22373f2740b3f2a115ffca3b4c3 in an isolated checkout.
The scoped input-hardening behavior passes source review and the full local unit/conformance suite (833 passed, 16 skipped). Ruff lint, mypy, configured Bandit and dependency consistency pass; the commit is signed off.
The required ruff format --check src/ tests/ job still fails on this head, while the same command passes on current main. Please run the pinned formatter on src/ca2a_runtime/cli.py, tests/unit/test_lineage_cli.py and rerun the format gate. The formatting diff is mechanical; no additional behavioral repair is requested by this review. Hosted CI and the independent security-review requirements still apply.
Reviewed with OpenAI Codex.
|
The requested formatting correction is ready for author adoption: dinakarjs#3, commit |
… and non-string coercion in CLI and HTTP transport (agentrust-io#272) - Reject duplicate JSON object keys and NaN/Infinity constants in server.py (/ca2a/task), client.py (_get_json / _post_json), and cli.py (_load_chain, _load_records, _cmd_verify_lineage). - Require strict string and list types in cli._load_records and validate decision in {"allow", "deny"} in DelegationRecord.__post_init__. Closes agentrust-io#272 Signed-off-by: Raghuvar Karthik Durga <177662415+drk-ram@users.noreply.github.com>
|
@carloshvp Amended and force-pushed |
3726259 to
4af1465
Compare
What
Reject duplicate JSON object keys and non-finite constants (
NaN,Infinity) acrossca2a_runtime.cli,ca2a_runtime.transport.server(/ca2a/task), andca2a_runtime.transport.client, and enforce strict field types incli._load_recordsandDelegationRecord.__post_init__.Why
Closes #272.
Security impact
Prevents duplicate-key JSON smuggling on
/ca2a/task, HTTP client responses, and CLI chain/DAG files, and preventscli._load_recordsfrom splitting a stringscopeinto single-character capabilities or coercing non-string fields viastr(...).Test plan
pytestpasses (pytest tests/unit/test_lineage_cli.py tests/unit/test_live_call.py tests/unit/test_provenance.py -q:58 passed)ruff checkpasses (ruff check src/ca2a_runtime/provenance.py src/ca2a_runtime/cli.py src/ca2a_runtime/transport/server.py src/ca2a_runtime/transport/client.py tests/unit/test_lineage_cli.py:All checks passed!)mypypasses (mypy src/ca2a_runtime/provenance.py src/ca2a_runtime/cli.py src/ca2a_runtime/transport/server.py src/ca2a_runtime/transport/client.py:Success)DCO sign-off
Developer Certificate of Origin (https://developercertificate.org).