GithubIntegration

class github.GithubIntegration.GithubIntegration

Main class to obtain tokens for a GitHub integration.

Parameters:
create_jwt()

Create a signed JWT https://docs.github.com/en/developers/apps/building-github-apps/authenticating-with-github-apps#authenticating-as-a-github-app

Return string:
get_access_token(installation_id, permissions=None)
Calls:

POST /app/installations/{installation_id}/access_tokens <https://docs.github.com/en/rest/apps/apps#create-an-installation-access-token-for-an-app>

Parameters:
  • installation_id – int
  • permissions – dict
Returns:

github.InstallationAuthorization.InstallationAuthorization

get_installation(owner, repo)

Deprecated by get_repo_installation

Calls:

GET /repos/{owner}/{repo}/installation <https://docs.github.com/en/rest/reference/apps#get-a-repository-installation-for-the-authenticated-app>

Parameters:
  • owner – str
  • repo – str
Return type:

github.Installation.Installation

get_installations()
Calls:GET /app/installations <https://docs.github.com/en/rest/reference/apps#list-installations-for-the-authenticated-app>
Return type:github.PaginatedList.PaginatedList[github.Installation.Installation]
get_org_installation(org)
Calls:GET /orgs/{org}/installation <https://docs.github.com/en/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app>
Parameters:org – str
Return type:github.Installation.Installation
get_repo_installation(owner, repo)
Calls:

GET /repos/{owner}/{repo}/installation <https://docs.github.com/en/rest/reference/apps#get-a-repository-installation-for-the-authenticated-app>

Parameters:
  • owner – str
  • repo – str
Return type:

github.Installation.Installation

get_user_installation(username)
Calls:GET /users/{username}/installation <https://docs.github.com/en/rest/apps/apps#get-a-user-installation-for-the-authenticated-app>
Parameters:username – str
Return type:github.Installation.Installation
get_app_installation(installation_id)
Calls:GET /app/installations/{installation_id} <https://docs.github.com/en/rest/apps/apps#get-an-installation-for-the-authenticated-app>
Parameters:installation_id – int
Return type:github.Installation.Installation