Skip to content

fix(accounts): authorize scoped source declaration reads - #1197

Merged
lukazhupa merged 3 commits into
mainfrom
codex/source-operation-discovery-scope
Oct 23, 2026
Merged

lukazhupa merged 3 commits into
mainfrom
codex/source-operation-discovery-scope

Conversation

@lukazhupa

@lukazhupa lukazhupa commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

A module holding a narrowed source-read Work Context cannot currently read the source’s operation declarations: ListSourceOperations falls through to interactive authentication. Adding only the source authentication ingress would widen that capability to its owner’s broader source access. This fix joins the existing ingress and exact source-read gate on the existing listing API.

Related #1023 (bounded declaration discovery only; the broader integration issue remains open).

Classification: fix at the host owner. Reuses the existing signed Work Context verifier, current-authority/delegation checks, final-hop scope gate, membership check and business source/personal-owner/boundary authorization. It adds no RPC, registry, permission vocabulary, client protocol, execution loop or credential custody. The existing public Go client already exposes this listing; no generated contract or client change is needed.

A successful response retains the admitted declaration schemas, effect, output bound and digest. A listing grants no invocation authority and does not expose a model-facing tool automatically. The existing behavior documentation describes the supported read and limits.

Validation on candidate d8e311e5ec28394c7d56e4cbea6ee92fd1fdf5ad against baseline 2cb00737ed56c79c823bc82f4055681a51919e7c, Go1.27.2:

  • Real generated Connect client/handler and signed Core capabilities, with fixture storage and authority sources: explicit read success; another source/tenant, invoke-only/unrelated/empty/unconstrained scopes, wrong audience, identity-only module credential, expiry, duplicate/invalid/missing credential, absent membership, boundary refusal and another personal owner all refuse before reading declarations.
  • A successful read followed by permission, membership or capability revision revocation refuses the next read. Interactive read remains available.
  • Handler regressions check final actor attenuation and the verified borrowed-source identity when a binding’s scopes name two sources but its delegation belongs to only one.
  • Separate source-overlay negative controls fail when either production change is removed: absent ingress refuses the valid read; absent handler gate accepts the wrong source. These controls leave committed source and dependency caches untouched.
  • Complete pure business and adapter race suites pass on the exact candidate (18.138s/6.793s), including all final credential/actor cases. Static vet passes. Naming, boundary, interface documentation and whitespace checks pass.

Qualification limits: storage, membership/boundary/authority facts, seals and workload attestation are controlled fixtures. The borrowed-source handler case authenticates through production code before replacing storage; it is not a real database/composed round trip. No live database/RLS, gateway composition, client release, full consuming application/model journey, cloud resource, deployment or release is claimed. Broader current-viewer/module admission, tool projection and invocation/result integration remain #1023. Fresh independent implementation review found no actionable issues on the exact candidate. The reviewer independently ran discovery, full adapter, source race and pure business regressions plus both source-overlay negative controls; see the local qualification limits above. Hosted qualification is not green (run39623196412). Accounts and gateway compilation pass; frontend dependency installation failed with npm ECONNRESET before compilation. The first run has settled, and a targeted compile retry is running as attempt2. The first-party Accounts vulnerability gate also fails. Canonical local codefly audit service accounts --outdated=false --json identifies HIGH GO-2026-6809, standard library1.27.2, fixed in1.27.3, using govulncheck1.6.0. The existing owner issue is service-go-grpc#188; its builder toolchain/image must move at the owner and then be adopted through the supported generated recipe. This patch changes no compiler, dependency, agent or image pin and bypasses no audit gate. The first hosted attempt passed full tests, lint, generated drift, SDK boundary and build. The separate asking-viewer/module first-admission and source-call audit requirement is tracked in #1200; this listing change does not implement it. The PR remains draft.

Reproduce the focused read proof from the repository root:

cd module/services/accounts/code
GOWORK=off go test -tags pure -race ./pkg/adapters -run '^TestSourceOperationDiscovery' -count=1 -timeout=90s

Update: current with main

Merged current main into this branch (no rebase); it now sits on top of #1198, #1215 and #1218.

  • A module_actor source child can read declarations for its own sources. Its single hop carries datasource.sources read (lookup) or invoke, read (invoke) on exactly the source ids its installed binding names. So it passes this read's exact-source scope check for those sources and is refused for any other. The source surface stamps the owner as the request identity, so membership, personal ownership and source-boundary read stay the person's. feat(accounts): a module_actor binding names the exchanging module as the child's actor #1215's TestModuleActorSourceCallIsThePersonsWithTheModuleActing already exercises the read action on that path.
  • Checks: GOWORK=off go test ./pkg/adapters ./pkg/business and scripts/check-boundaries.sh pass locally.
  • The failing Codefly supply chain and Release gates checks fail on main as well (dependency audit findings and release gates), independent of this change.

@lukazhupa
lukazhupa marked this pull request as ready for review October 23, 2026 15:14
@lukazhupa
lukazhupa enabled auto-merge October 23, 2026 15:28
@lukazhupa
lukazhupa added this pull request to the merge queue Oct 23, 2026
Merged via the queue into main with commit 5cb94db Oct 23, 2026
24 checks passed
@antoinetoussaint-byte
antoinetoussaint-byte deleted the codex/source-operation-discovery-scope branch October 25, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant