wauth.drivers package

Submodules

Module contents

Driver abstraction layer for secret retrieval sources.

Provides a factory pattern that prioritizes Docker secrets when running inside a container, falling back to the local encrypted vault otherwise.

class wauth.drivers.DriverFactory[source]

Bases: object

Factory for managing secret drivers (local and Docker).

Automatically selects the appropriate driver based on the runtime environment.

__init__()[source]
get_value(key)[source]

Retrieve a secret value, trying Docker first if in a container.

Parameters:

key (str) – Unique identifier for the secret.

Returns:

The secret value if found, or None.

Return type:

str | None

set_value(key, value, is_file=False)[source]

Store a secret using the local encrypted vault.

Writing is always directed to the local driver since the vault is the persistent store.

Parameters:
  • key (str) – Unique identifier for the secret.

  • value (str) – Secret value or file path if is_file is True.

  • is_file (bool) – Whether the value represents a file path.