code_corps v0.0.1 CodeCorps.GitHub.API.Installation View Source
Functions for performing installation actions on the GitHub API.
Link to this section Summary
Functions
Get the access token for the installation
Refreshes the access token for the installation
List repositories that are accessible to the authenticated installation
Link to this section Functions
get_access_token(CodeCorps.GithubAppInstallation.t()) :: {:ok, String.t()} | {:error, CodeCorps.GitHub.api_error_struct()} | {:error, Ecto.Changeset.t()}
Get the access token for the installation.
Returns either the current access token stored in the database because it has not yet expired, or makes a request to the GitHub API for a new access token using the GitHub App’s JWT.
https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/#authenticating-as-an-installation
refresh_token(CodeCorps.GithubAppInstallation.t()) :: {:ok, String.t()} | {:error, CodeCorps.GitHub.api_error_struct()} | {:error, Ecto.Changeset.t()}
Refreshes the access token for the installation.
Makes a request to the GitHub API for a new access token using the GitHub App’s JWT.
https://developer.github.com/apps/building-integrations/setting-up-and-registering-github-apps/about-authentication-options-for-github-apps/#authenticating-as-an-installation
repositories(CodeCorps.GithubAppInstallation.t()) :: {:ok, [map()]} | {:error, CodeCorps.GitHub.paginated_endpoint_error()}
List repositories that are accessible to the authenticated installation.
All pages of records are retrieved.
https://developer.github.com/v3/apps/installations/#list-repositories