diff --git a/api/specs.md b/api/specs.md index ad8f6f145..a86ea2790 100644 --- a/api/specs.md +++ b/api/specs.md @@ -352,7 +352,7 @@ trust assumptions, rotation behavior and surfaces outside this protocol. - **Validation:** the pure auth validator (`validateAuth`) checks shape only; on save, `configHandler.checkAuthRoles` checks each rule role and each `defaultRole` other than `""` and `deny` (providers and `helmOverride`) against the `roles` table (`db.RoleExists`) and refuses an unknown one with 400 `server.config.auth_role_unknown` (arg `role`). Helm values are not checked at install, so a missing role is caught at sign-in. - **Decision table** (`applySignIn`, `api/internal/auth/oidc.go`): the callback decides the role first, then loads the linked user and its `role_source`, then applies: new user → create with `sso` (refused on deny or missing role, no user created); `sso`/`sso_pending` → apply the role (last-manager guard unchanged; `sso_pending` becomes `sso`), refused on deny or missing role with role and source unchanged; `manual` → always admitted with the stored role; role and source are not written. A missing role is never skipped in favour of a later rule. Deny is checked after the user lookup so hand-set users are not refused by a fallback of `deny`. - **Role source column:** `users.role_source TEXT NOT NULL DEFAULT 'manual'` (`api/internal/db/migrations/common/022_user_role_source.sql`), values `sso`, `sso_pending`, `manual`. The migration sets `sso` for every user with an `oidc_links` row. `PATCH /users/{id}` with any role sets `manual`, even when the value is unchanged. `PATCH /users/{id}` with `roleSource: "sso"` sets `sso_pending` and leaves the role alone (400 `server.users.role_source_invalid`, `_with_role`, `_not_sso` for bad input). `userDTO.roleSource` is always present. -- **Audit:** one event per SSO sign-in with mapping on that changes, keeps or refuses a role (`emitRoleDecisionAudit`; a result equal to the stored role writes none, except `sso_pending` → `sso`), reason `oidc role decision: provider=… rule=… group=… role=… source=… result=…`; results `applied`, `unchanged`, `kept_manual`, `admitted_manual`, `guard_last_manager`, `refused_deny`, `refused_missing_role`. Refusals are status 403. Contract: `specs/034-sso-group-role-rules/contracts/audit-events.md`. +- **Audit:** one event per SSO sign-in with mapping on that changes, keeps or refuses a role (`emitRoleDecisionAudit`; a result equal to the stored role writes none, except `sso_pending` → `sso`), reason `oidc role decision: provider=… rule=… group=… role=… source=… result=…`; results `applied`, `unchanged`, `kept_manual`, `admitted_manual`, `guard_last_manager`, `refused_deny`, `refused_missing_role`. Refusals are status 403. Contract: `specs/done_034-sso-group-role-rules/contracts/audit-events.md`. - **Refusal response:** the generic 403 used for every refused SSO sign-in; the body names no group, rule or role. - **Role deletion guard:** `DELETE /roles/{name}` returns 409 `server.roles.in_use_by_sso` (with `provider`, or `helm`) while a provider's `roleRules` or `defaultRole`, or the Helm override or Helm policy, uses the role. - **Helm override:** `helmOverride.roleRules` replaces the whole Helm rule list; `helmOverride.defaultRole` replaces the Helm fallback; the dashboard's "Reset to Helm default" saves the auth section without `helmOverride`, which removes both and any old `roleMappings` override (`DELETE /admin/config/auth/role-mappings/{role}` still removes one old-form role key only). `GET /admin/config` `installTimeSettings.oidcHelmProvider.roleRules` is the effective Helm seed. diff --git a/specs/034-sso-group-role-rules/OPEN-DECISIONS.md b/specs/done_034-sso-group-role-rules/OPEN-DECISIONS.md similarity index 100% rename from specs/034-sso-group-role-rules/OPEN-DECISIONS.md rename to specs/done_034-sso-group-role-rules/OPEN-DECISIONS.md diff --git a/specs/034-sso-group-role-rules/T002-test-signoff.md b/specs/done_034-sso-group-role-rules/T002-test-signoff.md similarity index 100% rename from specs/034-sso-group-role-rules/T002-test-signoff.md rename to specs/done_034-sso-group-role-rules/T002-test-signoff.md diff --git a/specs/034-sso-group-role-rules/T024-dashboard-test-signoff.md b/specs/done_034-sso-group-role-rules/T024-dashboard-test-signoff.md similarity index 100% rename from specs/034-sso-group-role-rules/T024-dashboard-test-signoff.md rename to specs/done_034-sso-group-role-rules/T024-dashboard-test-signoff.md diff --git a/specs/034-sso-group-role-rules/checklists/requirements.md b/specs/done_034-sso-group-role-rules/checklists/requirements.md similarity index 100% rename from specs/034-sso-group-role-rules/checklists/requirements.md rename to specs/done_034-sso-group-role-rules/checklists/requirements.md diff --git a/specs/034-sso-group-role-rules/contracts/audit-events.md b/specs/done_034-sso-group-role-rules/contracts/audit-events.md similarity index 100% rename from specs/034-sso-group-role-rules/contracts/audit-events.md rename to specs/done_034-sso-group-role-rules/contracts/audit-events.md diff --git a/specs/034-sso-group-role-rules/contracts/auth-config.md b/specs/done_034-sso-group-role-rules/contracts/auth-config.md similarity index 100% rename from specs/034-sso-group-role-rules/contracts/auth-config.md rename to specs/done_034-sso-group-role-rules/contracts/auth-config.md diff --git a/specs/034-sso-group-role-rules/contracts/users-api.md b/specs/done_034-sso-group-role-rules/contracts/users-api.md similarity index 100% rename from specs/034-sso-group-role-rules/contracts/users-api.md rename to specs/done_034-sso-group-role-rules/contracts/users-api.md diff --git a/specs/034-sso-group-role-rules/data-model.md b/specs/done_034-sso-group-role-rules/data-model.md similarity index 100% rename from specs/034-sso-group-role-rules/data-model.md rename to specs/done_034-sso-group-role-rules/data-model.md diff --git a/specs/034-sso-group-role-rules/plan.md b/specs/done_034-sso-group-role-rules/plan.md similarity index 98% rename from specs/034-sso-group-role-rules/plan.md rename to specs/done_034-sso-group-role-rules/plan.md index 1e3af1279..875cd6207 100644 --- a/specs/034-sso-group-role-rules/plan.md +++ b/specs/done_034-sso-group-role-rules/plan.md @@ -2,7 +2,7 @@ **Branch**: `feat/034-sso-group-role-rules` | **Date**: 2026-11-12 | **Spec**: [spec.md](spec.md) -**Input**: Feature specification from `/specs/034-sso-group-role-rules/spec.md` +**Input**: Feature specification from `/specs/done_034-sso-group-role-rules/spec.md` ## Summary @@ -55,7 +55,7 @@ Pencil first), docs and E2E. No CRD, operator or agent change. Decisions are in ### Documentation (this feature) ```text -specs/034-sso-group-role-rules/ +specs/done_034-sso-group-role-rules/ ├── spec.md # what and why (settled) ├── OPEN-DECISIONS.md # OD-1..OD-7, all settled 2026-11-11 ├── plan.md # this file diff --git a/specs/034-sso-group-role-rules/quickstart.md b/specs/done_034-sso-group-role-rules/quickstart.md similarity index 100% rename from specs/034-sso-group-role-rules/quickstart.md rename to specs/done_034-sso-group-role-rules/quickstart.md diff --git a/specs/034-sso-group-role-rules/research.md b/specs/done_034-sso-group-role-rules/research.md similarity index 100% rename from specs/034-sso-group-role-rules/research.md rename to specs/done_034-sso-group-role-rules/research.md diff --git a/specs/034-sso-group-role-rules/spec.md b/specs/done_034-sso-group-role-rules/spec.md similarity index 100% rename from specs/034-sso-group-role-rules/spec.md rename to specs/done_034-sso-group-role-rules/spec.md diff --git a/specs/034-sso-group-role-rules/tasks.md b/specs/done_034-sso-group-role-rules/tasks.md similarity index 97% rename from specs/034-sso-group-role-rules/tasks.md rename to specs/done_034-sso-group-role-rules/tasks.md index 7b1dfe074..ea2ffb8e2 100644 --- a/specs/034-sso-group-role-rules/tasks.md +++ b/specs/done_034-sso-group-role-rules/tasks.md @@ -1,6 +1,6 @@ # Tasks: Map SSO groups to any role, and keep roles set by hand -**Input**: Design documents from `/specs/034-sso-group-role-rules/` +**Input**: Design documents from `/specs/done_034-sso-group-role-rules/` **Prerequisites**: plan.md, spec.md, research.md, data-model.md, contracts/, quickstart.md (all merged: spec in #929, plan/research/quickstart in #950). @@ -157,9 +157,9 @@ per batch. - [X] T050 [P] Update `api/specs.md` (auth: rules, role source, sign-in table, new refusals) and `web/specs.md` (rule editor, role-source badge) in the same PR (Principle IV). - [X] T051 (Written as `changelog/unreleased/1040-sso-group-role-rules.md`, the per-PR changelog convention valgul accepted on 2026-11-11.) [P] Add a `CHANGELOG.md` entry: custom-role mapping, hand-set roles kept, new Helm `api.oidc.roleRules`, and that old keys still work. - [X] T052 Browser smoke test of Admin Settings and Users against the T003 screenshots (CLAUDE.md core rule 13, sonnet), in parallel with the diff review. -- [ ] T053 Open a `GameplanePanel/website` PR updating `src/content/docs/users-auth-rbac.mdx`, `helm-values-reference.mdx` and `user-administration.mdx`; after it merges, bump the `website` submodule pointer in the main repo. -- [ ] T054 Push, open the PR with `type: feature` and `area: api`, `area: web`, `area: chart`, `area: e2e` labels, and drive CI green with every review comment fixed. Run the quickstart.md scenarios through the E2E and envtest results, not locally. -- [ ] T055 After merge, archive with `git mv specs/034-sso-group-role-rules specs/done_034-sso-group-role-rules` and update references (the `spec-archive` skill). +- [X] T053 Open a `GameplanePanel/website` PR updating `src/content/docs/users-auth-rbac.mdx`, `helm-values-reference.mdx` and `user-administration.mdx`; after it merges, bump the `website` submodule pointer in the main repo. (Done: website #35, pointer bump 96676a6.) +- [X] T054 Push, open the PR with `type: feature` and `area: api`, `area: web`, `area: chart`, `area: e2e` labels, and drive CI green with every review comment fixed. Run the quickstart.md scenarios through the E2E and envtest results, not locally. (Done: #1040 merged.) +- [X] T055 After merge, archive with `git mv specs/034-sso-group-role-rules specs/done_034-sso-group-role-rules` and update references (the `spec-archive` skill). (Done: this archive commit.) --- diff --git a/website b/website index a385910d0..96676a697 160000 --- a/website +++ b/website @@ -1 +1 @@ -Subproject commit a385910d048c5075af3fe5e2bcac1509865ab57c +Subproject commit 96676a697f0d655e7dfeba17b3da3314a8fa9ce8