Secret.Service

g GObject.GInterface GObject.GInterface Gio.AsyncInitable Gio.AsyncInitable GObject.GInterface->Gio.AsyncInitable Gio.DBusInterface Gio.DBusInterface GObject.GInterface->Gio.DBusInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable Secret.Backend Secret.Backend GObject.GInterface->Secret.Backend GObject.Object GObject.Object Gio.DBusProxy Gio.DBusProxy GObject.Object->Gio.DBusProxy Gio.AsyncInitable->Gio.DBusProxy Gio.DBusInterface->Gio.DBusProxy Secret.Service Secret.Service Gio.DBusProxy->Secret.Service Gio.Initable->Gio.DBusProxy Secret.Backend->Secret.Service

Subclasses:

None

Methods

Inherited:

Gio.DBusProxy (25), GObject.Object (37), Gio.AsyncInitable (4), Gio.DBusInterface (3), Gio.Initable (2), Secret.Backend (2)

Structs:

GObject.ObjectClass (5)

class

disconnect ()

class

get (flags, cancellable, callback, *user_data)

class

get_finish (result)

class

get_sync (flags, cancellable)

class

open (service_gtype, service_bus_name, flags, cancellable, callback, *user_data)

class

open_finish (result)

class

open_sync (service_gtype, service_bus_name, flags, cancellable)

clear (schema, attributes, cancellable, callback, *user_data)

clear_finish (result)

clear_sync (schema, attributes, cancellable)

create_item_dbus_path_sync (collection_path, properties, value, flags, cancellable)

decode_dbus_secret (value)

encode_dbus_secret (value)

ensure_session (cancellable, callback, *user_data)

ensure_session_finish (result)

ensure_session_sync (cancellable)

get_collection_gtype ()

get_collections ()

get_flags ()

get_item_gtype ()

get_session_algorithms ()

get_session_dbus_path ()

load_collections (cancellable, callback, *user_data)

load_collections_finish (result)

load_collections_sync (cancellable)

lock (objects, cancellable, callback, *user_data)

lock_finish (result)

lock_sync (objects, cancellable)

lookup (schema, attributes, cancellable, callback, *user_data)

lookup_finish (result)

lookup_sync (schema, attributes, cancellable)

prompt (prompt, return_type, cancellable, callback, *user_data)

prompt_finish (result)

prompt_sync (prompt, cancellable, return_type)

search (schema, attributes, flags, cancellable, callback, *user_data)

search_finish (result)

search_sync (schema, attributes, flags, cancellable)

set_alias (alias, collection, cancellable, callback, *user_data)

set_alias_finish (result)

set_alias_sync (alias, collection, cancellable)

store (schema, attributes, collection, label, value, cancellable, callback, *user_data)

store_finish (result)

store_sync (schema, attributes, collection, label, value, cancellable)

unlock (objects, cancellable, callback, *user_data)

unlock_finish (result)

unlock_sync (objects, cancellable)

Virtual Methods

Inherited:

Gio.DBusProxy (2), GObject.Object (7), Gio.AsyncInitable (2), Gio.DBusInterface (3), Gio.Initable (1), Secret.Backend (9)

do_get_collection_gtype ()

do_get_item_gtype ()

do_prompt_async (prompt, return_type, cancellable, callback, *user_data)

do_prompt_finish (result)

do_prompt_sync (prompt, cancellable, return_type)

Properties

Inherited:

Gio.DBusProxy (9), Secret.Backend (1)

Signals

Inherited:

Gio.DBusProxy (2), GObject.Object (1)

Fields

Inherited:

Gio.DBusProxy (2), GObject.Object (1)

Name

Type

Access

Description

parent

Gio.DBusProxy

r

Class Details

class Secret.Service(**kwargs)
Bases:

Gio.DBusProxy, Secret.Backend

Abstract:

No

Structure:

Secret.ServiceClass

A proxy object representing the Secret Service.

A Secret.Service object represents the Secret Service implementation which runs as a D-Bus service.

