yera.creds.auth
Credential group resolution, authorisation, and TOFU for tool credentials.
Symbols
canonical_authorised_root_key
canonical_authorised_root_key(
path: Path | str,
) → strReturn a canonical path string for comparing authorised roots.
Relative components, user-home markers, trailing separators, and symlinks are resolved so equivalent directory spellings produce the same key.
Parameters
Filesystem path to canonicalise.
Returns
The expanded and resolved absolute path as a string.
Raises
If path is neither a string nor a Path.
project_root_authorised_in_roots
project_root_authorised_in_roots(
project_root: Path | None,
authorised_roots: list[str],
) → boolReport whether a project root is included in the authorised roots.
The "*" entry authorises every project. Other entries are compared
using their canonical filesystem paths.
Parameters
Project root to check, or None when no project root
is available.
Stored root paths, optionally including the "*"
wildcard.
Returns
Whether the project is authorised by a wildcard or matching root.
require_resolved_credential_group
require_resolved_credential_group(
resolved: ResolvedCredentialGroup | None,
) → ResolvedCredentialGroupReturn a resolved credential group, requiring one to be configured.
Parameters
Previously resolved credential group, or None.
Returns
The supplied resolved credential group.
Raises
If no credential group is configured.
resolve_active_credential_group
resolve_active_credential_group() → ResolvedCredentialGroup | NoneResolve the active credential group from pyproject.toml.
Reads a non-empty cred-group value from [tool.yera.overrides].
Missing files, missing values, and whitespace-only values are treated as
having no active credential group.
Returns
The resolved credential group, or None when none is configured.
ResolvedCredentialGroup
Active credential group selected by the project configuration.
Fields
Credential group selected by [tool.yera.overrides] cred-group.
Methods
ResolvedCredentialGroup.__init__
__init__(
name: str,
) → None