Skip to content

Installation.get_repos needs to differentiate between IAT access and UAT access #3546

Closed

Description

@xmo-odoo

get_repos calls /installation/repositories. This is the correct endpoint when the Installation was created from an IAT (or an app, which pygithub handles and upgrades internally).

However if the Installation was obtained via a user access token e.g. AuthenticatedUser.get_installations, then this triggers an HTTP 403 error, the correct endpoint is /user/installations/{installation_id}/repositories.

Sadly one can not even use the repositories_url which is returned as part of the installation object, because it's apparently hardcoded to /installation/repositories (note that it is not currently used by the code anyway, get_repos hard-codes that URL separately).

I can see two places to handle this, both by checking if the auth is AppUserAuth:

  • lazily in get_repos, and switch to the user version
  • or eagerly in __init__, after checking for AppAuth check for AppUserAuth, and update the _repositories_url (if necessary, in case github eventually fixes this?), and update get_repos to access self.repostories_url

Activity

  1. added a commit that references this issue on Nov 17, 2026
    d48832d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions