Skip to content

Warn when a sign-in asks for or gets offline_access - #42

Open
dcmcand wants to merge 1 commit into
slice/agent-tokens-02-registriesfrom
slice/agent-tokens-03-offline-access-warn
Open

dcmcand wants to merge 1 commit into
slice/agent-tokens-02-registriesfrom
slice/agent-tokens-03-offline-access-warn

Conversation

@dcmcand

@dcmcand dcmcand commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Slice 3: Warn about offline_access in sign-in (expand)

An install whose auth.oidc.scopes, or whose realm, puts offline_access on a normal sign-in still signs in, and the operator sees a warning naming the setting that will be refused.

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 3)
Contracts touched: Platform config auth.oidc.scopes, and the sign-in callback's answer to a token response listing offline_access (expand)
Depends on: #41

Two warnings, no refusals yet:

  • At config load: config.deprecated_scope with key=auth.oidc.scopes when an item of auth.oidc.scopes, or a word inside one, is offline_access. oauth2 joins the items with spaces into the request's scope, so a word inside an item reaches Keycloak too.
  • In the sign-in callback: auth.offline_access_in_sign_in when the token response's scope lists offline_access (read as a whitespace-separated set), logged after the ID token checks and just before the session is made.

Neither carries a token or a response body. Slice 12 turns both into refusals.

Validation

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

A config whose auth.oidc.scopes lists offline_access, as an item or as a
word inside one, now logs config.deprecated_scope with
key=auth.oidc.scopes at load. A sign-in whose token response lists
offline_access in its scope logs auth.offline_access_in_sign_in just
before the session is made. Both still load and sign in: this is the
expand step, and a later release refuses both. Neither warning carries
a token or a response body.

scopeLists reads a scope string as a whitespace-separated set; the
later refusal and the offline collection reuse it. The fake provider
can now script the scope it answers with, and its no-token log checks
cover access tokens too.

The contracts entry describes the warnings, and the plan records the
slice's evidence, its checkpoint review and four approved deviations.

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