2.0 KiB
2.0 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-uuid-fallback | UUID fallback audit | done | 1 | plan.md | ../../specs/auth/requirements/secure-context-browser-fallbacks.md |
Task 01: UUID fallback audit
Route every browser-side client-only UUID through the guarded generator and prove the reported insecure-origin workflow path.
Acceptance
- Add Workflow, Add Step, and layout profile creation succeed when
crypto.randomUUIDis absent and produce unique UUID-shaped client IDs. - Existing secure-context UUID behavior remains unchanged.
- No unguarded
crypto.randomUUID()calls remain in application source underapps/web.
Files likely touched
apps/web/app/settings/workspace/use-workflow-creation.tsapps/web/app/settings/workspace/use-workflow-creation.test.tsapps/web/components/settings/workflow-card-actions.tsapps/web/components/settings/workflow-card-actions.test.tsapps/web/lib/layout/layout-profiles.tsapps/web/lib/layout/layout-profiles.test.ts
Verification
cd apps && pnpm --filter @kandev/web test -- --run app/settings/workspace/use-workflow-creation.test.ts components/settings/workflow-card-actions.test.ts lib/layout/layout-profiles.test.ts lib/utils.test.ts
cd apps/web && pnpm run typecheck
rtk rg -n --glob '!**/*.test.*' --glob '!**/e2e/**' 'crypto\.randomUUID\s*\(' apps/web
Risks
The existing fallback uses Math.random and is suitable only for temporary
client identities. Do not route security-sensitive identifiers through it.
Results
- RED: the three new insecure-context tests failed with
TypeError: crypto.randomUUID is not a functionat each original call site. - GREEN:
cd apps && pnpm --filter @kandev/web test -- --run app/settings/workspace/use-workflow-creation.test.ts components/settings/workflow-card-actions.test.ts lib/layout/layout-profiles.test.tspassed (3 files, 49 tests). cd apps/web && pnpm run typecheckpassed.- Static audit leaves only the guarded call in
apps/web/lib/utils.ts.