Skip to content

feat(auth): OIDC-only mode with IdP group admin roles - #966

Merged
fclairamb merged 37 commits into
mainfrom
feat/todos-2026-11-21
Nov 21, 2026
Merged

fclairamb merged 37 commits into
mainfrom
feat/todos-2026-11-21

Conversation

@fclairamb

@fclairamb fclairamb commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Closes #942

What changed

  • OIDC-only mode (OIDC-only mode: disable local login, admin-group claim, pre-first-boot setup #942): a new switch auth.local_login.enabled (SP_LOCAL_LOGIN_ENABLED, on by default) turns off password login, register, password reset, change-password, LDAP login, and accepting an invite with a password. Those endpoints then answer 403 LOCAL_LOGIN_DISABLED. Passkeys and SSO still work. The login and security pages hide the password UI, and the super-admin auth settings page has the switch.
  • Lock-out guard: when no SSO provider is enabled, local login stays on and the server logs a warning at boot. The API also refuses to turn local login off.
  • Admin roles from IdP groups: auth.oidc.groups_claim, auth.oidc.super_admin_groups and auth.oidc.org_admin_groups give super admin and org admin to members of those IdP groups.
    • A role granted this way is removed when the user leaves the group. Roles set by hand are never touched, and the last admin is always kept.
    • Where a role came from is stored in two new columns, users.super_admin_source and organization_members.role_source, in the unreleased 039 migration.
    • Each change is audited (auth.super_admin_changed) and returned as roleChanges on /auth/handoff/exchange.
  • OIDC-only first boot: no admin with a password is created and the default org starts empty. The first member of a super-admin group becomes its owner.
  • Break-glass access: restart with SP_LOCAL_LOGIN_ENABLED=true and SP_ADMIN_PASSWORD to get a super admin back.
  • Docs: an authentication guide (docker-compose example, break-glass steps), a new wiki/features/sso.md, the errors, auth and DB-model wiki pages, and OpenAPI.
  • Merged main (with fix: email validation, OAuth error display, translator crash guard, clone slugs, watchdog pauses #959). The 039 migration keeps both sections; handleInvitationError keeps both the local-login-disabled and invalid-email cases.

Decided by autopilot

  • oidc-only-mode, Q1 (local login off but no working SSO provider): keep local login on at boot with a warning, and have the API refuse the switch.
  • oidc-only-mode, Q2 (does the switch cover LDAP?): yes. auth.ldap.enabled stays the way to run LDAP-only.
  • oidc-only-mode, Q3 (where to record the claim-granted super admin): a nullable users.super_admin_source column. The org-admin role gets the same treatment with organization_members.role_source.
  • oidc-only-mode, Q4 (break-glass access): SP_LOCAL_LOGIN_ENABLED=true + SP_ADMIN_PASSWORD at restart, documented, with no hidden back door.

🤖 Generated with Claude Code

fclairamb and others added 20 commits November 20, 2026 12:14
…nnot parse (fclairamb/solidping-business#95)

A sign-up with a malformed address (double dot, space, double @) got 200
"check your inbox" while enqueueEmail (service.go, email.ValidAddress) dropped
the confirmation mail. Service.Register only matched the address against
registration_email_pattern. Register and CreateInvitation now trim the address
and require a single plain parseable one (plainSendableAddress, email_change.go)
before anything is stored, answering 422 VALIDATION_ERROR on the email field.
A link-only invitation (no address) still works. Tests in handler_test.go fail
before the fix (200 and a stored pending entry).

Closes fclairamb/solidping-business#95

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… nested in returnTo (fclairamb/solidping-business#99)

A provider sign-in refused server-side (e.g. no verified email) showed no
error: redirectOAuthError (join_policy.go) appends error/error_description to
the post-login destination, which needs a session, so the guard bounced to the
login page with the error nested in returnTo, while the login page only read
its own error_description (orgs/$org/login.tsx validateSearch). The login page
now lifts the error out of returnTo (oauthErrorFromReturnTo) and drops it from
the retry destination. Vitest and e2e login.spec.ts guard it; the e2e test
fails on the previous build (no login-error banner).

Closes fclairamb/solidping-business#99

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…fclairamb/solidping-business#98)

With Chrome auto-translating the dashboard into a language the app does not
ship, nearly every navigation crashed into the route error boundary
(NotFoundError on insertBefore/removeChild): the translator moves React-owned
text nodes into <font> wrappers, and the <html lang> fix in i18n.ts only stops
the offer for shipped languages. main.tsx now installs, before React mounts, a
guard (lib/translator-dom-guard.ts) that turns those two calls into a logged
no-op when the node is no longer a child, so translation stays available.
translator-dom-guard.test.ts fails without the guard (both calls throw).

Closes fclairamb/solidping-business#98

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds the clone-of-a-clone numbering test (-copy, -copy-2, -copy-3); the
check-clone-slug E2E passes against a fresh database; the react-hooks
set-state-in-effect errors in check-form.tsx are pre-existing at BASE.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…/solidping-business#97)

When the abandon timer fires, the watchdog keeps listening on the outcome
channel for 250 ms: a checker that honoured its context but needed a few
ms to unwind after a process pause returns a normal timeout result.

An abandonment whose timer fired more than twice past its budget
(execTimeout + grace) is classified reason=process_paused and logged at
WARN; ignored_context stays for a real hang. Both abandon lines now carry
elapsed and exec_timeout.

New metric reason value: solidping_check_runner_abandoned_total{reason="process_paused"}.

Closes fclairamb/solidping-business#97

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#960)

The Docker install page only showed a TCP SP_DB_URL; socket users had no example
since the fix of #939 (the reference page had one, docker.md did not). It now
shows a docker run with the mounted socket directory, the `&port=5433` note and
why a percent-encoded host fails. dsn_docs_test.go checks that both pages show a
socket DSN that DriverDSN turns into a socket file; it failed before this change.

Closes #960

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Converted from issue #958: no provider repo exists yet, sp apply only
manages checks. Needs a new repo, migrations and new apply endpoints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Adds slug/managed_by columns (migration 039), the multi-kind apply
orchestrator, POST /orgs/:org/apply and GET /orgs/:org/export, and
`sp checks export --all-kinds`.

Refs #958

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…d widen sp apply past checks (Part B)

Part A (provider repo) is tracked in #965 and not implemented here.
Refs #958

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…stgres Unix-socket docs (#964)

Stacked on #959: merge it first.

Closes #960
Closes #958

## What changed

- **Docs: PostgreSQL over its Unix socket** (#960): a subsection on the
Docker install page (mounted socket, working `SP_DB_URL`, `&port=5433`
for a non-default port, why percent-encoded hosts fail), linking to the
configuration reference. A test checks both pages carry a socket DSN the
driver resolves to a socket path.
- **`sp apply` beyond checks** (#958, Part B): a manifest can now hold
`channels`, `maintenanceWindows` and `statusPages` next to `checks`,
cross-referencing checks by slug. One orchestrator plans and applies
them in dependency order (checks → channels → windows → pages, prune in
reverse) under a single deletion cap; plan entries carry a `kind`.
- Migration 039 (Postgres + SQLite): optional per-org-unique `slug` on
channels and maintenance windows, `managed_by` on channels, windows and
status pages. Prune only deletes rows owned by the manifest.
- New admin-only routes `POST /orgs/:org/apply` and `GET
/orgs/:org/export`; `POST /checks/apply` keeps working through the
orchestrator.
- CLI: `sp apply` prints a KIND column; `sp checks export --all-kinds`
bootstraps a full manifest from a live org.
  - Docs (config-as-code, CLI) and OpenAPI updated.
- The Terraform/OpenTofu provider itself (Part A) moved to #965: it
needs a new repo, a GPG key and registry accounts.

## Decided by autopilot

- 2026-11-21-01, order of delivery: `sp apply` (Part B) first, provider
next in its own repo (#965).
- 2026-11-21-01, who creates and signs the provider release: Florent
(repo, GPG key in gopass, registries), tracked in #965.
- 2026-11-21-01, identity for channels and maintenance windows: new
optional per-org-unique `slug` column.
- Implementation: channel `${env:…}` secrets are resolved at apply time
and stored encrypted like any channel secret (the notification senders
cannot resolve references); rotating one means re-applying. Values are
never printed in the plan.
- Implementation: a slug-less channel (same name and type) or window
(same title) is adopted when exactly one matches, so `export
--all-kinds` then `apply` doesn't create duplicates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
…ly first boot) (#942)

Converted issue #942 to a spec: touches authorization scope (claim-granted
super admin), new system parameters, the startup seeding job and the login UI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@fclairamb fclairamb added autopilot frozen Batch PR under review: takes only its own fixes, new work goes to the next batch labels Nov 21, 2026
Base automatically changed from feat/todos-2026-11-20 to main November 21, 2026 07:56
fclairamb and others added 5 commits November 21, 2026 08:58
… password admin)

- auth.local_login.enabled (SP_LOCAL_LOGIN_ENABLED, default true): when
  false, password and LDAP login, register, confirm-registration, password
  reset and password change answer 403 LOCAL_LOGIN_DISABLED. Read per request
  (env > DB > config), fails open with a boot warning while no SSO provider
  is enabled; the system parameter API refuses false in that case.
  GET /auth/providers gains localLogin.
- auth.oidc.groups_claim / super_admin_groups / org_admin_groups: groups from
  the verified ID token (plus userinfo) grant super admin (synced both ways
  for claim grants only, users.super_admin_source = 'oidc', last super admin
  never revoked) and org admin in the login org (grant-only). New audit
  event auth.super_admin_changed.
- OIDC-only first boot: no password admin, default org left empty for the
  first super-admin group member (owner). Break-glass: restart with
  SP_LOCAL_LOGIN_ENABLED=true and SP_ADMIN_PASSWORD.

Closes #942

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ields

The login page hides the email/password form, the forgot-password and
sign-up links when /auth/providers says localLogin is false; the security
page drops the password card. The super-admin auth settings get a local
login switch and the OIDC groups claim / super-admin groups / org-admin
groups fields. New audit event auth.super_admin_changed is labelled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ay in: no local login, admins granted by an IdP group claim, no seeded password admin

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ics, invite refuses passwords while local login is off

- organization_members.role_source (039 unreleased section, Postgres +
  SQLite): the org-admin claim records 'oidc_group' on what it grants and
  demotes it to user at the next login out of the group; never an owner,
  a locally set role, or the last owner/admin. Any role change naming no
  source writes NULL (a local grant).
- roleChanges login diagnostics on POST /auth/handoff/exchange (carried
  by the OIDC callback's handoff code), next to the log line and audit.
- POST /auth/accept-invite answers 403 LOCAL_LOGIN_DISABLED while local
  login is off when it would create or use a password; an SSO-signed-in
  invitee still accepts.
- Tests: 200 when on for register and password reset, accept-invite both
  ways, org admin revoke/last admin/owner, role diagnostics, dialect
  contract for role_source.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fclairamb and others added 5 commits November 21, 2026 09:27
…ay in: no local login, admins granted by an IdP group claim, no seeded password admin

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eat/todos-2026-11-21

# Conflicts:
#	server/internal/db/postgres/migrations/039_v0_53_0.tx.down.sql
#	server/internal/db/postgres/migrations/039_v0_53_0.tx.up.sql
#	server/internal/db/sqlite/migrations/039_v0_53_0.tx.down.sql
#	server/internal/db/sqlite/migrations/039_v0_53_0.tx.up.sql
@fclairamb fclairamb changed the title feat(auth): OIDC-only mode feat(auth): OIDC-only mode with IdP group admin roles Nov 21, 2026
@fclairamb fclairamb added the implemented Every spec of the PR is implemented and its batch gate was green label Nov 21, 2026
# Conflicts:
#	server/internal/db/postgres/migrations/039_v0_53_0.tx.down.sql
#	server/internal/db/postgres/migrations/039_v0_53_0.tx.up.sql
#	server/internal/db/sqlite/migrations/039_v0_53_0.tx.down.sql
#	server/internal/db/sqlite/migrations/039_v0_53_0.tx.up.sql
#	server/internal/handlers/auth/handler.go
@codecov

codecov Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.64000% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.87%. Comparing base (02c6821) to head (18dee28).

Files with missing lines Patch % Lines
server/internal/handlers/auth/oidc_groups.go 90.75% 16 Missing ⚠️
...er/internal/handlers/maintenancewindows/service.go 81.25% 9 Missing ⚠️
server/internal/handlers/checks/bulk_delete.go 92.45% 4 Missing ⚠️
server/internal/handlers/auth/oidc_service.go 86.36% 3 Missing ⚠️
...ternal/jobs/jobtypes/job_startup_admin_password.go 85.00% 3 Missing ⚠️
server/internal/config/sso_providers.go 91.30% 2 Missing ⚠️
server/internal/handlers/auth/handler.go 86.66% 2 Missing ⚠️
server/internal/jobs/jobtypes/job_startup.go 88.88% 2 Missing ⚠️
server/internal/config/config.go 66.66% 1 Missing ⚠️
server/internal/db/postgres/postgres.go 95.00% 1 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #966      +/-   ##
==========================================
+ Coverage   90.85%   90.87%   +0.02%     
==========================================
  Files        1399     1405       +6     
  Lines      144671   145221     +550     
==========================================
+ Hits       131436   131972     +536     
- Misses      13227    13241      +14     
  Partials        8        8              
Files with missing lines Coverage Δ
server/internal/app/server.go 92.20% <100.00%> (+0.01%) ⬆️
server/internal/authhandoff/authhandoff.go 82.02% <ø> (ø)
server/internal/config/oidc_oauth.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/contract.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/identity.go 100.00% <100.00%> (ø)
server/internal/db/dbcontract/maintenance.go 100.00% <100.00%> (ø)
server/internal/db/models/auth.go 100.00% <ø> (ø)
server/internal/db/models/event.go 100.00% <ø> (ø)
server/internal/db/models/maintenance_window.go 93.93% <ø> (ø)
server/internal/db/postgres/dsn.go 100.00% <100.00%> (ø)
... and 25 more

... and 15 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

fclairamb and others added 5 commits November 21, 2026 11:07
…fixes; Postgres host= for the listener (#969)

Stacked on #966: merge it first.

Closes #941
Closes #961
Closes #965
Closes #945

## What changed
- **Bulk delete of checks (#941)**: the checks list gets row checkboxes,
a select-all (loaded rows) and a bulk bar (Delete, Set regions,
Automatic placement, Clear). Delete first shows a dry run listing the
checks it would skip and why, and asks to type the count above 10
checks. New API `DELETE /api/v1/orgs/:org/checks` (`{checkUids,
dryRun}`, up to 1000), with the same guards as a single delete (managed,
internal, read-only, tunnel in use, other org). Tested on SQLite and
Postgres, plus Playwright.
- **Postgres DSN (#961)**: the lib/pq LISTEN notifier now honours the
`host=` socket parameter when the URL also has a host (the pgx pool
already did). Startup logs when the socket overrides the URL host;
documented in the database and docker docs.
- **Terraform provider, Step 1 (#965)**:
`wiki/terraform-provider-api-audit.md` now audits maintenance windows.
Step 2 (the provider repo, release and registries) needs operator setup
and moved to #970.
- **AUR package `solidping-bin` (#945)**: `deploy/aur/` (PKGBUILD from
the per-arch `solidping-linux-*.gz` release assets, systemd unit,
sysusers, `update.sh`, `test.sh`), CI job `aur-package` (tests it in an
Arch container, outside the `ci` gate) and `aur-publish` (on stable
tags, a no-op without the `AUR_SSH_PRIVATE_KEY` secret). Docs in
`wiki/distribution/aur.md`. Publishing needs an AUR account: #971.
- **Maintenance windows, gaps found by that audit**:
- `PATCH /maintenance-windows/:uid` clears `description` /
`recurrenceEnd` on an explicit `null` (an absent key still means
unchanged).
- `PUT /maintenance-windows/:uid/checks` rejects unknown or other-org
check and group uids with a 422 `VALIDATION_ERROR` (before: a 500, or a
cross-tenant link), and dedupes repeated uids.
- Batch gate: fixed `checks-index-host-view` e2e for the new checkbox
column. `TestSilentAgentIsClosedAfterTwoMissedProbes` (agentws) flaked
once under load, unrelated to this batch.

## Decided by autopilot
- #945: added to this frozen batch (two frozen batches open, the newest
takes new work). AUR account and SSH key are operator setup, moved to
#971.
- terraform-provider-repo, Q1 (prerequisites): implement Step 1 (API
audit) here; Step 2 moved to issue #970, assigned to Florent.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
@fclairamb
fclairamb enabled auto-merge (squash) November 21, 2026 19:05
@fclairamb
fclairamb merged commit 1b51f89 into main Nov 21, 2026
39 checks passed
@fclairamb
fclairamb deleted the feat/todos-2026-11-21 branch November 21, 2026 19:22
fclairamb added a commit that referenced this pull request Nov 22, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.53.0](v0.52.0...v0.53.0)
(2026-11-22)


### Features

* **auth:** OIDC-only mode with IdP group admin roles
([#966](#966))
([1b51f89](1b51f89))
* **service:** install writes config.env, unit loads it via
EnvironmentFile
([#948](#948))
([e4b7fc4](e4b7fc4))


### Bug Fixes

* **aggregation:** drain the raw backlog in one run and log lag
([#978](#978))
([26b93cd](26b93cd))
* **deps:** update github.com/dop251/goja digest to 79d6ad3
([#972](#972))
([02c6821](02c6821))
* **deps:** update go dependencies (non-major)
([#955](#955))
([7dfbcd6](7dfbcd6))
* **deps:** update go dependencies (non-major)
([#968](#968))
([6c09bae](6c09bae))
* **deps:** update go dependencies (non-major)
([#979](#979))
([ee088b6](ee088b6))
* **deps:** update module github.com/oapi-codegen/oapi-codegen/v2 to
v2.9.0 ([#975](#975))
([1121e2e](1121e2e))
* **deps:** update module go.mongodb.org/mongo-driver/v2 to v2.10.1
([#950](#950))
([9e684c4](9e684c4))
* email validation, OAuth error display, translator crash guard, clone
slugs, watchdog pauses
([#959](#959))
([a20f951](a20f951))
* log OAuth code-exchange failures, show a refused sign-in on the
invitation page
([#974](#974))
([c4a8dca](c4a8dca))
* retry SMTP 4xx, 503 on agent auth DB errors, scope checkGroupUid to
the org ([#973](#973))
([88179aa](88179aa))
* **security:** block WebRTC around the browser egress proxy, survive an
invalid status page ?lang=
([#957](#957))
([79bdc82](79bdc82))
* **security:** keep OIDC-group admin grants revocable, mask resolved
channel references, contain browser popups
([#976](#976))
([6e0f09e](6e0f09e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge autopilot frozen Batch PR under review: takes only its own fixes, new work goes to the next batch implemented Every spec of the PR is implemented and its batch gate was green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OIDC-only mode: disable local login, admin-group claim, pre-first-boot setup

1 participant