feat(git-token-service): add GitLab token support with OAuth refresh#1070
Open
feat(git-token-service): add GitLab token support with OAuth refresh#1070
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (6 files)
Reviewed by gpt-5.4-20260305 · 546,102 tokens |
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
getGitLabTokenRPC method tocloudflare-git-token-service, enabling callers to retrieve GitLab access tokens the same way they already usegetTokenForRepo/getTokenfor GitHub.GitLabLookupServicequeriesplatform_integrationsfor active GitLab integrations by user/org ID, joiningorganization_membershipsfor org-scoped lookups andkilocode_usersto enforce blocked-user checks. Org integrations are prioritized over personal ones.GitLabTokenServicehandles token retrieval: PAT tokens are returned directly, OAuth tokens are checked for expiry (with a 5-minute buffer) and automatically refreshed via GitLab's/oauth/tokenendpoint. Refreshed tokens are written back toplatform_integrations.metadata.metadata.client_id/client_secret(for self-hosted instances) with fallback toGITLAB_OAUTH_CLIENT_ID/GITLAB_OAUTH_CLIENT_SECRETenv vars (for gitlab.com).GetGitLabTokenParams,GetGitLabTokenResult) for consuming service bindings.POST /getGitLabTokenendpoint for manual testing.Verification
pnpm typecheck— pass (all 28 workspace projects)pnpm --filter cloudflare-git-token-service lint— pass (no errors)Visual Changes
N/A
Reviewer Notes
cloudflare-git-token-serviceonly. Consumers (cloud-agent-next,cloudflare-gastown) will integrate via service binding in follow-up PRs.GITLAB_OAUTH_CLIENT_IDandGITLAB_OAUTH_CLIENT_SECRETare added as optional env vars inworker-configuration.d.ts. These are only needed as a fallback for gitlab.com integrations where custom credentials aren't stored in the integration metadata. They will need to be added as secrets in wrangler config before production use.