feat(web-arm): per-site Keycloak clients for TYPO3 SSO #295
No reviewers
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos!295
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "lab/20260807-2348"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
One OIDC client per TYPO3 domain, with the per-site boilerplate generated from the domain and a script that does the rest.
Why not one shared client
A single client across all domains does work —
redirectUrisis just a list and Keycloak only checks the incoming URI against it. It was rejected because:audas every otherWhat changed
typo3-sites.nixholds the domains. Everything else is derived from the domain — client id, redirect URIs, vault key, sops key — so the module is the only place that knows the naming convention:cloonar-realm.jsonis now read into Nix and merged with the generated clients rather than passed tokeycloak-config-clidirectly. The hand-maintained one-off clients are untouched; onlyclientsgains entries. Key order changes (builtins.toJSONsorts), which shifts the import checksum and causes one extra converge on first deploy.vaultSecretsreplaces the parallelplainClientslist plus per-clientLoadCredentialmapping: credential name and vault key are now the same string, somaterialiseSecretsloops over one set of names. Existing credential names change (gitea-secrettogiteasecret); both sides move together and the names are unit-internal.Access control reuses the existing browser-flow overrides rather than inventing anything:
policy = "admin-only"admits Administrators,"internal"also admits Mitarbeiter and macher.solutions. The default is the narrower one — a too-narrow default fails loudly at the login screen and is a one-word fix, a too-wide one silently grants CMS backend access.scripts/add-typo3-sso
Runs on the workstation against the checkout; nothing touches web-arm. Generates a 32-byte secret, writes it into
hosts/web-arm/secrets.yamlwithsops set, appends the domain to the list, and prints theAdditionalConfiguration.phpblock for EXT:oauth2_client with the real client id, secret and endpoints.--showreprints an existing site's block,--dry-runwrites nothing.The secret is written before the Nix entry: an unreferenced secret is harmless, a referenced missing one fails the host build.
The vault key stays alphanumeric (
typo3gbvaktuellatsecret) rather than keeping hyphens, matching the existing underscore-free convention — the file vault's key-to-filename mapping is only known-good for that shape.Verification
sops: domain and policy validation, insertion into the Nix list, duplicate rejection, dry-run, and the printed config blockscripts/test-configuration web-armcould not be executed and the commit used--no-verify. Please run it before merging.The endpoint URLs in the printed block deliberately omit the
/authprefix that upstream's docs still show; that path was dropped with the Quarkus distribution and this deployment serves the realm at/realms/cloonar/.Not included
Delivering the secret into each TYPO3 installation is still manual — this repo doesn't manage TYPO3 application config. A later change could have Nix drop an
oidc.envinto each site'sshared/directory forAdditionalConfiguration.phpto read, which would close the loop for sites on web-arm and amzebs-01 alike.Closes #294
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.