Normally a single Secret.Service object can be shared between multiple callers. The [func`Service`.get] method is used to access this Secret.Service object. If a new independent Secret.Service object is required, use [func`Service`.open].

In order to securely transfer secrets to the Sercret Service, a session is established. This session can be established while initializing a Secret.Service object by passing the Secret.ServiceFlags.OPEN_SESSION flag to the [func`Service`.get] or [func`Service`.open] functions. In order to establish a session on an already existing Secret.Service, use the [method`Service`.ensure_session] function.

To search for items, use the [method`Service`.search] method.

Multiple collections can exist in the Secret Service, each of which contains secret items. In order to instantiate [class`Collection`] objects which represent those collections while initializing a Secret.Service then pass the Secret.ServiceFlags.LOAD_COLLECTIONS flag to the [func`Service`.get] or [func`Service`.open] functions. In order to establish a session on an already existing Secret.Service, use the [method`Service`.load_collections] function. To access the list of collections use [method`Service`.get_collections].

Certain actions on the Secret Service require user prompting to complete, such as creating a collection, or unlocking a collection. When such a prompt is necessary, then a [class`Prompt`] object is created by this library, and passed to the [method`Service`.prompt] method. In this way it is handled automatically.

In order to customize prompt handling, override the [vfunc`Service`.prompt_async] and [vfunc`Service`.prompt_finish] virtual methods of the Secret.Service class.

classmethod disconnect()

Disconnect the default Secret.Service proxy returned by [func`Service`.get] and [func`Service`.get_sync].

It is not necessary to call this function, but you may choose to do so at program exit. It is useful for testing that memory is not leaked.

This function is safe to call at any time. But if other objects in this library are still referenced, then this will not result in all memory being freed.

classmethod get(flags, cancellable, callback, *user_data)
Parameters:

Get a Secret.Service proxy for the Secret Service.

If such a proxy object already exists, then the same proxy is returned.

If flags contains any flags of which parts of the secret service to ensure are initialized, then those will be initialized before completing.

This method will return immediately and complete asynchronously.

classmethod get_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

a new reference to a Secret.Service proxy, which should be released with [method`GObject`.Object.unref].

Return type:

Secret.Service

Complete an asynchronous operation to get a Secret.Service proxy for the Secret Service.

