auth
appimage_updater.github.auth
¶
GitHub authentication management for AppImage Updater.
This module handles GitHub token discovery and authentication for API requests. Supports multiple token sources with security-first priority ordering.
GitHubAuth(token=None)
¶
Manages GitHub authentication token discovery and validation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str | None
|
Optional explicit token to use (overrides discovery) |
None
|
Source code in src/appimage_updater/github/auth.py
is_authenticated
property
¶
Check if GitHub authentication is available.
Returns:
Type | Description |
---|---|
bool
|
True if a valid token is available |
token
property
¶
Get the GitHub token, discovering it if not already found.
Returns:
Type | Description |
---|---|
str | None
|
GitHub token string or None if no token found |
token_source
property
¶
Get the source of the current token for logging/debugging.
Returns:
Type | Description |
---|---|
str | None
|
String describing where the token was found |
get_auth_headers()
¶
Get HTTP headers for GitHub API authentication.
Returns:
Type | Description |
---|---|
dict[str, str]
|
Dictionary of headers to include in requests |
Source code in src/appimage_updater/github/auth.py
get_rate_limit_info()
¶
Get information about API rate limits.
Returns:
Type | Description |
---|---|
dict[str, int | str]
|
Dictionary with rate limit information |
Source code in src/appimage_updater/github/auth.py
log_auth_status()
¶
Log current authentication status for debugging.
Source code in src/appimage_updater/github/auth.py
get_github_auth(token=None)
¶
Factory function to create GitHubAuth instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str | None
|
Optional explicit token to use |
None
|
Returns:
Type | Description |
---|---|
GitHubAuth
|
Configured GitHubAuth instance |