prefect_github.credentials
Credential classes used to perform authenticated interactions with GitHub
GitHubCredentials
Bases: CredentialsBlock
Block used to manage GitHub authentication.
Attributes:
Name | Type | Description |
---|---|---|
token |
Optional[SecretStr]
|
the token to authenticate into GitHub. |
Examples:
Load stored GitHub credentials:
from prefect_github import GitHubCredentials
github_credentials_block = GitHubCredentials.load("BLOCK_NAME")
Source code in prefect_github/credentials.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
get_client()
Gets an authenticated GitHub GraphQL HTTPEndpoint client.
Returns:
Type | Description |
---|---|
HTTPEndpoint
|
An authenticated GitHub GraphQL HTTPEndpoint client. |
Example
Gets an authenticated GitHub GraphQL HTTPEndpoint client.
from prefect_github import GitHubCredentials
github_credentials = GitHubCredentials(token=token)
client = github_credentials.get_client()
Source code in prefect_github/credentials.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|