Skip to content

chore(oauth): remove unused github-repo generic OAuth provider#3543

Merged
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/rm-github-oauth
Mar 12, 2026
Merged

chore(oauth): remove unused github-repo generic OAuth provider#3543
waleedlatif1 merged 1 commit intostagingfrom
waleedlatif1/rm-github-oauth

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

  • Remove github-repo generic OAuth provider (GitHub block uses PAT, not OAuth)
  • Remove associated env vars, types, auth config, token refresh case, and tests
  • Social login provider (socialProviders.github) remains intact

Type of Change

  • Refactor / cleanup

Testing

Tested manually — OAuth tests pass (111/111)

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 12, 2026 7:36pm

Request Review

@cursor
Copy link

cursor bot commented Mar 12, 2026

PR Summary

Low Risk
Low risk cleanup that removes an unused GitHub OAuth provider and related configuration; only impacts deployments that were relying on the deprecated github-repo flow or env vars.

Overview
Removes the unused github-repo generic OAuth provider across the auth plugin configuration, OAuth provider registry, and token refresh logic.

Cleans up related surface area by deleting GITHUB_REPO_CLIENT_ID/SECRET env schema entries, removing github/github-repo from OAuth types, and pruning GitHub-specific token-refresh tests and service-lookup tests.

Written by Cursor Bugbot for commit 1326dd5. Configure here.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 12, 2026

Greptile Summary

This PR removes the unused github-repo generic OAuth provider, which was superseded by GitHub's PAT-based authentication in the GitHub block. The cleanup is thorough and consistent across all relevant files.

  • Removes the github-repo genericOAuth provider config (including getUserInfo, scopes, and redirect URI) from auth.ts
  • Removes GITHUB_REPO_CLIENT_ID / GITHUB_REPO_CLIENT_SECRET env vars from env.ts
  • Removes the github entry from OAUTH_PROVIDERS, the GithubIcon import, and the case 'github' token-refresh handler in oauth.ts
  • Removes 'github' / 'github-repo' from OAuthProvider and OAuthService union types in types.ts
  • Cleans up all corresponding test cases in oauth.test.ts and utils.test.ts
  • Social login (socialProviders.github) and GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET are correctly preserved
  • Remaining github_repo_info references in tools/ and blocks/ are tool identifiers (snake_case), unrelated to this OAuth provider

Confidence Score: 5/5

  • This PR is safe to merge — it is a focused cleanup with no functional regressions and all 111 OAuth tests passing.
  • All removals are consistent across types, config, runtime logic, and tests. The social login path is untouched. No remaining code depends on the removed provider. The only cosmetic issue is blank lines left in the providers array and env config after removals, which have no runtime impact.
  • No files require special attention.

Important Files Changed

Filename Overview
apps/sim/lib/auth/auth.ts Removes the github-repo genericOAuth provider config block and its providerId from the trusted providers list. Social login (socialProviders.github) is correctly left intact. A blank line is left in the providers array where 'github-repo' was removed.
apps/sim/lib/core/config/env.ts Removes GITHUB_REPO_CLIENT_ID and GITHUB_REPO_CLIENT_SECRET env vars. GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET correctly remain for the social login provider. A blank line is left between the GitHub and X env var sections.
apps/sim/lib/oauth/oauth.ts Removes the github entry from OAUTH_PROVIDERS, the GithubIcon import (now unused), and the case 'github' from getProviderAuthConfig. Clean removal with no leftover references.
apps/sim/lib/oauth/types.ts Removes 'github' and 'github-repo' from the OAuthProvider union type, and 'github' from the OAuthService union type. Clean and consistent with the other changes.
apps/sim/lib/oauth/oauth.test.ts Removes github from the body-credential providers test array and drops the Accept header test specific to GitHub. Remaining tests are unaffected.
apps/sim/lib/oauth/utils.test.ts Removes all GitHub-specific test cases across getAllOAuthServices, getServiceByProviderAndId, getProviderIdFromServiceId, getServiceConfigByProviderId, getCanonicalScopesForProvider, and parseProvider. Cleanup is thorough and consistent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[GitHub Block] -->|PAT auth| B[GitHub API]
    C[Social Login] -->|socialProviders.github\nGITHUB_CLIENT_ID / SECRET| D[better-auth OAuth flow]
    E[github-repo genericOAuth] -->|REMOVED| F[❌ Deleted]

    style E fill:#f88,stroke:#c00
    style F fill:#f88,stroke:#c00
    style A fill:#aef,stroke:#06b
    style C fill:#aef,stroke:#06b
Loading

Last reviewed commit: 1326dd5

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@waleedlatif1 waleedlatif1 merged commit 3d5141d into staging Mar 12, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/rm-github-oauth branch March 12, 2026 19:40
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