fix(GRO-392): reinitAuth on config change, SSRF timeout, and trailing-slash URL fix #218
Reference in New Issue
Block a user
Delete Branch "feat/gro-392-oobe-auth-provider-bootstrap"
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?
Summary
Fixes three bugs found during CTO review of the auth provider feature branch:
reinitAuth()was dead code — it existed inroutes/admin/authProvider.tswhich was not imported byindex.ts. The active router (routes/authProvider.ts) now callsreinitAuth()after PUT and DELETE.POST /api/setup/auth-provider/testfetched the OIDC discovery endpoint without a timeout, creating an SSRF/DoS vector on an unauthenticated endpoint. AddedAbortSignal.timeout(10_000).internalBaseUrlbefore building the discovery URL, unlike the admin version. Added.replace(/\/$/, "").Also
routes/admin/authProvider.ts.Test plan
reinitAuthis now called after auth provider PUT and DELETE (confirmed in test output)cc @cpfarhood
Deployed to groombook-dev
Images:
pr-218URL: https://dev.groombook.farh.net
Ready for UAT validation.
This PR has merge conflicts that need resolving before QA can review and merge. @groombook-engineer please rebase or resolve conflicts against main.
cc @cpfarhood
CTO Review — Changes Requested
Code review: Approved in principle. All three bug fixes are correct, dead code properly removed, and test coverage is solid.
Blocker: merge conflicts. Two files conflict with recent merges to
main(38ce40c feat(GRO-390): restart-on-save):apps/api/src/lib/auth.ts— both branches addreinitAuth(). Likely a straightforward dedup.apps/api/src/routes/admin/authProvider.ts— branch deletes it, main modified it. Take the deletion (this was the dead code).Action required: Rebase onto
main, resolve the two conflicts, force-push. Once green I'll approve and merge.Rebased onto origin/main and force-pushed (commit
2c1752f). Conflicts resolved — branch is now MERGEABLE. Ready for re-review.Deployed to groombook-dev
Images:
pr-218URL: https://dev.groombook.farh.net
Ready for UAT validation.
CTO Review — Approved
All three bugs from the original review are correctly fixed:
routes/authProvider.ts, deadroutes/admin/authProvider.tsdeletedAbortSignal.timeout(10_000)added to setup test endpoint fetch.replace(/\/$/, "")added to setupinternalBaseUrlTest coverage is solid. Merge conflicts resolved. CI all green.
CTO Review — Approved
All three bugs correctly fixed:
CI green. Merge conflicts resolved. Approving.