From a68622549e4ece32eaa708e61bad0de4990581da Mon Sep 17 00:00:00 2001 From: Chuck McAndrew <6248903+dcmcand@users.noreply.github.com> Date: Tue, 1 Dec 2026 16:37:16 +0100 Subject: [PATCH] docs: upgrade note for offline_access in sign-in The sign-in admin page now says, before the refusal ships, how to take offline_access out of auth.oidc.scopes and keep it an optional (not default) scope of Tapas's client. It quotes both warnings, by event name and text, so admins can find them in their logs. The contracts entry names this migration step, and its Consumers line says the docs now mention offline_access only in that note. The plan records the slice's evidence. --- docs/architecture/contracts.md | 4 ++-- .../2026-12-01-agent-tokens-and-frames.md | 6 ++++-- site/src/content/docs/admin/sign-in.mdx | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/docs/architecture/contracts.md b/docs/architecture/contracts.md index 4303c39..9e0c7f3 100644 --- a/docs/architecture/contracts.md +++ b/docs/architecture/contracts.md @@ -27,9 +27,9 @@ What each promoted component contract promises today, in the code as it is now. **Since:** 2026-11-30 (spec: docs/superpowers/specs/2026-11-30-agent-token-broker-design.md) ### Platform config `auth.oidc.scopes`, and the sign-in callback's answer to a token response listing `offline_access` -**Owner:** `internal/config`, `internal/features/authoidc` · **Consumers:** installs whose config sets `auth.oidc.scopes`; none lists `offline_access` in this repo, its chart, its dev stack or its docs (verified: `grep -rn -i 'offline_access' --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=superpowers .`) +**Owner:** `internal/config`, `internal/features/authoidc` · **Consumers:** installs whose config sets `auth.oidc.scopes`; none sets it in this repo, its chart or its dev stack; the docs mention it only in the upgrade note (`site/src/content/docs/admin/sign-in.mdx`) (verified: `grep -rn -i 'offline_access' --exclude-dir=node_modules --exclude-dir=.git --exclude-dir=superpowers deploy site/src internal --include='*.yaml' --include='*.json' --include='*.md' --include='*.mdx'`, whose only hits are that note) **Promises:** `auth.oidc.scopes` is an optional list (`config.OIDC.Scopes`). With none, sign-in asks for `profile` and `email`; `openid` is added when missing (`authoidc.Provider.oauth`). Any listed scope, `offline_access` included, is passed on, and the old form still loads and signs in, but warns: at load, `config.deprecated_scope` with `key=auth.oidc.scopes` when any list item, or any space-separated word within an item, equals `offline_access`; in the callback, `auth.offline_access_in_sign_in` when the token response's `scope` lists it (`authoidc.scopeLists`). Neither warning carries a token or a response body. -**Planned change:** `offline_access` in `auth.oidc.scopes` is refused at config load, and the callback without `k` (a normal sign-in) refuses a token response that lists it, lands in a later slice (breaking; the compatibility warning is in place now). +**Planned change:** `offline_access` in `auth.oidc.scopes` is refused at config load, and the callback without `k` (a normal sign-in) refuses a token response that lists it, lands in a later slice (breaking; the compatibility warning is in place now). Migration step: the upgrade note in `site/src/content/docs/admin/sign-in.mdx` ("Upgrading: take `offline_access` out of sign-in"). **Since:** 2026-11-30 (spec: docs/superpowers/specs/2026-11-30-agent-token-broker-design.md) ### `authn.sessionOnlyRoutes` gains the agent-access paths diff --git a/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md b/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md index 9e861cf..d0bde1b 100644 --- a/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md +++ b/docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md @@ -66,7 +66,7 @@ Copied from both specs. The broker spec's items keep their numbers 1-11. The Fra |---|---|---|---|---|---| | 1 | Keycloak checks on the test cluster | tapas | #39 | - | none (rationale: check-only; confirms the realm can do what the design assumes before code is written) | | 2 | Architecture registries | tapas | #41 | Slice 1 | none (rationale: docs scaffolding of promoted patterns and contracts) | -| 3 | Warn about offline_access in sign-in (expand) | tapas | tapas#A3 | Slice 2 | none (rationale: compat step of a breaking contract; operators see the warning before the refusal ships) | +| 3 | Warn about offline_access in sign-in (expand) | tapas | #42 | Slice 2 | none (rationale: compat step of a breaking contract; operators see the warning before the refusal ships) | | 4 | Upgrade notes for offline_access (migrate) | tapas | tapas#A4 | Slice 3 | none (rationale: docs that move installs off the old form) | | 5 | agentTokens config and scope order | tapas | tapas#A5 | Slice 4 | 9, 10 | | 6 | Offline token tables and the per-person lock | tapas | tapas#A6 | Slice 5 | 4, 11 | @@ -175,7 +175,7 @@ Merge order: the spec branch `docs/frames-and-agent-token-broker-specs` (its PR ## Slice 3: Warn about offline_access in sign-in (expand) **Goal:** 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. **Repos / branches:** tapas: `slice/agent-tokens-03-offline-access-warn` (base: `slice/agent-tokens-02-registries`) -**PRs:** tapas#A3 "Warn when a sign-in asks for or gets offline_access" +**PRs:** #42 "Warn when a sign-in asks for or gets offline_access" **Depends on:** Slice 2 **Contracts touched:** Platform config `auth.oidc.scopes`, and the sign-in callback's answer to a token response listing `offline_access` (expand) **Docs updated:** `docs/architecture/contracts.md` (Platform config `auth.oidc.scopes`, and the sign-in callback's answer to a token response listing `offline_access`: deprecated form and the warning) @@ -223,6 +223,8 @@ Merge order: the spec branch `docs/frames-and-agent-token-broker-specs` (its PR | cluster | the test cluster's Tapas config and Slice 1's C8 | no `offline_access` in `auth.oidc.scopes`; normal sign-in does not list it | | docs | `make docs` | builds | +**Evidence (2026-12-01, working tree on ba7ac1b):** repo grep: hits only in `site/src/content/docs/admin/sign-in.mdx` (the upgrade note, 7 lines). Cluster: int-hub-test's `auth.oidc.scopes` is `[profile, email]`; Slice 1's C8 shows a normal sign-in's `scope` without `offline_access`, and `offline_access` is an optional client scope of `javo-javo`. Docs: `make docs` not run (local Node v22.23.1 is below Astro's >=22.23.4); CI's Docs build is the check. Task review: one fix round (the contracts Consumers line), then approved. Open: the note's Keycloak console path is checked during Slice 25's docs walk-through. + ### Task 4: Write the upgrade note **Rating:** routine diff --git a/site/src/content/docs/admin/sign-in.mdx b/site/src/content/docs/admin/sign-in.mdx index 818242e..5988c87 100644 --- a/site/src/content/docs/admin/sign-in.mdx +++ b/site/src/content/docs/admin/sign-in.mdx @@ -88,6 +88,25 @@ https:///auth/oidc/callback +### Upgrading: take `offline_access` out of sign-in + +A later release refuses `offline_access` at sign-in. Today it still works, but Tapas logs a warning in two places. Search your logs for these event names: + +- `config.deprecated_scope` with `key=auth.oidc.scopes` and `detail="offline_access will be refused in a later release"`, at startup, when `auth.oidc.scopes` lists `offline_access` (as an item, or as a word inside an item). +- `auth.offline_access_in_sign_in` with `detail="the token response lists offline_access, which a later release will refuse: take it out of auth.oidc.scopes and keep it an optional scope of the client"`, at sign-in, when the provider's token response lists `offline_access`. This also happens when the realm makes it a default scope of Tapas's client, even if `auth.oidc.scopes` does not list it. + +To get ready: + + + +1. Remove `offline_access` from `config.auth.oidc.scopes`. The default, `profile` and `email`, is enough; `openid` is always added. +2. In the Keycloak console, open your realm, then **Clients**, then Tapas's client (for example `javo`), then **Client scopes**. Check that `offline_access` is listed as **Optional**, not **Default**. If it is **Default**, change its assigned type to **Optional**. Keep it available as an optional scope: it is not removed from the client. +3. Restart Tapas, sign in, and check that neither warning is logged. + + + +A later release refuses both: a config that lists `offline_access` in `auth.oidc.scopes` fails to load, and a sign-in whose token response lists it is refused. + ## Roles Roles come from groups, from the provider's groups claim or from a local account's `--group`: