Repository navigation
feat(aauth): graduate the agent identity for Trinity-to-Trinity calls — flag split, Settings surface, outbound endpoint UI (abilityai/trinity-enterprise#862, PR1) - #3699
Conversation
… — flag split, Settings surface, outbound endpoint UI (Abilityai/trinity-enterprise#862, PR1) Two switches now: `aauth_enabled` governs Flows 1–4 (well-knowns, signing, inbound verification, card) and is the single input of `active_issuer()`; `aauth_prototype_enabled` is narrowed to the person-token and resource-calling prototypes, gated once at `require_live` on BOTH switches. Forwarded in every backend compose file with an empty default so the Settings row stays the observable source; `aauth_available` on the feature-flags surface. `GET/PUT /api/settings/aauth`: admin on read, admin AND interactive on write (no MCP key of any scope), diff-only body, named 422 for an invalid issuer, person server or resource allow-list, audited `aauth_config_change`. The generic `PUT/DELETE /api/settings/{key}` refuses all five `aauth_*` keys — the two Flow 5–6 keys were the one MEDIUM `/cso --diff` found (pre-existing; cso-diff-2026-10-13-ent862-aauth-settings). Settings → Integrations gains an AAuth panel (honest "On, inactive" state, env-sourced values read-only, confirm before changing a live issuer, a federation-readiness checklist, the stated limits) and an outbound A2A endpoints panel over the OSS registry with `auth_scheme`; MCP `register_a2a_endpoint` takes `auth_scheme`. The two-instance demo script moves its generic settings writes to the dedicated route. Tests: tests/unit/test_ent862_aauth_settings.py (flag matrix, route principal matrix, generic-door refusals, compose wiring); mounted vitest specs for both panels (each proven red by mutation); MCP a2a.test.ts auth_scheme cases. Part 1 of 3 for Abilityai/trinity-enterprise#862. Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
Full backend unit island on the final tree ( All ten are host-environment, and the identical set reproduces on a clean
CI runs these with the image's dependency set and |
trinity-ability
left a comment
There was a problem hiding this comment.
Validated via /validate-pr (Lane C: compose files). Tier 1 green incl. pytest head + regression diff; PR-side journey-smoke and e2e green; dev-ci success on the dev tip. Local: 154 tests pass across the new suite and the auth/settings guards; mutation of the generic-catch-all refusal and the interactive gate each turn the new tests red.
PR Validation Report (/validate-pr)Lane: C (compose files:
Execution coverage (§5.4)
Mutation (run locally in the PR worktree): disabling the generic catch-all refusal → 5 tests red; swapping Issues Found
Recommendation: APPROVE — merged as |
Summary
Part 1 of 3 for abilityai/trinity-enterprise#862 (plan approved 2026-10-13 after strategy/engineering/security reviews and an independent Gemini critique). PR2 brings the core inbound
aauth:allow-list + per-agent toggle; PR3 the execution-record attribution.aauth_enabled(system_settings→AAUTH_ENABLED→ off) governs Flows 1–4 and is the single input ofconfig.active_issuer();aauth_prototype_enabledis narrowed to the person-token / resource-calling prototypes, gated once ataauth_person.require_liveon both switches. Forwarded indocker-compose.yml/.prod.yml/.hosted.ymlas${AAUTH_ENABLED:-}(empty default, so the Settings row stays the observable source — verified withdocker compose configon all three) and set outright in the two-instance harness.aauth_availableonGET /api/settings/feature-flags.GET/PUT /api/settings/aauth: admin on read; admin andrequire_interactiveon write (agent-, user- and system-scoped keys all 403); the body carries only the fields changed;422 {reason: invalid_issuer | invalid_person_server | invalid_resource_allowlist}named, never repaired; auditedaauth_config_change. The genericPUT/DELETE /api/settings/{key}refuses all fiveaauth_*keys.AAuthPanel(toggle + issuer, "On, inactive" when the issuer is invalid, env-sourced values shown read-only, confirm before changing a live issuer, a four-item federation-readiness checklist each naming its next step, the stated limits) andA2AEndpointsPanelover the OSS registry (/api/settings/a2a-endpoints): register/update by name withauth_scheme(the aauth choice hides the credential field and warns a stored one is dropped), remove asks first, bounded table, the outbound kill switch. MCPregister_a2a_endpointgainsauth_schemeand refuses a credential with it before any round trip./csodiff report.Security review
/cso --diff— 1 finding, MEDIUM, pre-existing on dev, independently verified, closed in this PR:aauth_person_server/aauth_resource_allowlistwere writable through the admin-only generic catch-all (which admits an admin's user-/system-scoped MCP key); both now live on the interactive-only route and the catch-all refuses them. Report:docs/security-reports/cso-diff-2026-10-13-ent862-aauth-settings.md./review— one outside-the-diff writer of a newly refused key (scripts/dev/aauth_prototype/demo.sh) found and moved to the route; learnings fragment captures the class.Changes
Backend:
services/aauth/{config,settings}.py,routers/settings/{aauth,generic,flags,__init__}.py,routers/aauth_person.py,models.py,services/aauth/{resource_allowlist,whoami}.py· MCP:tools/a2a.ts,client.ts· Frontend:components/settings/{AAuthPanel,A2AEndpointsPanel}.vue,stores/a2aFederation.js,utils/aauthSettings.js,views/Settings.vue· Deploy: three compose files,compose.b.yml,.env.example,demo.sh· Docs + tests.Test Plan
cd tests && pytest unit/test_ent862_aauth_settings.py -v— 51 pass (flag matrix,require_live4-arm, route principal matrix, five-key generic-door refusals, compose wiring)test_ent623_*,test_ent878_*,test_ent879_*,test_1028_settings_package,test_293,test_2996,test_1310,test_186,test_2094,test_ent435)npm test936 pass,tsc --noEmitcleannpm run test:unit5,868 pass incl. 29 new (two mounted panel specs — each proven able to go red by mutating the component; raw-color / loading-gate / source-text ratchets unchanged)AAUTH_ENABLED=true docker compose -f <each> configrenders the variable on all three stacksCross-repo: the issue stays open (closing keywords do not cross trackers); it is closed at release after PR3.
Part of abilityai/trinity-enterprise#862
🤖 Generated with Claude Code