Repository navigation
integration-proxy 0.2: Atomic v2 signed requests, agent-owned connections, delegations and frame capabilities (#54) - #122
Merged
Conversation
…rame capabilities (#54) Implements the proxy side of the interim #54 design ("Proposal: integration-proxy auth redesign"), porting what is still valid from draft PR #72 (persistent connection rows with row-bound sealed credentials, 90-day idle expiry, refresh lease, single-use signed-message replay store). - Agent ids: one parse function accepts atomic:agent: and did:ad:agent: in both base64 alphabets and canonicalizes to atomic:agent:<base64url>. - Atomic v2 request signatures (x-atomic-* headers, x-atomic-signature-version: 2, message atomic-request-v2 / METHOD / full URL / ts ms / sha256 hex body), v2 only, +/-5 min, single use, agent must be atomic:agent:<public key>. The signed URL is built from BASE_URL, never the Host header (TLS termination on Heroku). - Routes: /proxy/{connection_id}/{platform}/{path}; /connect without login or user_id (https, loopback http or atomic:// return); signed POST /connect/redeem makes the signer the owner; GET /connections; DELETE /connections/{id}; POST/DELETE /connections/{id}/agents; POST /runtimes, DELETE /runtimes/{agent}. Delegations and runtimes are checked on every request. - Frame capability v2 (Authorization: Capability <payload>.<sig>, owner- signed, aud = proxy origin, cnf = frame agent, exp <= 15 min), with the request itself signed by the cnf key. #72's v1 bearer capability is gone. - AccessPolicy trait asked about the owner at redeem and on every signed request; default EnvAccessPolicy (REVOKED_SUBJECTS, ALLOWED_AGENTS). - Flag day (decision 6): removes OIDC APP_AUTH_* login, tenantIdentity API login, tenant:v1, tenant secrets / SERVER_SECRET, /session, legacy signed /connect and /oauth/{platform}/start, the /proxy tenant check and rotating connection codes (Bearer / X-Connection-Code). - JSON {error, message} bodies with stable codes (capability_expired etc). - Crate 0.1.0 -> 0.2.0; Heroku wrapper template now depends on "0.2". Tests: unit tests for every verification step, plus PostgreSQL tests for replay, expiry, delegation/runtime revocation, capability misuse, access policy, management, refresh lease, and an end-to-end OAuth connect -> signed redeem -> delegate -> proxy flow. atomic-server's v2 golden vectors are copied to tests/fixtures and verified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oku 0.2 env changes (#54) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 24, 2026
michielbdejong
pushed a commit
that referenced
this pull request
Sep 24, 2026
The e2e mock proxy now checks what the real proxy (integration-proxy/src, #122) checks on the surface a client sees: Atomic v2 request signatures (method, full URL under the mock's BASE_URL, timestamp, body hash; +-5 min; single use), agent ids in both prefixes and alphabets, frame capabilities (owner-signed, aud, exp <= 15 min, scope, delegation, cnf signs the request), connections owned by the redeem signer, delegations, runtimes, and the proxy's {error, message} codes. No login and no user_id at /connect; API-key platforms take the key on the consent page, as templates.rs does. Rotating connection codes, Bearer and X-Connection-Code are gone. Fixtures, their drivers (/__fixture/..., /fixture/<platform>/<driver>) and failure injection are unchanged: the mock rewrites /proxy/{id}/{platform}/ to the /proxy/{platform}/ paths fixtures already match. New test-side introspection: GET /__mock/connections and POST /__mock/revoke. mock-proxy.test.mjs verifies the shared v2 vectors (integration-proxy/tests/fixtures/atomic-request-v2-vectors.json) and atomic-server's capability vector against the mock's verifier. Kept the mock rather than running the real binary: the real proxy only accepts https upstreams and catalogs, needs a provider OAuth server per platform and Postgres per lane. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Implements the proxy side of the interim #54 decision (the "Proposal: integration-proxy auth redesign" comment). It supersedes draft #72.
src/agent_id.rs) acceptsatomic:agent:anddid:ad:agent:, in either base64 alphabet, and always stores and returns canonicalatomic:agent:<base64url>.atomic-request-v2\n{METHOD}\n{full URL}\n{ts}\n{sha256(body)}.atomic:agent:<pubkey>.BASE_URLplus the path and query, never fromHost./proxy/{connection_id}/{platform}/{path};/connect, with no login and nouser_id, plus the consent page;POST /connect/redeem, where the signer becomes the owner;GET /connectionsandDELETE /connections/{id};POST/DELETE /connections/{id}/agentsfor delegations;POST /runtimesandDELETE /runtimes/{agent}.Delegations and runtimes are checked on every request.
Authorization: Capability <payload>.<sig>, signed by the owner, withcnfnaming the frame key,audthe proxy origin, andexpat most 15 min ahead. The request itself must be signed by thecnfkey.APP_AUTH_*,tenant:v1:, tenant secrets andSERVER_SECRET,/session, the legacy/connectand/oauth/{platform}/start, and rotating connection codes;connection_codesandoauth_statestables are left in place, and the README gives theDROP TABLEline.AccessPolicytrait (build_app_with_access). The default allows everyone except agents inREVOKED_SUBJECTS, with an optionalALLOWED_AGENTSlist. The atomic.place account lookup (atomic-saas#138) plugs in here later.{error, message}with stable codes, for examplecapability_expired,not_delegated,unknown_connection,capability_key_mismatch.Tests: 106 pass against Postgres 16. They cover every verification step and failure mode, replay, expiry, revocation, capability misuse (stolen, wrong audience, expired, too long, wrong scope) and canonicalisation. There's also an end-to-end test: consent → OAuth (mock provider) → signed redeem → delegation → proxied call. atomic-server's shared v2 test vectors verify. fmt, clippy,
cargo packageand the Heroku wrapper build are clean.Deployment:
"0.2".localthought/integration-proxybumps to 0.2 and the Heroku env is updated:BASE_URL=https://localthought.io, the exact public origin;APP_AUTH_*andSERVER_SECRET;REVOKED_SUBJECTSnow holds agent ids.Not yet: the client side in
integrations/(browser.ts, github-issuesproxy.mjs, the mock proxy, and the specs) is phase 2 of #54.Refs #54. Supersedes #72.
🤖 Generated with Claude Code