Migrate remaining .romaine.life apps onto auth.romaine.life delegation #16
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
queue
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
romaine-life/auth#16
Loading…
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?
Context
Auth consolidation landed for tank-operator (gates on the JWT `role` claim from this service, no per-app email allowlist). The remaining `.romaine.life` apps still run their own MSAL flow + `ALLOWED_EMAILS` env var; this ticket tracks moving each onto the same delegation pattern.
Source of truth: tank-operator#472 is the canonical migration template. Read it first.
Pre-flight (already done)
Migration pattern (per app)
For each repo:
Apps in scope
Glimmung-specific note: slot-redirect URI maintenance
Before tank-operator#471, glimmung was updating the redirect URI list on tank-operator's `tank-operator-oauth-test` Entra app reg whenever it reconciled validation slots (the `lifecycle.ignore_changes` block in the now-deleted `oauth_app.tf` was the contract). That app reg's been deleted; glimmung's update-redirect-URI logic will fail against a missing target.
In the new architecture, slot URLs don't need slot-specific redirect URI registration at the Entra level — slots just pass their own URL as `callbackURL` when redirecting to `auth.romaine.life/sign-in/microsoft`. The fix is to delete that whole code path in glimmung. Cleanest to bundle it with glimmung's own auth migration above.
Acceptance criteria
Related PRs
🤖 Generated with Claude Code
fzt-frontend status: Inspecting the repo, fzt-frontend has no MSAL flow, no
ALLOWED_EMAILS, and no per-app Entra app registration. It's a pure backend API (no UI in this repo) that verifies HS256 JWTs minted by callers — my-homepage (browser tab), romaine-api.py CLI, and the fzt-terminal Go/WASM client. All callers sign with the sharedapi-jwt-signing-secretfromromaine-kv.Issue #16's acceptance criteria target Entra app regs and
ALLOWED_EMAILS— fzt-frontend already satisfies both as written.Migrating fzt-frontend off the shared signing secret would require migrating its callers too:
Per tank-operator/docs/migration-policy.md, dual-auth (accept both HS256 and RS256) is forbidden. Leaving fzt-frontend on its current shape is the only correct choice without expanding scope into the CLI auth model.
Marking fzt-frontend OUT OF SCOPE for #16. Recommend a follow-up issue for the CLI/headless auth question once the browser apps are all on delegation.
glimmung status: After inspecting the repo, I'm deferring glimmung to a dedicated follow-up session. Reasoning:
internal/auth/{entra,composite}.go,internal/entra/redirect_client.go,internal/server/{native_auth_redirects,project_scale_api,server}.go(4 constructor signatures to update),cmd/glimmung-go/main.go,internal/server/settings.goenv-var removals, plus the K8s ExternalSecret, plus a full frontend MSAL rewrite (frontend/src/auth.tsexports a different shape than the other apps — usesloginPopup+acquireTokenSilentinstead of redirect, returns MSALAccountInfoto many callers).UpdateApplicationRedirectsis actively erroring in prod (it targets a now-deletedtank-operator-oauth-testapp reg), deleting that code path could surface or hide a real incident; worth a careful look first.Recommend: a dedicated session for glimmung that (a) reads recent logs for the redirect-reconciler, (b) does the auth + reconciler-deletion + frontend swap together per migration-policy, (c) verifies tofu plan before applying.
The other 5 apps (kill-me, investing, house-hunt, plant-agent — plus tank-operator from before this batch) are all on the new delegation. fzt-frontend is out of scope per earlier comment. Phase 3 (infra-bootstrap SPA redirect cleanup) is gated on glimmung — defer alongside.
Glimmung migration shipped: glimmung#498 merged. Pattern matches the other apps:
internal/auth/romaine_life.goverifies upstream RS256 against auth.romaine.life JWKS; CompositeAuthenticator's Entra arm replaced with RomaineLife; K8s SA-token arm unchanged.auth.tspreserves existing exports but swaps MSAL popup for the canonical bootstrap pattern (silent fetch upstream JWT, redirect on sign-in).Application.ReadWrite.Allgrant. Slot URLs now sign in via callbackURL covered by the wildcard*.glimmung.dev.romaine.lifein auth.romaine.life's trustedOrigins (added in #20).glimmung-oauth,glimmung-oauth-test) and their KV secrets go with the tofu apply.go build + go test + frontend build + vitest all green pre-merge. Zero failed CI checks at merge. Guard script (
scripts/check-removed-msal.mjs) wired into the tests workflow.Acceptance status:
ALLOWED_EMAILSfrom KV. ✓ (verified by cross-repo grep across all 5 migrated apps + glimmung)fzt-frontendhas none and never did)Remaining: infra-bootstrap PR dropping SPA redirect URIs from the shared
microsoft_loginEntra app reg (referenced in kill-me PR #32's notes). Checking that next.Phase 3 / final cleanup shipped: infra-bootstrap#115 drops the SPA
redirect_urisblock from the sharedromaine.life - Social LoginEntra app reg. Thewebblock (auth.romaine.life's callback) stays.microsoft_loginis now used exclusively by auth.romaine.life's authorization-code flow; no SPA redirect URIs remain on the app reg.Issue #16 acceptance criteria — all met:
.romaine.lifeuser is a single action: admin enrolls via /admin.Closing this out — happy to revisit once you've eyeballed each app live.