msticpy.auth.keyring_client module

Settings provider for secrets.

class msticpy.auth.keyring_client.KeyringClient(name: str = 'key-cache', debug: bool = False)

Bases: object

Keyring client wrapper.

Initialize the keyring client.

Parameters:
  • name (str, optional) – Name of the credential group, by default “key-cache”

  • debug (bool, optional) – Output debug info, by default False

delete_secret(secret_name: str)

Delete a secret in the keyring group.

Parameters:

secret_name (str) – Name of the secret

get_secret(secret_name: str) Any

Retrieve a secret from the keyring.

Parameters:

secret_name (str) – Secret name.

Returns:

Secret value.

Return type:

Any

static is_keyring_available() bool

Test if valid keyring backend is available.

Returns:

True if Keyring has a usable backend, False if not.

Return type:

bool

set_secret(secret_name: str, secret_value: Any)

Set a secret in the keyring group.

Parameters:
  • secret_name (str) – Name of the secret

  • secret_value (Any) – Secret value