Repository navigation
feat(github): MVP-2 connect mutation, callback, settings UI, and getUserTokenForRepo RPC - #3203
Merged
kilo-code-bot[bot] merged 4 commits intoMay 12, 2026
Conversation
…serTokenForRepo RPC
- Use 'expiresAt' in auth narrowing for GitHubAppAuthentication union type - Fix updated_at to use toISOString() (timestamp mode: 'string') - Fix access_token_expires_at in user.test.ts to use toISOString() - Add missing eq import in github-apps-router.test.ts - Narrow userConnectionStatus.login access with 'login' in guard - Apply oxfmt formatting
Contributor
Author
There was a problem hiding this comment.
Three groups of unused imports need to be cleaned up — per coding standards the linter will flag these and the correct fix is removal, not _-prefixing.
getUserFromAuthimported inroute.tsbut never called.isNull,gt,safeReturnTo,encryptWithSymmetricKeyimported ingithub-apps-router.tsbut never referenced.isNull,lteimported inuser-github-token-service.tsbut never referenced.
Otherwise the implementation looks correct — HMAC-signed state, timing-safe comparison, encryption-at-rest, GDPR delete in softDeleteUser, repo-access cache, proper fallback in errorRedirect. No secrets are logged.
Contributor
Author
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Previously Flagged — All Resolved ✓The 7 unused import warnings from the first review have all been cleaned up in the follow-up commit (
Files Reviewed (9 files)
Reviewed by claude-4.6-sonnet-20260217 · 239,066 tokens |
kilo-code-bot
Bot
merged commit May 12, 2026
34f0614
into
convoy/mvp-commit-as-user-via-github-app-user-t/db234b74/head
2 checks passed
kilo-code-bot
Bot
deleted the
convoy/mvp-commit-as-user-via-github-app-user-t/db234b74/gt/maple/72a28820
branch
May 12, 2026 14:54
kilo-code-bot Bot
added a commit
that referenced
this pull request
May 18, 2026
…serTokenForRepo RPC (#3203) * feat(github): MVP-2 connect mutation, callback, settings UI, and getUserTokenForRepo RPC * fix(git-token-service): add missing deps, fix timestamp type, typecheck passes * fix(web): fix typecheck errors in MVP-2 code - Use 'expiresAt' in auth narrowing for GitHubAppAuthentication union type - Fix updated_at to use toISOString() (timestamp mode: 'string') - Fix access_token_expires_at in user.test.ts to use toISOString() - Add missing eq import in github-apps-router.test.ts - Narrow userConnectionStatus.login access with 'login' in guard - Apply oxfmt formatting * fix: remove unused imports flagged by code review --------- Co-authored-by: Toast (gastown) <Toast@gastown.local> Co-authored-by: Maple (gastown) <Maple@gastown.local>
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.
Summary
MVP-2 of the "commit as user via GitHub App user tokens" convoy. Implements the full OAuth connect flow end-to-end:
connectUserIdentitytRPC mutation (github-apps-router.ts): generates a signed JWT OAuth state and returns a GitHub authorize URL/api/integrations/github/user-connect/callback/route.ts): exchanges the code for a user token via@octokit/oauth-methods, resolves GitHub identity, encrypts and upserts the token intouser_github_app_tokensgetUserConnectionStatusquery: returns connected/expired/disconnected status + login without exposing the tokendisconnectUserIdentitymutation: revokes the GitHub authorization and deletes the local rowGitHubIntegrationDetails.tsx): "Commit as You" card gated byenableUserTokensflag showing connect/reconnect/disconnect statesgetUserTokenForRepoRPC ingit-token-service(user-github-token-service.ts): decrypts and returns a valid token for a given repo if available; used by cloud-agent-next in MVP-3oauth-state.ts): sign/verify HMAC-SHA256 JWT state with TTLuser.ts): deletesuser_github_app_tokensrows insoftDeleteUserexpiresAtunion narrowing,toISOString()for timestamp string columns, missingeqimportVerification
tsgo --noEmit -p apps/web/tsconfig.json— passes (EXIT 0)pnpm --filter cloudflare-git-token-service run typecheck— passes (EXIT 0)pnpm --filter @kilocode/db run typecheck— passes (EXIT 0)github-apps-router.test.ts,callback/route.test.ts,oauth-state.test.ts) require Postgres — skipped in this environment (no DB available); tests are written and structurally correctVisual Changes
N/A (settings UI card is feature-flagged behind
enableUserTokens)Reviewer Notes
gt/toast/4b8b7e18onto the convoy feature branch head, plus a fix commit for typecheck errorsgetUserTokenForRepoRPC is used by MVP-3 (cloud-agent-next) which is in a parallel branch