core: resolveRepository reports a GitHub repository hidden by OAuth App access restrictions as not-found

Author: julianmesa-gitkrakenCreated Sep 29, 2026Updated Sep 29, 2026
Labelsarea-integrationsbug

Summary

resolveRepository reports a GitHub repository hidden by its organization's OAuth App access restrictions as not-found, indistinguishable from a deleted repository, and no read anywhere says the organization is restricted.

Evidence

Measured with a GitHub OAuth token from an app the gitkraken organization has not approved:

Read Answer
GET /user/repos?affiliation=owner,collaborator,organization_member 200, the org's restricted private repositories silently omitted
search/issues, search/repositories 200, same omission
GraphQL repository(owner, name) data.repository: null, errors: [{ type: "NOT_FOUND" }]
GET /repos/{owner}/{repo} 403 Although you appear to have the correct authorization credentials, the \gitkraken` organization has enabled OAuth App access restrictions, meaning that data access to third-parties is limited.withX-OAuth-Client-Id` naming the app

So the only request that can tell a restricted repository from a missing one is the REST read of that repository. provider-apis' getRepo is GraphQL, and isGraphQLRepoNotFoundError (correctly) maps its NOT_FOUND to RequestNotFoundError, so resolveRepository returns { status: 'not-found' } with no warning.

Proposed fix

  • On a GitHub getRepoInfo miss, confirm over REST (GET /repos/{owner}/{repo}). Only a refusal replaces the miss; a REST read that cannot confirm either way keeps not-found.
  • Settle the refusal like a batch read's refused target: scope it to the repository, confirm the credential with a profile read (a GitHub validateCredential), and name the cause with a GitHub describeRefusal: oauth-app-not-allowed when the 403's explanation cites OAuth App access restrictions, with remedyUrl pointing at the app's page in the user's authorized OAuth apps (/settings/connections/applications/<client id>), where a member requests the organization's approval.
  • The resolution becomes unauthorized with that scoped warning. Any other refusal (e.g. SAML enforcement) stays scoped with GitHub's own words and no cause; a credential that no longer checks out still fails for the connection.

Consumer: gitkraken/kepler#3234.

Source: gitkraken/vscode-gitlens