auth
appimage_updater.repositories.gitlab.auth
¶
GitLab authentication handling for AppImage Updater.
This module provides GitLab authentication using personal access tokens, supporting both environment variable configuration and explicit token passing.
GitLabAuth(token=None)
¶
GitLab authentication handler using personal access tokens.
Supports authentication via: - Explicit token parameter - GITLAB_TOKEN environment variable - GITLAB_PRIVATE_TOKEN environment variable (alternative)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token
|
str | None
|
Explicit GitLab personal access token. If None, will attempt to load from environment variables. |
None
|
Source code in src/appimage_updater/repositories/gitlab/auth.py
get_headers()
¶
Get authentication headers for GitLab API requests.
Returns:
Type | Description |
---|---|
dict[str, str]
|
Dictionary containing PRIVATE-TOKEN header if authenticated, |
dict[str, str]
|
empty dictionary if no token available |
Source code in src/appimage_updater/repositories/gitlab/auth.py
is_authenticated()
¶
Check if authentication is available.
Returns:
Type | Description |
---|---|
bool
|
True if a valid token is configured, False otherwise |