Files
computer-playbook/docs/contributing/design/iam/oidc.md
T
kevinveenbirkenbachandClaude Opus 4.7 7d7301614d docs(changelog): per-release archive CLI + release docs + SPOT cleanup
Add cli/contributing/changelog/archive: a CLI that trims CHANGELOG.md
to the last N entries (default 7) and writes every older release to
its own file under docs/changelog/ named <padded-semver>-<date>.md
(7.0.0 → 007.000.000-2026-05-08.md). The padded form makes a directory
listing already chronological, and the index in CHANGELOG.md is
rebuilt from the archive directory listing on every run, so it never
drifts away from what is on disk. The tool is idempotent and never
overwrites an existing archive file.

Run the migration once to split the 44-entry CHANGELOG.md into 7
inline entries plus 37 archived per-release files, with the index at
the bottom of CHANGELOG.md linking each archive in descending order.

Add docs/contributing/actions/release.md as the contributor-facing
release procedure (versioning, active window vs. archive, cutting a
release end-to-end, CI hand-off on tag push) and add a docs README
under docs/changelog/ that explains the archive directory layout and
filename schema. Cross-link release.md from pipeline.md and add
"releases" to the actions/ scope description.

Documentation cleanup pass on every page touched in the previous
mapping refactor:

- Remove "is the SPOT for X" / "Single Point of Truth" self-labels
  across docs/contributing/, docs/agents/, and docs/changelog/. The
  rule in documentation.md forbids self-declared SPOT status; status
  is conferred by readers cross-linking, not by the page asserting
  it. Rephrase to descriptive phrasing ("This page covers X",
  "describes X", "lists X") throughout.
- Drop the orphaned docs/contributing/tools/actions.md duplicate
  (101 lines paralleling tools/github/actions/workflows.md, with no
  inbound links).
- Fix em-dashes used as thought breaks in dockerfile.md, origin.md,
  agents/style.css.md, and suppression.md per documentation.md.
- Unwrap soft-wrapped sentences in iam/common.md, iam/ldap.md,
  iam/oidc.md, image/origin.md, requirements.md, and dockerfile.md
  so each logical line carries one full sentence.

Add a unit test for the archive CLI under
tests/unit/cli/contributing/changelog/archive/test_main.py covering
_pad_version, _split_into_entries, idempotency, dry-run, no-overwrite
of existing archives, and the multi-run index rebuild.

Quote `# noqa:` in CHANGELOG.md prose with backticks so the
noqa-only-ruff-codes lint does not parse "for" as a non-ruff code.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 16:19:42 +02:00

5.3 KiB

OIDC 🪪

This page describes how application roles consume the platform's OIDC provider, Keycloak. The variable tree lives in 11_oidc.yml under defaults_oidc. For the cross-cutting IAM principles, including the paired identifier rule shared with LDAP, see common.md. For LDAP-side details see ldap.md.

Variable Tree 🌳

The keys consumers care about:

Key Meaning
OIDC.URL Base URL of the Keycloak instance
OIDC.CLIENT.ID Client identifier, defaults to SOFTWARE_DOMAIN
OIDC.CLIENT.SECRET Client secret, MUST come from the inventory
OIDC.CLIENT.REALM Realm the client is registered in
OIDC.CLIENT.ISSUER_URL Issuer URL, equal to discovery issuer
OIDC.CLIENT.DISCOVERY_DOCUMENT .well-known/openid-configuration URL
OIDC.CLIENT.AUTHORIZE_URL Authorization endpoint
OIDC.CLIENT.TOKEN_URL Token endpoint
OIDC.CLIENT.USER_INFO_URL Userinfo endpoint
OIDC.CLIENT.LOGOUT_URL RP-initiated logout endpoint
OIDC.CLIENT.CERTS JWKS endpoint, equal to discovery jwks_uri
OIDC.CLIENT.ACCOUNT.URL User self-service console root
OIDC.CLIENT.ACCOUNT.PROFILE_URL Personal-info section deep link
OIDC.CLIENT.ACCOUNT.SECURITY_URL Login and security section deep link
OIDC.CLIENT.CHANGE_CREDENTIALS Direct link to the credentials editor
OIDC.CLIENT.RESET_CREDENTIALS Public password-reset entry point
OIDC.BUTTON_TEXT Default label for SSO login buttons

When a role needs an OIDC endpoint, it MUST template the corresponding OIDC.CLIENT.* value rather than build the URL from OIDC.URL itself. The URL builders in 11_oidc.yml already handle realm and protocol concerns.

Claim Attributes 🏷️

OIDC.ATTRIBUTES lists the claim names that downstream applications read out of the userinfo response and ID token:

Key Default value Meaning
OIDC.ATTRIBUTES.USERNAME preferred_username Stable user identifier
OIDC.ATTRIBUTES.GIVEN_NAME givenName First name
OIDC.ATTRIBUTES.FAMILY_NAME surname Last name
OIDC.ATTRIBUTES.EMAIL email Email address

Rules:

  • Application roles MUST identify users via OIDC.ATTRIBUTES.USERNAME. They MUST NOT introduce a private claim name (for example user_id, uid, or oauth_uid) when preferred_username already satisfies the requirement.
  • Roles MUST NOT hardcode the literal value preferred_username. Always template {{ OIDC.ATTRIBUTES.USERNAME }}.
  • The standard OIDC sub claim is permitted as an alternative when the application explicitly requires a UUID-shaped identifier and stores its own mapping table. In that case the role MUST document the deviation in its README.
  • The OIDC username claim is paired with the LDAP login attribute by design. See ldap.md for the LDAP-side rule.

Keycloak Client Templates 📦

Keycloak client definitions are imported from clients. The default template in default.json.j2 is shared by every application client.

Rules:

  • The shared default.json.j2 MUST stay generic. App-specific protocol mappers, claims, or scopes MUST NOT be added there because the change affects every other client.
  • An app that needs an extra mapper MUST add it through a per-client scope. See nextcloud.json.j2 for the precedent: a dedicated scope holds the Nextcloud-specific UID and quota mappers and is attached only to the Nextcloud client.
  • New scope files MUST be referenced from the consuming app via its KEYCLOAK_RBAC_GROUP_CLAIM style configuration or via the optionalClientScopes list in the client template.

Consumer Pattern 🧩

A typical OIDC-consuming role wires the values into its environment template, for example env.j2:

OIDC_ISSUER={{ OIDC.CLIENT.ISSUER_URL }}
OIDC_DISCOVERY=true
OIDC_SCOPE=openid,profile,email
OIDC_UID_FIELD={{ OIDC.ATTRIBUTES.USERNAME }}
OIDC_CLIENT_ID={{ OIDC.CLIENT.ID }}
OIDC_CLIENT_SECRET={{ OIDC.CLIENT.SECRET }}

Every application role SHOULD follow the same shape: discovery on, the OIDC.CLIENT.* endpoints templated, the user identifier read from OIDC.ATTRIBUTES.USERNAME, and the scopes limited to what the app actually consumes.

File Purpose
11_oidc.yml OIDC SPOT, defines OIDC.*
web-app-keycloak OIDC provider role
default.json.j2 Shared client template, MUST stay app-agnostic
scopes Per-app client scopes for extra mappers
realm.json.j2 Realm definition, including the preferred_username mapper
ldap.md LDAP-side counterpart, paired user identifier
common.md Cross-cutting IAM principles and integration checklist