Skip to content

Conversation

Copy link

Copilot AI commented Nov 20, 2025

Verified that the diff calculation endpoint uses the authenticated user's OAuth token for all GitHub API calls, providing implicit authorization.

Authentication Flow

The diffCalculator is initialized with gitHubClient which:

  1. Uses oauthTokenDataSource to fetch the user's OAuth token from session
  2. Passes this token to all GitHub API calls (getRepositoryContent, compareCommitsWithBasehead)
  3. Relies on GitHub's API to enforce repository access permissions
// composition.ts
const gitHubClient = new GitHubClient({
  ...gitHubAppCredentials,
  oauthTokenDataSource  // Retrieves user's token via session.getUserId()
})

export const diffCalculator = new OasDiffCalculator(gitHubClient)

Users without repository access will receive 403/404 errors from GitHub's API, which are already handled by the existing try-catch in the route handler.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI mentioned this pull request Nov 20, 2025
3 tasks
Copilot AI changed the title [WIP] Fix feedback on user auth verification in sidebar Verify user auth is used in diff calculation GitHub API calls Nov 20, 2025
Copilot AI requested a review from ulrikandersen November 20, 2025 13:27
Copilot finished work on behalf of ulrikandersen November 20, 2025 13:27
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.

2 participants