Skip to content

agentTokens config section - #44

Open
dcmcand wants to merge 1 commit into
slice/agent-tokens-04-offline-access-notesfrom
slice/agent-tokens-05-config
Open

dcmcand wants to merge 1 commit into
slice/agent-tokens-04-offline-access-notesfrom
slice/agent-tokens-05-config

Conversation

@dcmcand

@dcmcand dcmcand commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Slice 5: agentTokens config and scope order

An admin can write an agentTokens section; it is off by default, and turning it on without what it needs fails at load naming the setting.

Spec: nebari-dev/tapas/docs/superpowers/specs/2026-11-30-agent-token-broker-design.md
Plan: nebari-dev/tapas/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md (Slice 5)
Contracts touched: Platform config file: new top-level agentTokens section, token.Scope.AtLeast
Depends on: #43

  • agentTokens: {enabled, services: [{name, audience, scope, minTokenScope}]}, off by default; scope defaults to openid email, minTokenScope to read-write.
  • With the switch on, load fails naming the key for: no auth.oidc, no client secret file, no services, an empty or repeated service name, an empty audience. minTokenScope must be read, propose or read-write whether or not the switch is on. No message prints a value.
  • token.Scope.AtLeast: read < propose < read-write < admin, false for an unknown scope on either side.

Nothing reads the section yet; the broker slices build on it. An older binary refuses a file that has the section (strict decoding), so set it only after every replica runs this change.

Validation

Step Command / action Expected Result
unit go test -count=1 ./internal/config/... ./internal/auth/token/... ok ok, ok
local make test-local ok exit 0
vet go vet ./... clean exit 0

A new top-level agentTokens section, off by default: enabled, and a
list of services with name, audience, scope (default openid email) and
minTokenScope (default read-write). With the switch on, load fails
naming the key when auth.oidc or its client secret file is missing,
when no service is listed, when a service's name is empty or repeated,
or its audience is empty. minTokenScope must be read, propose or
read-write, checked whether or not the switch is on. No message prints
a value.

token.Scope.AtLeast orders scopes read < propose < read-write < admin
and is false when either side is unknown.

Nothing reads the section yet. The contracts file gains the AtLeast
entry and the plan records the slice's evidence.

This branch has not been deployed

No deployments
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