hedgedoc: move the scout-hedgedoc OIDC client onto kanidm-operator #19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Follow-up from kanidm-operator WU-8 / homelab #18. Decided 2026-10-19: WU-8 deployed only the smoke client; hedgedoc stays on its
OnePasswordItemuntil this ticket. The fuller notes are in the operator repo,docs/deploying.md§ "Moving a real app onto the operator" anddocs/oauth2-clients.md§ "Adopting an existing Kanidm client".Goal
hedgedoc's Kanidm OIDC client
scout-hedgedocis managed by anOAuth2ClientCR (plus aGroupCR for its users) inargo/hedgedoc/, and theOnePasswordItemhedgedoc-oidc-idmacnzis gone. Login at https://notes.m.ac.nz keeps working throughout.Current state
argo/hedgedoc/deployment.yamlsetsCMD_OAUTH2_CLIENT_ID=scout-hedgedocand readsCMD_OAUTH2_CLIENT_SECRETfrom Secrethedgedoc-oidc-idmacnz, keypassword.CMD_OAUTH2_PKCE=true, scopeopenid email profile groups.argo/hedgedoc/hedgedoc-oidc-idmacnz.yaml(OnePasswordItem,vaults/homelab/items/hedgedoc-oidc-idmacnz).scout-hedgedocwas made by hand (create-kanidm-oidcproxy.shconventions). The operator will adopt it.Gotchas (read before writing the CRs)
hedgedoc-oidc-idmacnz. The operator refuses a Secret owned by another controller (SecretConflict). Use a new name, e.g.spec.secret.name: scout-hedgedoc-oidc, and repoint the Deployment at keyclient_secret. The operator's Secret keys areclient_id,client_secret,issuer_url,discovery_url(notpassword).Group'smemberslist replaces the Kanidm membership. Before writing anything, capture the live state asidm_admin: and copy redirect URLs, scope maps, claim maps and members into the CRs verbatim.https://notes.m.ac.nz/auth/oauth2/callbackor whateveroauth2 getshows), not just the origin.disablePkceunset.name:reference (not aGroupCR), the operator doesn't touch its membership. That's the lower-risk option if the membership is managed elsewhere.Steps
argo/hedgedoc/: addkanidm-group.yaml(optional, see 5) andkanidm-oauth2client.yaml(spec.name: scout-hedgedoc,type: confidential,secret.name: scout-hedgedoc-oidc, the captured redirect URLs / scope maps / claim maps). Same shape asargo/scout/kanidm-operator-smoke/.CMD_OAUTH2_CLIENT_SECRETtosecretKeyRef: {name: scout-hedgedoc-oidc, key: client_secret}. Keep theOnePasswordItemin this PR so a failed adoption can be reverted cleanly.argo/hedgedoc/hedgedoc-oidc-idmacnz.yaml. ArgoCD prunes theOnePasswordItemand its Secret. Archive the 1Password item afterwards.Acceptance
OAuth2Clientscout-hedgedocisReady=Truewithstatus.adopted: true; theGroup(if used) isReady=True.preferred_username).OnePasswordItemhedgedoc-oidc-idmacnzno longer exists in the repo or on scout.Rollback
Revert the PR from step 3. The
OnePasswordItemand its Secret are still there, so the Deployment goes back to the old secret. Do not delete theOAuth2ClientCR while rolling back unless you mean to delete the Kanidm client too: the finalizer deletes the Kanidm object. To detach without deleting, remove the finalizer by hand first (seedocs/oauth2-clients.md).Step 1 is up as #20.
Live state captured 2026-10-19 (via the operator's service-account token against
GET /v1/oauth2/scout-hedgedocand/v1/group/scout_hedgedoc_users; secrets not recorded):notes.m.ac.nzhttps://notes.m.ac.nz/auth/oauth2/callbackhttps://notes.m.ac.nz/scout_hedgedoc_users→email groups openid profiletrue8d0b611d-787a-4bfd-bf2e-b5e18676a965scout_hedgedoc_usersmemberssophie(uuid55cb07f0-899d-4289-8a0f-018fdf7ec2ca)The CRs in #20 reproduce exactly this, so adoption is a no-op in Kanidm. Step 2 (remove the
OnePasswordItem) follows once login is confirmed after #20.#20 merged and verified on scout:
OAuth2Clientscout-hedgedoc andGroupscout-hedgedoc-users are Ready withadopted: true(uuids match the capture above), Secret scout-hedgedoc-oidc has 4 keys, deploy/hedgedoc rolled out, and the hedgedoc log shows successful OAuth2 callback exchanges through the new pod. The only change in Kanidm was the group description (DescriptionUpdated event), as intended.Step 2 is up as #21.
#21 merged and verified on scout: Application hedgedoc Synced/Healthy at
63399f3, theOnePasswordItemand Secrethedgedoc-oidc-idmacnzare gone,scout-hedgedocandscout-hedgedoc-usersare still Ready, and the hedgedoc pod is unchanged (no restart). Remaining manual step: archive the 1Password itemhedgedoc-oidc-idmacnzin vaulthomelab.Closing: acceptance met.