yera.cli.resources.creds
Credential-related helpers shared across CLI commands.
Symbols
ensure_authorised_credential_group
ensure_authorised_credential_group(
ctx: AppContext,
group_name: str,
) → CredentialGroupInfoResolve or create an authorized version-two credential group.
Parameters
Active CLI application context.
Configured credential-group name.
Returns
Non-sensitive metadata for the authorized group.
Raises
If an existing group does not authorize the current project root.
raise_if_bare_leaf_for_prefix_command
raise_if_bare_leaf_for_prefix_command(
path: str,
creds: CredentialGroupMap,
single_leaf_command: str,
purpose_phrase: str,
) → NoneReject a single credential leaf where a namespace is required.
Parameters
Dotted credential path supplied to the prefix operation.
Credential mapping in which to classify the path.
Suggested command for operating on the leaf, such
as yera cred put my.key.
Description appended to the recovery message, such as
single-leaf writes.
Raises
If the path identifies a leaf but not a namespace.
read_json_object_from_cli
read_json_object_from_cli(
json_str: str | None,
from_file: str | None,
) → dict[str, Any]Resolve a JSON object from inline text or a file path.
Exactly one of json_str or from_file must be provided.
--from-file - reads from sys.stdin.
Parameters
Inline JSON text, or None when reading from a file.
JSON file path, "-" for standard input, or None
when using inline text.
Returns
The decoded JSON object.
Raises
If the source selection is invalid, the input cannot be read or decoded, or the decoded value is not an object.
read_json_raw_from_path_or_stdin
read_json_raw_from_path_or_stdin(
path_or_dash: str,
) → strRead raw JSON text from a filesystem path or standard input.
Parameters
File path to read, or "-" to read standard input.
Returns
The unparsed text read from the selected source.
Raises
If standard input is interactive or the file cannot be read.
require_authorised_credential_group
require_authorised_credential_group(
ctx: AppContext,
group_name: str,
) → CredentialGroupInfoResolve an existing credential group authorized for this project.
Parameters
Active CLI application context.
Configured credential-group name.
Returns
Non-sensitive metadata for the authorized group.
Raises
If the group does not exist.
If the current project is not authorized for the group.
tool_secret_info
tool_secret_info(
ctx: AppContext,
owner_id: str,
) → tuple[SecretInfo, ...]List ordinary tool secrets owned by a credential group.
Parameters
Active CLI application context.
Stable credential-group identity.
Returns
Tool-secret metadata ordered by credential name.