feat(oidc): add refresh tokens for regular clients#170
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Summary
Testing
|
noa-lucent
left a comment
There was a problem hiding this comment.
Good implementation overall — the refresh token model, rotation, reuse detection, and transaction-based concurrency guard are well designed. The scope narrowing with offline_access retention is a nice touch.
Two items require changes before merge:
-
Duplicated scope validation logic —
resolveRefreshTokenScopescopies ~15 lines of validation fromnormalizeRequestedScopes. Extract a shared helper to avoid silent drift. -
Missing unit test coverage — The issue explicitly requires tests for scope widening rejection, expired tokens, and client mismatch. These are core security invariants of the refresh flow and need explicit coverage.
Minor items (non-blocking): Prisma client variable naming in refresh-token-service.ts, parseScopeList reuse opportunity, and a note about redundant DB lookups in the route layer.
Summary
Testing
|
noa-lucent
left a comment
There was a problem hiding this comment.
All feedback addressed cleanly:
- Scope validation duplication → extracted
validateRequestedScopesas shared helper, bothnormalizeRequestedScopesandresolveRefreshTokenScopesnow compose on top of it. No more drift risk. - Missing tests → four new test cases added covering scope widening rejection, expired tokens, client mismatch, and revoked tokens. All assert the correct error messages matching the service's DomainError throws.
client→dbrename → done in bothcreateRefreshTokenandrevokeRefreshTokenFamily.parseScopeListreuse →normalizeRequestedScopesis now a one-liner usingparseScopeList.
LGTM — nice work.
Summary
Testing
Issue