awx_plugins.credentials.github_app module

GitHub App Installation Access Token Credential Plugin.

This module defines a credential plugin for making use of the GitHub Apps mechanism, allowing authentication via GitHub App installation-scoped access tokens.

Functions:

class awx_plugins.credentials.github_app.EmptyKwargs

Bases: TypedDict

Schema for zero keyword arguments.

class awx_plugins.credentials.github_app.FieldDict

Bases: TypedDict

A single UI field schema.

default: NotRequired[str]
format: NotRequired[str]
help_text: str
id: str
label: str
multiline: NotRequired[bool]
secret: NotRequired[bool]
type: str
class awx_plugins.credentials.github_app.GitHubAppInputs

Bases: TypedDict

Schema for a collection of plugin input fields.

fields: list[FieldDict]
metadata: list[MetadataDict]
required: list[str]
class awx_plugins.credentials.github_app.MetadataDict

Bases: TypedDict

Schema for input metadata.

help_text: str
id: str
label: NotRequired[str]
type: str
awx_plugins.credentials.github_app.extract_github_app_install_token(*, github_api_url: str, app_or_client_id: int | str, private_rsa_key: str, install_id: int | str, **_discarded_kwargs: Unpack[EmptyKwargs]) str

Generate a GH App Installation access token.

Parameters:
  • github_api_url (str) – The GitHub instance API endpoint URL.

  • app_or_client_id (int | str) – The GitHub App ID or Client ID.

  • private_rsa_key (str) – The private key associated with the GitHub App.

  • install_id (int | str) – The GitHub App Installation ID.

  • _discarded_kwargs (Unpack[EmptyKwargs]) – Aren’t expected to be passed.

Return type:

str

Returns:

A GitHub access token for a GitHub App Installation.

Raises:
  • ValueError – If authentication fails or parameters are invalid.

  • RuntimeError – If an unexpected error occurs during token generation.