classmethod get_sync(flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a new reference to a Secret.Service proxy, which should be released with [method`GObject`.Object.unref].

Return type:

Secret.Service

Get a Secret.Service proxy for the Secret Service.

If such a proxy object already exists, then the same proxy is returned.

If flags contains any flags of which parts of the secret service to ensure are initialized, then those will be initialized before returning.

This method may block indefinitely and should not be used in user interface threads.

classmethod open(service_gtype, service_bus_name, flags, cancellable, callback, *user_data)
Parameters:

Create a new Secret.Service proxy for the Secret Service.

This function is rarely used, see [func`Service`.get] instead.

The service_gtype argument should be set to %SECRET_TYPE_SERVICE or a the type of a derived class.

If flags contains any flags of which parts of the secret service to ensure are initialized, then those will be initialized before returning.

If service_bus_name is None then the default is used.

This method will return immediately and complete asynchronously.

classmethod open_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

a new reference to a Secret.Service proxy, which should be released with [method`GObject`.Object.unref].

Return type:

Secret.Service

Complete an asynchronous operation to create a new Secret.Service proxy for the Secret Service.

classmethod open_sync(service_gtype, service_bus_name, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a new reference to a Secret.Service proxy, which should be released with [method`GObject`.Object.unref].

Return type:

Secret.Service

Create a new Secret.Service proxy for the Secret Service.

This function is rarely used, see [func`Service`.get_sync] instead.

The service_gtype argument should be set to %SECRET_TYPE_SERVICE or a the type of a derived class.

If flags contains any flags of which parts of the secret service to ensure are initialized, then those will be initialized before returning.

If service_bus_name is None then the default is used.

This method may block indefinitely and should not be used in user interface threads.

clear(schema, attributes, cancellable, callback, *user_data)
Parameters:

Remove unlocked items which match the attributes from the secret service.

The attributes should be a set of key and value string pairs.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

This method will return immediately and complete asynchronously.

clear_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

whether items were removed or not

Return type:

bool

Finish asynchronous operation to remove items from the secret service.

clear_sync(schema, attributes, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

whether items were removed or not

Return type:

bool

Remove unlocked items which match the attributes from the secret service.

The attributes should be a set of key and value string pairs.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

This method may block indefinitely and should not be used in user interface threads.

create_item_dbus_path_sync(collection_path, properties, value, flags, cancellable)
Parameters:
  • collection_path (str) – the D-Bus path of the collection in which to create item

  • properties ({str: GLib.Variant}) – hash table of D-Bus properties for the new collection

  • value (Secret.Value) – the secret value to store in the item

  • flags (Secret.ItemCreateFlags) – flags for the creation of the new item

  • cancellable (Gio.Cancellable or None) – optional cancellation object

Raises:

GLib.Error

Returns:

a new string containing the D-Bus object path of the item

Return type:

str

Create a new item in a secret service collection and return its D-Bus object path.

It is often easier to use [func`password_store_sync`] or [func`Item`.create_sync] rather than using this function. Using this method requires that you setup a correct hash table of D-Bus properties for the new collection.

If the flags contains Secret.ItemCreateFlags.REPLACE, then the secret service will search for an item matching the attributes, and update that item instead of creating a new one.

properties is a set of properties for the new collection. The keys in the hash table should be interface.property strings like org.freedesktop.Secret.Item.Label. The values in the hash table should be [struct`GLib`.Variant] values of the properties.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [method`Service`.prompt] will be used to handle any prompts that are required.

decode_dbus_secret(value)
Parameters:

value (GLib.Variant) – the encoded secret

Returns:

the decoded secret value

Return type:

Secret.Value

Decode a [struct`Value`] into [struct`GLib`.Variant] received with the Secret Service DBus API.

The [struct`GLib`.Variant] should have a (oayays) signature.

A session must have already been established by the [class`Service`], and the encoded secret must be valid for that session.

encode_dbus_secret(value)
Parameters:

value (Secret.Value) – the secret value

Returns:

the encoded secret

Return type:

GLib.Variant

Encodes a [struct`Value`] into [struct`GLib`.Variant] for use with the Secret Service DBus API.

The resulting [struct`GLib`.Variant] will have a (oayays) signature.

A session must have already been established by the [class`Service`].

ensure_session(cancellable, callback, *user_data)
Parameters:

Ensure that the Secret.Service proxy has established a session with the Secret Service.

This session is used to transfer secrets.

It is not normally necessary to call this method, as the session is established as necessary. You can also pass the Secret.ServiceFlags.OPEN_SESSION to [func`Service`.get] in order to ensure that a session has been established by the time you get the Secret.Service proxy.

This method will return immediately and complete asynchronously.

ensure_session_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

whether a session is established or not

Return type:

bool

Finish an asynchronous operation to ensure that the Secret.Service proxy has established a session with the Secret Service.

ensure_session_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – optional cancellation object

Raises:

GLib.Error

Returns:

whether a session is established or not

Return type:

bool

Ensure that the Secret.Service proxy has established a session with the Secret Service.

This session is used to transfer secrets.

It is not normally necessary to call this method, as the session is established as necessary. You can also pass the Secret.ServiceFlags.OPEN_SESSION to [func`Service`.get_sync] in order to ensure that a session has been established by the time you get the Secret.Service proxy.

This method may block indefinitely and should not be used in user interface threads.

get_collection_gtype()
Returns:

the gobject type for collections

Return type:

GObject.GType

Get the GObject.Object type for collections instantiated by this service.

This will always be either [class`Collection`] or derived from it.

get_collections()
Returns:

a list of the collections in the secret service

Return type:

[Secret.Collection] or None

Get a list of [class`Collection`] objects representing all the collections in the secret service.

If the Secret.ServiceFlags.LOAD_COLLECTIONS flag was not specified when initializing Secret.Service proxy object, then this method will return None. Use [method`Service`.load_collections] to load the collections.

get_flags()
Returns:

the flags for features initialized

Return type:

Secret.ServiceFlags

Get the flags representing what features of the Secret.Service proxy have been initialized.

Use [method`Service`.ensure_session] or [method`Service`.load_collections] to initialize further features and change the flags.

get_item_gtype()
Returns:

the gobject type for items

Return type:

GObject.GType

Get the GObject.Object type for items instantiated by this service.

This will always be either [class`Item`] or derived from it.

get_session_algorithms()
Returns:

a string representing the algorithms for transferring secrets

Return type:

str or None

Get the set of algorithms being used to transfer secrets between this secret service proxy and the Secret Service itself.

This will be None if no session has been established. Use [method`Service`.ensure_session] to establish a session.

get_session_dbus_path()
Returns:

a string representing the D-Bus object path of the session

Return type:

str or None

Get the D-Bus object path of the session object being used to transfer secrets between this secret service proxy and the Secret Service itself.

This will be None if no session has been established. Use [method`Service`.ensure_session] to establish a session.

load_collections(cancellable, callback, *user_data)
Parameters:

Ensure that the Secret.Service proxy has loaded all the collections present in the Secret Service.

This affects the result of [method`Service`.get_collections].

You can also pass the Secret.ServiceFlags.LOAD_COLLECTIONS to [func`Service`.get_sync] in order to ensure that the collections have been loaded by the time you get the Secret.Service proxy.

This method will return immediately and complete asynchronously.

load_collections_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

whether the load was successful or not

Return type:

bool

Complete an asynchronous operation to ensure that the Secret.Service proxy has loaded all the collections present in the Secret Service.

load_collections_sync(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – optional cancellation object

Raises:

GLib.Error

Returns:

whether the load was successful or not

Return type:

bool

Ensure that the Secret.Service proxy has loaded all the collections present in the Secret Service.

This affects the result of [method`Service`.get_collections].

You can also pass the Secret.ServiceFlags.LOAD_COLLECTIONS to [func`Service`.get_sync] in order to ensure that the collections have been loaded by the time you get the Secret.Service proxy.

This method may block indefinitely and should not be used in user interface threads.

lock(objects, cancellable, callback, *user_data)
Parameters:

Lock items or collections in the secret service.

The secret service may not be able to lock items individually, and may lock an entire collection instead.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

This method returns immediately and completes asynchronously. The secret service may prompt the user. [method`Service`.prompt] will be used to handle any prompts that show up.

lock_finish(result)
Parameters:

result (Gio.AsyncResult) – asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

the number of items or collections that were locked

locked:

location to place list of items or collections that were locked

Return type:

(int, locked: [Gio.DBusProxy])

Complete asynchronous operation to lock items or collections in the secret service.

The secret service may not be able to lock items individually, and may lock an entire collection instead.

lock_sync(objects, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the number of items or collections that were locked

locked:

location to place list of items or collections that were locked

Return type:

(int, locked: [Gio.DBusProxy])

Lock items or collections in the secret service.

The secret service may not be able to lock items individually, and may lock an entire collection instead.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [method`Service`.prompt] will be used to handle any prompts that show up.

lookup(schema, attributes, cancellable, callback, *user_data)
Parameters:

Lookup a secret value in the secret service.

The attributes should be a set of key and value string pairs.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

This method will return immediately and complete asynchronously.

lookup_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

a newly allocated [struct`Value`], which should be released with [method`Value`.unref], or None if no secret found

Return type:

Secret.Value

Finish asynchronous operation to lookup a secret value in the secret service.

If no secret is found then None is returned.

lookup_sync(schema, attributes, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a newly allocated [struct`Value`], which should be released with [method`Value`.unref], or None if no secret found

Return type:

Secret.Value

Lookup a secret value in the secret service.

The attributes should be a set of key and value string pairs.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

This method may block indefinitely and should not be used in user interface threads.

prompt(prompt, return_type, cancellable, callback, *user_data)
Parameters:

Perform prompting for a [class`Prompt`].

This function is called by other parts of this library to handle prompts for the various actions that can require prompting.

Override the Secret.ServiceClass [vfunc`Service`.prompt_async] virtual method to change the behavior of the prompting. The default behavior is to simply run [method`Prompt`.perform] on the prompt.

prompt_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

None if the prompt was dismissed or an error occurred, a variant result if the prompt was successful

Return type:

GLib.Variant

Complete asynchronous operation to perform prompting for a [class`Prompt`].

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

prompt_sync(prompt, cancellable, return_type)
Parameters:
Raises:

GLib.Error

Returns:

None if the prompt was dismissed or an error occurred, a variant result if the prompt was successful

Return type:

GLib.Variant

Perform prompting for a [class`Prompt`].

Runs a prompt and performs the prompting. Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

This function is called by other parts of this library to handle prompts for the various actions that can require prompting.

Override the Secret.ServiceClass [vfunc`Service`.prompt_sync] virtual method to change the behavior of the prompting. The default behavior is to simply run [method`Prompt`.perform_sync] on the prompt with a None window_id.

search(schema, attributes, flags, cancellable, callback, *user_data)
Parameters:

Search for items matching the attributes.

All collections are searched. The attributes should be a table of string keys and string values.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

If Secret.SearchFlags.ALL is set in flags, then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.

If Secret.SearchFlags.UNLOCK is set in flags, then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.

If Secret.SearchFlags.LOAD_SECRETS is set in flags, then the items will have their secret values loaded and available via [method`Item`.get_secret].

This function returns immediately and completes asynchronously.

search_finish(result)
Parameters:

result (Gio.AsyncResult) – asynchronous result passed to callback

Raises:

GLib.Error

Returns:

a list of items that matched the search

Return type:

[Secret.Item]

Complete asynchronous operation to search for items.

search_sync(schema, attributes, flags, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

a list of items that matched the search

Return type:

[Secret.Item]

Search for items matching the attributes.

All collections are searched. The attributes should be a table of string keys and string values.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

If Secret.SearchFlags.ALL is set in flags, then all the items matching the search will be returned. Otherwise only the first item will be returned. This is almost always the unlocked item that was most recently stored.

If Secret.SearchFlags.UNLOCK is set in flags, then items will be unlocked if necessary. In either case, locked and unlocked items will match the search and be returned. If the unlock fails, the search does not fail.

If Secret.SearchFlags.LOAD_SECRETS is set in flags, then the items’ secret values will be loaded for any unlocked items. Loaded item secret values are available via [method`Item`.get_secret]. If the load of a secret values fail, then the

This function may block indefinitely. Use the asynchronous version in user interface threads.

set_alias(alias, collection, cancellable, callback, *user_data)
Parameters:

Assign a collection to this alias.

Aliases help determine well known collections, such as ‘default’.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

This method will return immediately and complete asynchronously.

set_alias_finish(result)
Parameters:

result (Gio.AsyncResult) – asynchronous result passed to callback

Raises:

GLib.Error

Returns:

True if successful

Return type:

bool

Finish an asynchronous operation to assign a collection to an alias.

set_alias_sync(alias, collection, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if successful

Return type:

bool

Assign a collection to this alias. Aliases help determine well known collections, such as ‘default’.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

This method may block and should not be used in user interface threads.

store(schema, attributes, collection, label, value, cancellable, callback, *user_data)
Parameters:
  • schema (Secret.Schema or None) – the schema to use to check attributes

  • attributes ({str: str}) – the attribute keys and values

  • collection (str or None) – a collection alias, or D-Bus object path of the collection where to store the secret

  • label (str) – label for the secret

  • value (Secret.Value) – the secret value

  • cancellable (Gio.Cancellable or None) – optional cancellation object

  • callback (Gio.AsyncReadyCallback or None) – called when the operation completes

  • user_data (object or None) – data to be passed to the callback

Store a secret value in the secret service.

The attributes should be a set of key and value string pairs.

If the attributes match a secret item already stored in the collection, then the item will be updated with these new values.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

If collection is not specified, then the default collection will be used. Use [constCOLLECTION_SESSION] to store the password in the session collection, which doesn’t get stored across login sessions.

This method will return immediately and complete asynchronously.

store_finish(result)
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

whether the storage was successful or not

Return type:

bool

Finish asynchronous operation to store a secret value in the secret service.

store_sync(schema, attributes, collection, label, value, cancellable)
Parameters:
  • schema (Secret.Schema or None) – the schema for the attributes

  • attributes ({str: str}) – the attribute keys and values

  • collection (str or None) – a collection alias, or D-Bus object path of the collection where to store the secret

  • label (str) – label for the secret

  • value (Secret.Value) – the secret value

  • cancellable (Gio.Cancellable or None) – optional cancellation object

Raises:

GLib.Error

Returns:

whether the storage was successful or not

Return type:

bool

Store a secret value in the secret service.

The attributes should be a set of key and value string pairs.

If the attributes match a secret item already stored in the collection, then the item will be updated with these new values.

If collection is None, then the default collection will be used. Use [constCOLLECTION_SESSION] to store the password in the session collection, which doesn’t get stored across login sessions.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

This method may block indefinitely and should not be used in user interface threads.

unlock(objects, cancellable, callback, *user_data)
Parameters:

Unlock items or collections in the secret service.

The secret service may not be able to unlock items individually, and may unlock an entire collection instead.

If self is None, then [func`Service`.get] will be called to get the default [class`Service`] proxy.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [method`Service`.prompt] will be used to handle any prompts that show up.

unlock_finish(result)
Parameters:

result (Gio.AsyncResult) – asynchronous result passed to the callback

Raises:

GLib.Error

Returns:

the number of items or collections that were unlocked

unlocked:

location to place list of items or collections that were unlocked

Return type:

(int, unlocked: [Gio.DBusProxy])

Complete asynchronous operation to unlock items or collections in the secret service.

The secret service may not be able to unlock items individually, and may unlock an entire collection instead.

unlock_sync(objects, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the number of items or collections that were unlocked

unlocked:

location to place list of items or collections that were unlocked

Return type:

(int, unlocked: [Gio.DBusProxy])

Unlock items or collections in the secret service.

The secret service may not be able to unlock items individually, and may unlock an entire collection instead.

If self is None, then [func`Service`.get_sync] will be called to get the default [class`Service`] proxy.

This method may block indefinitely and should not be used in user interface threads. The secret service may prompt the user. [method`Service`.prompt] will be used to handle any prompts that show up.

do_get_collection_gtype() virtual
Returns:

the gobject type for collections

Return type:

GObject.GType

Get the GObject.Object type for collections instantiated by this service.

This will always be either [class`Collection`] or derived from it.

do_get_item_gtype() virtual
Returns:

the gobject type for items

Return type:

GObject.GType

Get the GObject.Object type for items instantiated by this service.

This will always be either [class`Item`] or derived from it.

do_prompt_async(prompt, return_type, cancellable, callback, *user_data) virtual
Parameters:
do_prompt_finish(result) virtual
Parameters:

result (Gio.AsyncResult) – the asynchronous result passed to the callback

Returns:

None if the prompt was dismissed or an error occurred, a variant result if the prompt was successful

Return type:

GLib.Variant

Complete asynchronous operation to perform prompting for a [class`Prompt`].

Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

do_prompt_sync(prompt, cancellable, return_type) virtual
Parameters:
Returns:

None if the prompt was dismissed or an error occurred, a variant result if the prompt was successful

Return type:

GLib.Variant

Perform prompting for a [class`Prompt`].

Runs a prompt and performs the prompting. Returns a variant result if the prompt was completed and not dismissed. The type of result depends on the action the prompt is completing, and is defined in the Secret Service DBus API specification.

This function is called by other parts of this library to handle prompts for the various actions that can require prompting.

Override the Secret.ServiceClass [vfunc`Service`.prompt_sync] virtual method to change the behavior of the prompting. The default behavior is to simply run [method`Prompt`.perform_sync] on the prompt with a None window_id.