Skip to content

docs(server): document OIDC fail-fast on undecryptable providers (#98)#107

Merged
bigpuritz merged 1 commit into
mainfrom
feature/98_oidc-fail-fast-undecryptable
May 13, 2026
Merged

docs(server): document OIDC fail-fast on undecryptable providers (#98)#107
bigpuritz merged 1 commit into
mainfrom
feature/98_oidc-fail-fast-undecryptable

Conversation

@bigpuritz
Copy link
Copy Markdown
Contributor

Closes #98.

Plugwerk 1.0.0 added PLUGWERK_AUTH_OIDC_FAIL_FAST_ON_UNDECRYPTABLE_PROVIDERS (default false) as a production safety net for OIDC encryption-key mismatches. The 1.0.0 release notes (PR #105) call out that the feature exists; this PR is the operator-facing reference for it.

Files changed

File What
server/configuration.mdx 1 new env-var row + new dedicated "OIDC encryption-key safety" section
server/oidc-providers.mdx Best-practices bullet + Troubleshooting entry, both pointing at the configuration section

What the new section covers

  • Context — when the failure happens (key rotation without re-encrypt, deployment-env switch, DB restore, fresh import with stale secrets).
  • Default behaviour (false) — boot anyway, log + skip; with the actual Cannot decrypt OIDC provider … ERROR-line wording so operators can grep for it.
  • Fail-fast (true) — boot refused, every affected registrationId listed in one shot; with the actual Refusing to start: … boot-failure wording.
  • Production recommendation as :::tip — fail-fast in prod (a half-broken login surface is worse than a Kubernetes restart loop), default in dev (one broken provider should not block iteration on others).

Source verification

All env-var name, default, and on-the-wire log/error string copy verified against v1.0.0 source:

  • plugwerk-server/.../security/DbClientRegistrationRepository.kt — flag plumbing, boot-failure message
  • plugwerk-server/.../config/CryptoDiagnostics.ktencryptionKeyMismatchMessage helper that builds the ERROR line

Source files read for accuracy, not cited in the docs (per the AGENTS.md no-internal-link rule). Internal-link grep returns 0 hits in the new content.

Note on the issue body

The issue says "covers the #479 leftover from closed issue #88". That predecessor was actually fully delivered by PR #93 — all three #479 SSRF properties (ALLOW_PRIVATE_DISCOVERY_URIS, BLOCKED_HOST_NAMES, BLOCKED_HOST_SUFFIXES) are documented today, with their own dedicated #oidc-ssrf-guard section. This PR is purely additive — adds the fourth PLUGWERK_AUTH_OIDC_* property and a sibling #oidc-encryption-key-safety section right next to it.

Acceptance criteria from #98

  • PLUGWERK_AUTH_OIDC_FAIL_FAST_ON_UNDECRYPTABLE_PROVIDERS listed in the environment-variables reference.
  • All four PLUGWERK_AUTH_OIDC_* properties documented together (the three SSRF ones were already in main from PR docs(server): document the OIDC SSRF guard env vars (#88) #93; this PR adds the fail-fast one to the same table block).
  • Production-deployment / security guidance explains the trade-off and recommends the production setting (:::tip block in the new section + best-practices bullet in oidc-providers).
  • Troubleshooting page links the Sign-in 4xx symptom to the Cannot decrypt … PLUGWERK_AUTH_ENCRYPTION_KEY log line.

Test plan

  • npm run format clean
  • npm run format:check clean
  • npm run build clean (32 pages, no drift)
  • AGENTS.md ADR/internal-PR grep clean in the new content
  • Anchor #oidc-encryption-key-safety rendered on /server/configuration/
  • Both cross-links from /server/oidc-providers/ resolve to that anchor
  • Anchor #sign-in-with-provider-returns-4xx-but-the-server-is-healthy rendered on /server/oidc-providers/
  • Reviewer: open /server/configuration/#oidc-encryption-key-safety, verify the :::tip block renders, the two log-line code blocks read clearly, and the cross-link to /server/oidc-providers/#sign-in-with-provider-returns-4xx-but-the-server-is-healthy lands on the new troubleshooting entry

Plugwerk 1.0.0 added a fourth PLUGWERK_AUTH_OIDC_* env var as a
production safety net for OIDC encryption-key mismatches:

  PLUGWERK_AUTH_OIDC_FAIL_FAST_ON_UNDECRYPTABLE_PROVIDERS  (default false)

Default behaviour is unchanged — the server boots, affected providers
are logged at ERROR and skipped, others continue working. With the
flag set to true, the server refuses to start and lists every
affected registrationId, surfacing the misconfiguration in the
deployment pipeline rather than at the user's login button.

server/configuration.mdx:

- One new row in the Optional Environment Variables table, pointing
  at the new section anchor #oidc-encryption-key-safety.
- New "OIDC encryption-key safety" section between the existing
  "OIDC SSRF guard" section and "Health Checks":
    * Context (when the failure happens, why).
    * Default behaviour with the actual log-line wording from
      DbClientRegistrationRepository / encryptionKeyMismatchMessage.
    * Fail-fast behaviour with the actual boot-error wording.
    * `:::tip` recommending true for production / false for dev.
    * Cross-links to the operator-facing fix path in oidc-providers.

server/oidc-providers.mdx:

- Security and best practices: new bullet recommending fail-fast in
  production, with the trade-off explanation, pointing at the
  configuration section.
- Troubleshooting: new entry "Sign in with <provider> returns 4xx
  but the server is healthy" with the structured ERROR log line,
  the two operator fixes (re-enter secret in admin UI / restore
  previous encryption key), and a pointer at the fail-fast flag.

All wording is lifted from the actual sources at v1.0.0:
  - DbClientRegistrationRepository.kt (boot-failure message + flag
    plumbing)
  - CryptoDiagnostics.kt (encryptionKeyMismatchMessage helper)

Read for accuracy, not cited (per AGENTS.md no-internal-link rule).

Closes #98
@bigpuritz bigpuritz added this to the 1.0.0 milestone May 13, 2026
@bigpuritz bigpuritz added documentation Improvements or additions to documentation enhancement New feature or request labels May 13, 2026
@bigpuritz bigpuritz merged commit 989c51d into main May 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: document PLUGWERK_AUTH_OIDC_FAIL_FAST_ON_UNDECRYPTABLE_PROVIDERS env var

1 participant