refactor: split request auth from local owner lookup #380

Merged
barrettruth merged 1 commit from issue-365-split-request-auth into main 2026-05-12 12:42:09 +00:00
Owner

Problem

Auth helper code mixed local owner bootstrap, request API-key auth, unauthorized responses, and request IP helpers, making route access behavior harder to read.

Solution

  • Split the helper surface into local-owner, request-auth, auth response, and request-IP modules.
  • Update routes and server actions so local-owner access and request-auth fallback behavior are named at call sites.
  • Keep #379 task route adapters as the base and layer the request-auth naming through getTaskRouteUser.
  • Remove local-owner null checks where the return type proves the owner is always present.

Verification

  • nix develop --command pnpm vitest run tests/api/auth.test.ts tests/core/auth.test.ts tests/api tests/server/dashboard-data.test.ts
  • rm -rf .next && nix develop --command just ci

Closes #365

## Problem Auth helper code mixed local owner bootstrap, request API-key auth, unauthorized responses, and request IP helpers, making route access behavior harder to read. ## Solution - Split the helper surface into local-owner, request-auth, auth response, and request-IP modules. - Update routes and server actions so local-owner access and request-auth fallback behavior are named at call sites. - Keep #379 task route adapters as the base and layer the request-auth naming through `getTaskRouteUser`. - Remove local-owner null checks where the return type proves the owner is always present. ## Verification - `nix develop --command pnpm vitest run tests/api/auth.test.ts tests/core/auth.test.ts tests/api tests/server/dashboard-data.test.ts` - `rm -rf .next && nix develop --command just ci` Closes #365
refactor auth helper boundaries
All checks were successful
quality / Test (pull_request) Successful in 16s
quality / Lint (pull_request) Successful in 21s
quality / Build (pull_request) Successful in 42s
2ece409a15
barrettruth deleted branch issue-365-split-request-auth 2026-05-12 12:42:09 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/delta!380
No description provided.