Skip to content

The authz provider: one package fulfils a unit's authorization across three substrates, and elevation is its process-running case #1116

Open
1 of 5 issues completed

Description

@David-Noble-at-work

Ruled 2026-10-21 (naming, enums, the command runner, the execution model: recorded on #520)

The authz provider is the one package that fulfils a unit's authorization requirement. A unit names an offer; the provider resolves it through its broker router to a configured broker and returns a grant and a lease. Across the three substrates the draft specification names, the grant is: a session on a command runner standing for an account (command execution; when the account is root this is an elevation); a token or credential bundle bridged to a consumer such as appnet (network and service access); a credential injected into a sandbox (sbx; nothing in the tree yet).

Names. Package pkg/op/provider/authz; authz.Provider, authz.ProviderConfig, authz.Broker, authz.BrokerConfig; the term in prose is authorization. The design document is 6.1-authorization.md with 6.1-authorization.status.md, superseding 6.1-privilege-elevation.md; the draft of 2026-10-16 is its source and lands through its own task. elevator is dead and is removed (#679); flow.Provider has no Elevate today, so nothing moves out of flow.

What is settled, and what the draft must change to match.

  • Broker interface {Type, Acquire, Revoke} and a provider-owned router built from the resolved config, per 3.2 § Pluggable brokers: the router is itself a Broker, and the pattern is recursive. No global registry.
  • Strategy and grant kind are string enums; the empty string is the zero value and means defer. The draft's int constants are replaced.
  • There is no Mode and no "whether": a unit's command declares the account it needs, and the runner standing for that account runs it. A runner under the caller's own account needs no grant.
  • ProcessSpawn owns no worker. Its grant is a session on a runner from the pool (6.2, to be revised onto the account axis and the daemon model).
  • Every action takes an activation record and returns a product, a receipt and an error; the lease is the receipt, committed and pushed by the executor. The draft's Authorize(req) gains the record, and "registered on the RecoveryStack" becomes "returned as the receipt".
  • Preflight: the graph-only check (every referenced offer is declared) sits in op.ValidateGraph; the config cross-check needs the resolved profile and sits in GraphExecutor.Run's preflight.
  • Config: authz.ProviderConfig follows the pattern that exists, op.PoliciesConfig (AnnounceSection, devconfig.SectionBase), until the recursive tree lands; its path is providers.authz, not top-level.
  • In the daemon model the provider is the client side: it requests; the broker daemon holds the policy, decides and routes. Where offers and brokers are configured, client or broker or both, is open.

Open, for the plan (the gap analysis on #520 has the full list): before or after the workflow rename (#451); where the fallback chain lives; the grant's slot type and what Zero() guarantees for the token case, given a promise result is retained on the stack; which substrates in the first cut; the headless case; the default host-escalation offer and whether writ asks by name.

First tasks, to be filed under this feature.

  1. 6.1-authorization.md lands from the draft, corrected as above, with its status companion; 6.1-privilege-elevation.md and its status retire.
  2. pkg/op/provider/authz: the types, the broker interface, the router, string enums, the action signatures; announced; elevator removed (elevator is removed: the stub is dead, and its rename plan is withdrawn #679 closes into it).
  3. The host-escalation broker: Acquire returns a runner session from the pool by account; Revoke releases it.
  4. pkg/platform: runCommand(argv, sudo bool) and runWindowsCommand(command, elevated) go; each manager backend declares its account and obtains its runner (Route pkg/platform's inlined sudo -n through the elevation model #527 is this task).
  5. Preflight: the two checks above.
  6. The Starlark surface for naming an offer on a unit, with Plan provider: the workflow-authoring surface (plan.*) #856.

Evidence of completion

  • 6.1-authorization.md is in the tree and 6.1-privilege-elevation.md is not
  • pkg/op/provider/authz is announced, imported by the executor, and pkg/op/provider/elevator is gone
  • pkg/platform passes no sudo boolean anywhere; every privileged command runs on a runner obtained by account
  • A unit naming an unconfigured offer is refused at preflight with ReasonPreflightFailed
  • writ deploy of a System/ tree on a Unix host succeeds from an unprivileged shell, through the runner standing for root (David-Noble-at-work/personal#289's acceptance)

Plan and design documents

Kind Document
Plan Not yet opened
Design 6.1-authorization.md, to land from the 2026-10-16 draft (task 1)

Sub-issues

Sub-issues

1 of 5 Issues completed
Loading 5 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions