Skip to content

fix(gitops): deliver explicit owner-aware and installation-owned role scopes - #1167

Merged
antoinetoussaint-byte merged 6 commits into
mainfrom
feat/role-installation-owned-scopes
Oct 26, 2026
Merged

antoinetoussaint-byte merged 6 commits into
mainfrom
feat/role-installation-owned-scopes

Conversation

@antoinetoussaint-byte

@antoinetoussaint-byte antoinetoussaint-byte commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

A solution declaring installation-owned role scopes could deliver those scopes but still fail person issuance: its module contract had no way to declare the owner-aware checking required by authority. Carry the explicit owner_aware: true declaration from Core's contract into the signed composition authority document, alongside each role's installation_owned_scopes.

owner_aware: true
roles:
  - name: viewer
    scopes:
      - {resource_kind: wiki.page, actions: [read]}
    installation_owned_scopes:
      - {resource_kind: documents.collection, actions: [read]}

Classification: fix at the owning seams. Core owns the contract and strict decoding; CLI owns projection into AuthorityManifestV1 and delivery. Reuses modulecontract.Load, the existing contract readers, signed CompositionDelivery, generation fingerprint and withdrawal path. No inferred declaration, CLI-side validation, alternate delivery mechanism or generated-file edits. The declaration participates in generation changes; withdrawals read and carry no live declaration.

Dependencies and merge order:

The regression delivers an actual contract over the existing gRPC composition test peer, decodes the received authority document, projects it into authority's domain and invokes the real authority-core issuer and verifier. A declared owner-aware solution issues for a person, preserving its installation seal and resource-owner selector; absent and false declarations refuse by name without a token. The delivered installation-owned role scope remains bounded to the installation's resource IDs. The transport peer is controlled; this test does not run authority's deployed composition plugin.

Verification at 9f501cdd8d61d206fae7a0c5510a176aa1e06a04:

  • Full go vet ./... and golangci-lint run ./... pass (0 lint issues).
  • Focused issuance, decoding, generation, role-delivery and withdrawal regressions pass.
  • Red control: suppressing only the delivered owner_aware field makes the positive issuance test fail with shop does not declare owner-aware checking; the unmodified implementation passes.
  • go test -race ./pkg/gitops ./cmd/run ./cmd/generate ./pkg/gitops/cellfile -count=1 passes. Local Git fixtures use native Git; every actual GitHub fetch/push uses the required private helper. CI is green on 9f501cdd8d61d206fae7a0c5510a176aa1e06a04: 15 passed, 1 skipped, including full race, coverage and lint.
  • Core companion: full vet and module-contract race suite pass; no new lint findings against 590c2562. Core's full-repository lint baseline has 1,298 uncapped findings, reproduced identically before/after this change.

The existing adaptations to Core main remain: ProtobufProcedures receives its endpoint; contract-kit tests supply the required audience slots; the runnable-refusal assertion follows Core's current wording.

Follow-ups:

  • CLI's existing Roles reader still projects literal roles rather than Resolved.Roles binding grants; that pre-existing delivery gap is owned by CLI.
  • The existing composition transport uses generated protocol stubs; migration to the Codefly-generated client/Connect lifecycle is CLI-owned follow-up debt. This change reuses that transport and generates or hand-edits no client.
  • Core owns its pre-existing lint backlog.

Not verified locally: full CLI race suite, deployed Kubernetes/native authority plugin, or hosted accounts integration. No PR is merged by this task.

…rity

A solution's module contract can declare, per role,
installation_owned_scopes (core#839): scopes the authority grants only on
what the installation owns. gitops.Roles now carries them into the
authority document as RoleV1.installation_owned_scopes (field 3,
codefly-dev/authority#7), beside scopes, through one workScopes helper.

Pins core at core#839's head (75333b54) and authority-client at
authority#7's head (1b6d3018); both re-pin after they merge. Core main's
ProtobufProcedures now takes the endpoint (core#836), so the contract
surface passes it, and the module-contract kit's render supplies the
audience slots core main's role fixtures declare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
antoinetoussaint-byte added a commit that referenced this pull request Oct 26, 2026
…ence regenerated

Re-pins core to v0.19.7-0.20261026023455-8b5ddef6d55a, #843 as merged.
That commit also carries core#845 (WorkScopeV1.resource_owner_id) and
core#835's module-contract kit fixture roles-grant-bindings.

- docs/cli-reference.md: regenerated with
  `go test ./cmd -run TestCLIReferenceIsCurrent -update-reference` for this
  branch's new `generate runnables` help text.
- The round-trip test exempts WorkScopeV1.resource_owner_id by name: core
  refuses an operation that declares an owner, so the document has nothing to
  carry. TestRunnablesRefusesADeclaredResourceOwner proves the refusal reaches
  `codefly generate runnables` with core's reason.
- The module-contract kit's staging composition supplies the audiences
  roles-grant-bindings resolves (the same line as #1167, so the two merge
  cleanly).

The document-store oracle digest is unchanged (4b72d393...).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
antoinetoussaint-byte and others added 2 commits October 26, 2026 09:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core #850 keeps the refusal and now explains owner inheritance. Assert the current named reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin Core's owner-aware module contract and authority main. Carry the explicit
boolean in the signed composition declaration and generation fingerprint.
Prove real authority person issuance from the delivered solution, including
named refusals when absent or false and installation-owned scope bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antoinetoussaint-byte antoinetoussaint-byte changed the title feat(gitops): deliver a role's installation_owned_scopes to the authority fix(gitops): deliver explicit owner-aware and installation-owned role scopes Oct 26, 2026
Use Core 7c040767 and tidy the dependency checksums after validation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@antoinetoussaint-byte
antoinetoussaint-byte added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit e4de4a8 Oct 26, 2026
17 checks passed
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