feat(runtime): live A2A JSON-RPC listener via ca2a start#52
Conversation
Wire parse_peer_request into handle_peer_request on message/send so a callee can enforce a PeerRequest on a live inbound call. Keep the claim boundary: no attestation handshake and no seal-to-verified-measurement binding; sealed open uses a configured software key only. Signed-off-by: Susan Poudel <susanpdl77@gmail.com>
Require an explicit host in listen_addr instead of defaulting to 0.0.0.0, which tripped the hardcoded-bind-all-interfaces scan. Signed-off-by: Susan Poudel <susanpdl77@gmail.com>
imran-siddique
left a comment
There was a problem hiding this comment.
Reviewed the diff and thread. Scope is tight and matches the body: live inbound A2A JSON-RPC wiring for the second Tier 2 checkbox, with ordinary A2A returning ca2a: null rather than inventing a trust state, and malformed metadata plus denials failing closed with a structured ca2a_code. X25519 key handling validates length and is software-configured only, with the docs correctly caveating that it is not measurement-bound. No secrets in the diff; test keys are generated at runtime. Tests cover config, policy loader, and server paths, and all real checks are green. LGTM. Leaving the merge to a maintainer.
|
@Susanpdl this is approved and ready except for a merge conflict with main. Could you merge main into feat/live-a2a-inbound-serving (or rebase) and resolve the conflict? Once it is clean it can go in. Thanks. |
|
Happy to resolve the conflict, but I want to check the shape with you first, because #53 landed after your approval here and it overlaps with this branch. The conflict itself is small: CHANGELOG.md, LIMITATIONS.md, ROADMAP.md, docs/spec/transport.md, and pyproject.toml. No code conflicts. The bigger question is duplication. #53 added What is still missing on main and is the part of this PR I think is worth keeping:
So my suggestion is to refit this branch instead of merging it as-is: keep Want me to go that way, or would you rather keep the two transports separate (JSON-RPC alongside the reference server), or just close this and open a smaller CLI-only PR? Happy to do whichever you prefer. |
Summary
ca2a startandca2a_runtime.server: Starlette JSON-RPC listener formessage/sendthat runsparse_peer_request→handle_peer_requestend to end (verify chain, intersect local/Cedar policy, open sealed payload when a key is configured, emit provenance).ca2a: nullwithout inventing a trust state; malformed metadata and denials fail closed withdata.ca2a_code.local_policyand optionalenclave_private_key_hex; install withpip install 'ca2a-runtime[serve]'.Closes the second Tier 2 checkbox on #47 (live inbound wiring). Does not claim attestation handshake or seal-to-verified-measurement binding.
Test plan
ruff check src/ tests/mypy src/ca2a_runtime/ src/ca2a_verify/pytest tests/unit/ tests/conformance/(195 passed)ca2a start --config examples/minimal/ca2a-config.yamlthen POST amessage/sendenvelope to/rpc