Additional utility functions

This module provides some utility functions, but these shouldn’t normally be used by external applications.

secretstorage.util.exec_prompt(connection: DBusConnection, prompt_path: str, *, timeout: float | None = None) tuple[bool, tuple[str, Any]][source]

Executes the prompt in a blocking mode.

Returns:

a two-element tuple:

  • The first element is a boolean value indicating whether the operation was dismissed.

  • The second element is a (signature, result) tuple. For creating items and collections, signature is 'o' and result is a single object path. For unlocking, signature is 'ao' and result is a list of object paths.

Changed in version 3.5: Added timeout keyword argument.

secretstorage.util.format_secret(session: Session, secret: bytes, content_type: str) tuple[str, bytes, bytes, str][source]

Formats secret to make possible to pass it to the Secret Service API.

secretstorage.util.unlock_objects(connection: DBusConnection, paths: list[str], *, timeout: float | None = None) bool[source]

Requests unlocking objects specified in paths. Returns a boolean representing whether the operation was dismissed.

Added in version 2.1.2.

Changed in version 3.5: Added timeout keyword argument.