Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/architecture/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions docs/superpowers/plans/2026-12-01-agent-tokens-and-frames.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
19 changes: 19 additions & 0 deletions site/src/content/docs/admin/sign-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,25 @@ https://<ui host>/auth/oidc/callback

</Steps>

### 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:

<Steps>

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.

</Steps>

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`:
Expand Down