Skip to content

Authenticating with a GitHub App not working with custom URL #2447

@AlexHff

Description

@AlexHff

Hello there,

It seems like the base_url passed to the default constructor is not used to fetch the access token for app authentication.

Here's an example code:

app_id = "XXX"
app_private_key = "XXX"
installation_id = "XXX"
g = github.Github(
    base_url="https://custom-github-url.com"
    app_auth=github.AppAuthentication(
        app_id=app_id,
        private_key=app_private_key,
        installation_id=installation_id,
    ),
)

Whatever base_url is passed, the following error occurs:
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.github.com', port=443): Max retries exceeded with url: XXX

As can be seen in the stack trace, the host is the one defined here, which is DEFAULT_BASE_URL = "https://api.github.com".

I suspect the error comes from here. The param base_url is not passed to GithubIntegration which therefore uses the default url.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions