Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- Secret.attributes_validate(schema, attributes)¶
- Parameters:
schema (
Secret.Schema
) – the schema for the attributesattributes ({
object
:object
}) – the attributes to be validated
- Raises:
- Returns:
whether or not the given attributes table is valid
- Return type:
Check if attributes are valid according to the provided schema.
Verifies schema name if available, attribute names and parsing of attribute values.
- Secret.backend_get(flags, cancellable, callback, *user_data)¶
- Parameters:
flags (
Secret.BackendFlags
) – flags for which service functionality to ensure is initializedcancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Get a
Secret.Backend
instance.If such a backend already exists, then the same backend is returned.
If flags contains any flags of which parts of the secret backend to ensure are initialized, then those will be initialized before completing.
This method will return immediately and complete asynchronously.
New in version 0.19.0.
- Secret.backend_get_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the asynchronous result passed to the callback- Raises:
- Returns:
a new reference to a
Secret.Backend
proxy, which should be released with [method`GObject`.Object.unref].- Return type:
Complete an asynchronous operation to get a
Secret.Backend
.New in version 0.19.0.
- Secret.get_schema(type)¶
- Parameters:
type (
Secret.SchemaType
) – type of schema to get- Returns:
schema type
- Return type:
Get a secret storage schema of the given type.
C code may access the schemas (such as %SECRET_SCHEMA_NOTE) directly, but language bindings cannot, and must use this accessor.
New in version 0.18.6.
- Secret.password_clear(schema, attributes, cancellable, callback, *user_data)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for the attributescancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Remove unlocked matching passwords from the secret service.
The attributes should be a set of key and value string pairs.
All unlocked items that match the attributes will be deleted.
This method will return immediately and complete asynchronously.
- Secret.password_clear_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the asynchronous result passed to the callback- Raises:
- Returns:
whether any passwords were removed
- Return type:
Finish an asynchronous operation to remove passwords from the secret service.
- Secret.password_clear_sync(schema, attributes, cancellable)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for the attributescancellable (
Gio.Cancellable
orNone
) – optional cancellation object
- Raises:
- Returns:
whether any passwords were removed
- Return type:
Remove unlocked matching passwords from the secret service.
The attributes should be a set of key and value string pairs.
All unlocked items that match the attributes will be deleted.
This method may block indefinitely and should not be used in user interface threads.
- Secret.password_lookup(schema, attributes, cancellable, callback, *user_data)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributescancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Lookup a password in the secret service.
The attributes should be a set of key and value string pairs.
If no secret is found then
None
is returned.This method will return immediately and complete asynchronously.
- Secret.password_lookup_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the asynchronous result passed to the callback- Raises:
- Returns:
a new password string which should be freed with [func`password_free`] or may be freed with [func`GLib`.free] when done
- Return type:
Finish an asynchronous operation to lookup a password in the secret service.
- Secret.password_lookup_sync(schema, attributes, cancellable)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributescancellable (
Gio.Cancellable
orNone
) – optional cancellation object
- Raises:
- Returns:
a new password string which should be freed with [func`password_free`] or may be freed with [func`GLib`.free] when done
- Return type:
Lookup a password in the secret service.
The attributes should be a set of key and value string pairs.
If no secret is found then
None
is returned.This method may block indefinitely and should not be used in user interface threads.
- Secret.password_search(schema, attributes, flags, cancellable, callback, *user_data)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributesflags (
Secret.SearchFlags
) – search option flagscancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Search for items in the secret service.
The attributes should be a set of key and value string pairs.
This method will return immediately and complete asynchronously.
New in version 0.19.0.
- Secret.password_search_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the asynchronous result passed to the callback- Raises:
- Returns:
a list of [iface`Retrievable`] containing attributes of the matched items
- Return type:
Finish an asynchronous operation to search for items in the secret service.
New in version 0.19.0.
- Secret.password_search_sync(schema, attributes, flags, cancellable)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributesflags (
Secret.SearchFlags
) – search option flagscancellable (
Gio.Cancellable
orNone
) – optional cancellation object
- Raises:
- Returns:
a list of [iface`Retrievable`] containing attributes of the matched items
- Return type:
Search for items in the secret service.
The attributes should be a set of key and value string pairs.
If no secret is found then
None
is returned.This method may block indefinitely and should not be used in user interface threads.
New in version 0.19.0.
- Secret.password_store(schema, attributes, collection, label, password, cancellable, callback, *user_data)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributescollection (
str
orNone
) – a collection alias, or D-Bus object path of the collection where to store the secretlabel (
str
) – label for the secretpassword (
str
) – the null-terminated password to storecancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Store a password 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.This method will return immediately and complete asynchronously.
- Secret.password_store_binary(schema, attributes, collection, label, value, cancellable, callback, *user_data)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributescollection (
str
orNone
) – a collection alias, or D-Bus object path of the collection where to store the secretlabel (
str
) – label for the secretvalue (
Secret.Value
) – a [struct`Value`]cancellable (
Gio.Cancellable
orNone
) – optional cancellation objectcallback (
Gio.AsyncReadyCallback
orNone
) – called when the operation completesuser_data (
object
orNone
) – data to be passed to the callback
Store a password in the secret service.
This is similar to [func`password_storev`], but takes a [struct`Value`] as the argument instead of a null-terminated password.
This method will return immediately and complete asynchronously.
New in version 0.19.0.
- Secret.password_store_binary_sync(schema, attributes, collection, label, value, cancellable)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributescollection (
str
orNone
) – a collection alias, or D-Bus object path of the collection where to store the secretlabel (
str
) – label for the secretvalue (
Secret.Value
) – a [struct`Value`]cancellable (
Gio.Cancellable
orNone
) – optional cancellation object
- Raises:
- Returns:
whether the storage was successful or not
- Return type:
Store a password in the secret service.
This is similar to [func`password_storev_sync`], but takes a [struct`Value`] as the argument instead of a null-terminated passwords.
This method may block indefinitely and should not be used in user interface threads.
New in version 0.19.0.
- Secret.password_store_finish(result)¶
- Parameters:
result (
Gio.AsyncResult
) – the asynchronous result passed to the callback- Raises:
- Returns:
whether the storage was successful or not
- Return type:
Finish asynchronous operation to store a password in the secret service.
- Secret.password_store_sync(schema, attributes, collection, label, password, cancellable)¶
- Parameters:
schema (
Secret.Schema
orNone
) – the schema for attributescollection (
str
orNone
) – a collection alias, or D-Bus object path of the collection where to store the secretlabel (
str
) – label for the secretpassword (
str
) – the null-terminated password to storecancellable (
Gio.Cancellable
orNone
) – optional cancellation object
- Raises:
- Returns:
whether the storage was successful or not
- Return type:
Store a password 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.This method may block indefinitely and should not be used in user interface threads.