Skip to content

Secure DSV driver password reset links for production - #413

Merged
OziinG merged 3 commits into
mainfrom
codex/dsv-driver-reset-release
Sep 10, 2026
Merged

Secure DSV driver password reset links for production#413
OziinG merged 3 commits into
mainfrom
codex/dsv-driver-reset-release

Conversation

@OziinG

@OziinG OziinG commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

DSV administrators need a one-time link that lets a linked driver choose a new password without changing account links or delivery assignments. This integrates the implementation from #412 with the web contract already implemented at web SHA 49cca813716053598da3a0f047fc9a94e27b71b9.

  • Add separate DriverAccount reset persistence and the admin issue/public validate/public complete endpoints. Links expire after 30 minutes; reissue revokes prior links; account locking ensures single consumption. Require active same-shop DSV linkage and password-login identity at issue/validate/complete.
  • Reject administrator-supplied and reused passwords, revoke account and legacy Driver sessions, and serialize password/PIN login with reset. Lock account/Driver/profile rows against concurrent eligibility changes.
  • Enforce scoped permissions, CSRF, request limits, no-store responses, and redacted request/error/audit logs. Trust only the immediately connected Caddy address resolved at startup for client rate limiting. Keep admin issuance disabled unless public Driver authentication is enabled.
  • Preserve CustomerAccount flows, driver/profile/route/vehicle relationships, and the separately deployed web artifact. No SMS or real-user password reset is performed.

Validation: fresh Prisma generation/migration; PostgreSQL eligibility, concurrent mutation/consumption, expiration/reissue, password reuse, session revocation, relationship and audit checks; targeted route/proxy/config/PIN tests; full API lint/typecheck/test/build; Route Ops web build; compose config; secret scan; deploy/migration wrapper contracts. Local API suite: 2,377 passed; separate PostgreSQL reset scenarios: 2 passed; local HTTP release rehearsal: 52 checks passed with fixture cleanup. Full CI passed at https://github.com/EVNSolution/clever-route-server/actions/runs/34458363918 . Final source/security review: APPROVE after the race and privacy findings were addressed.

Deployment: additive new table only; previous runtime remains schema-compatible. Use exact merge-SHA CI, reviewed G007 restore evidence, guarded migration and existing image rollback. Web deployment and complete browser E2E remain a separate owner task.

Constraint: Driver resets must preserve driver, route, and vehicle relationships and cannot use unverified identity fields.
Rejected: Name and phone reset | It does not prove control of the account.
Confidence: high
Scope-risk: moderate
Directive: Keep DriverAccount reset persistence separate from CustomerAccount invitations.
Tested: Prisma generate and validate; full lint, typecheck, tests, build; disposable PostgreSQL migration, concurrency, lockout, and session invalidation integration.
Not-tested: SMS delivery and production deployment were intentionally not run.
…ility

Constraint: Reset only active same-shop DSV accounts while preserving every delivery assignment.
Rejected: Advisory lock alone | Driver and profile status writers do not share the authentication lock.
Confidence: high
Scope-risk: moderate
Directive: Keep Caddy trust limited to its resolved address and one immediate proxy hop; refresh it when Caddy is recreated.
Tested: PostgreSQL reset and eligibility races; scoped authorization, log redaction, proxy limits, configuration, and PIN login regressions.
Not-tested: Web deployment and browser end-to-end completion are outside this server release.
Confidence: high
Scope-risk: narrow
Tested: Existing behavior and assertions preserved; CI lint failures mapped to mock method binding and promise factories.
@OziinG
OziinG merged commit 9912e2c into main Sep 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant