Repository navigation
feat(gitops): a module installing prepared bindings asks for each one - #1121
Merged
Merged
Conversation
A service that declares the runnable-bindings group installs every binding the composition prepared, and the mesh already admits it to each owner from that one derivation. Its module's authority request now names each prepared binding too: the prepared key as the binding id, with the audience and the kinds and actions of the binding's resolved policy, and no resource id. Which resources an organization lets the module reach is that organization's consent, written to the module's installation scope. A native run and a publish also list each prepared binding in the installing module's envelope grant: the audience, the kinds and actions without resource ids, and delegation_mode module_actor. This is a labelled stopgap that exists only because the host reads the mode from the envelope; it goes away when the mode travels with the manifest's binding. An entry the composition states for a key is kept, and a module that asks for no authority gains nothing, since the host grants it its envelope whole.
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.
A module whose service installs prepared runnable bindings (it declares the
runnable-bindingsworkspace configuration group) is admitted to every owner those bindings call by the mesh, but asked the host for nothing to call them with. The host grants only bindings a manifest requests, so a prepared call could never exchange a capability as the person it acts for.What changes
moduleAuthorityappends, for a module that installs prepared bindings, one binding per prepared key in the environment'srunnable-bindingsgroup:{id: <MODULE__OPERATION>, audience, operations: {invoke, lookup: [<kind>:<action>]}}, read from each value's resolved policy (runnable.DecodePrepared). Resource ids are dropped; the module's installation scope narrows the binding per organization. A key equal to a binding id the module's own declaration uses is refused by name, and a value that is not a prepared binding fails the render by key.WithPreparedBindingGrantsadds, to the grant of each module that asks for authority and installs prepared bindings, anoperation_audiencesentry per prepared key the grant does not already state: audience, kinds and actions without resource ids, and"delegation_mode": "module_actor". Both the native run (launcher.grants) and a publish (listPreparedBindings, afterdeclareEnvelope) apply it, so a cell lists what a run lists. It exists only because the host reads a binding's mode from the envelope; it is deleted when the mode travels with the manifest's binding.Reuse
derivedRunnableReachalready applies for mesh edges and cell consumers: a service declaringrunnable-bindings.generate runnable-bindingswrites (core'sDecodePreparedand the resolved policy), not a second resolution.loadModuleServices,authorityRequestOfand the composition's envelope merge (ReadCompositionGrants) are reused as they are.Classification
The request half is a fix where the behaviour belongs: the render already derives what a module calls, and now derives what it asks for from the same source. The envelope entry is a stopgap, labelled in code and docs: it carries the delegation mode only because the host reads the mode from the envelope today.
Tests
go test ./pkg/gitops/... ./cmd/run/...passes, andgolangci-lint run ./pkg/gitops/... ./cmd/run/...(v2.14.0) reports 0 issues. New tests inpkg/gitops/runnable_grants_test.go:module_actorand no resource id, keeping every other field and entry;Not run: a render or publish against a live host.
Per-organization narrowing
The resource ids a binding reaches come from the module's installation scope, not from this change. Narrowing an existing installation is refused on every host today: the host leaves its policy log unset (codefly-dev/module-saas-starter
module/services/accounts/code/work.go:569) until codefly-dev/module-saas-starter#1067, and narrowing requires it. Until then, an organization's resource ids are set when the module is installed, with an explicitInstallSolutionscope.Docs
docs/module-manifests.md(what a module asks for; the envelope's stopgap entry) anddocs/runnable.md.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ehgefxu5moNkjuHfTJofXM