Skip to content
Merged
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
2 changes: 1 addition & 1 deletion api/specs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down Expand Up @@ -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.)

---

Expand Down