Repository navigation
fix(auth): make RepoScopeGuard's AuthenticatedRequest type-check and drop unused ROLES_KEY (#495) - #695
Merged
chonilius merged 2 commits intoOct 15, 2026
Conversation
Redeclaring params as optional conflicted with express.Request's required ParamsDictionary (TS2430).
|
@choniszn1 is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@choniszn1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
src/auth/guards/repo-scope.guard.ts, the per-repository sync guard from #312, failed both the type check and lint:AuthenticatedRequestextendedexpress.Requestand redeclaredparams?: { owner?: string; repo?: string }. Express declaresparamsas a requiredParamsDictionary, so making it optional is not a valid subtype, andtscrejects the interface. ESLint also reportedROLES_KEYas imported but never used (no-unused-vars, error). Together these keeptscandeslintred for the whole project.What changed
fix(auth): the route params are now typed through Express's own generic instead of redeclaring the property:request.params.owner/.repokeep the same narrow types, and the guard's logic doesn't change. The existingrequest.params?.ownerreads still compile.chore(auth): removes the unusedROLES_KEYimport. It also runseslint --fixon the same file to clear four Prettier formatting errors that were already onmain(line wrapping only, no behaviour change), so the file now lints clean.Verification
npx tsc --noEmit: no errors inrepo-scope.guard.ts. TS2430 is gone.npx eslint src/auth/guards/repo-scope.guard.ts: clean.npx jest src/auth/guards: 14/14 passed.Related: #312
Closes #495
Closes #496
Closes #493
Closes #494