Skip to content

credentials

diapason.core.credentials

Credential persistence for tools and channels.

Stores credentials in ~/.diapason/credentials.toml with 0o600 permissions. Thread-safe writes via lock. Sets os.environ on save for immediate effect.

delete_credential(tool_name, key, *, path=None)

Delete a persisted credential and remove it from the running process.

get_credential_status(tool_name)

Return {KEY: bool} for each required key indicating if set in env.

get_tool_credential(tool_name, key, *, path=None)

Read a single credential without polluting os.environ.

Falls back to os.environ if the key is not in credentials.toml, for backward compatibility with Docker env var workflows.

inject_credentials(path=None)

Load credentials.toml and inject into os.environ. Call at server startup.

load_credentials(path=None)

Load credentials from TOML file.

save_credential(tool_name, key, value, *, path=None)

Save a single credential key, validate, write file, and set os.environ.