The secretstorage.item module

SecretStorage item contains a secret, some attributes and a label visible to user. Editing all these properties and reading the secret is possible only when the collection storing the item is unlocked. The collection can be unlocked using collection’s unlock() method.

class secretstorage.item.Item(bus, item_path, session=None)[source]

Represents a secret item.

delete()[source]

Deletes the item.

ensure_not_locked()[source]

If collection is locked, raises LockedException.

get_attributes()[source]

Returns item attributes (dictionary).

get_created()[source]

Returns UNIX timestamp (integer) representing the time when the item was created.

New in version 1.1.

get_label()[source]

Returns item label (unicode string).

get_modified()[source]

Returns UNIX timestamp (integer) representing the time when the item was last modified.

get_secret()[source]

Returns item secret (bytestring).

get_secret_content_type()[source]

Returns content type of item secret (string).

is_locked()[source]

Returns True if item is locked, otherwise False.

set_attributes(attributes)[source]

Sets item attributes to attributes (dictionary).

set_label(label)[source]

Sets item label to label.

set_secret(secret, content_type='text/plain')[source]

Sets item secret to secret. If content_type is given, also sets the content type of the secret (text/plain by default).

to_tuple()[source]

Returns (attributes, secret) tuple representing the item.

unlock(callback=None)[source]

Requests unlocking the item. Usually, this will mean that the whole collection containing this item will be unlocked.

If callback is specified, calls it when unlocking is complete (see exec_prompt() description for details). Otherwise, uses the loop from GLib API and returns a boolean representing whether the operation was dismissed.

New in version 2.1.2.