secret.service

Module for [Service] class

Types 3

A proxy object representing the Secret Service.

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

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

In order to securely transfer secrets to the Sercret Service, a session is established. This session can be established while initializing a #SecretService object by passing the [secret.types.ServiceFlags.OpenSession] flag to the [secret.service.Service.get] or [secret.service.Service.open] functions. In order to establish a session on an already existing #SecretService, use the [secret.service.Service.ensureSession] function.

To search for items, use the [secret.service.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 #SecretService then pass the [secret.types.ServiceFlags.LoadCollections] flag to the [secret.service.Service.get] or [secret.service.Service.open] functions. In order to establish a session on an already existing #SecretService, use the [secret.service.Service.loadCollections] function. To access the list of collections use [secret.service.Service.getCollections].

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 [secret.service.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 #SecretService class.

Methods
GType _gType() @property
Service self()Returns `this`, for use in `with` statements.
ServiceGidBuilder builder()Get builder for [secret.service.Service] Returns: New builder object
void disconnect()Disconnect the default #SecretService proxy returned by [secret.service.Service.get] and [secret.service.Service.getSync].
void get(secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Get a #SecretService proxy for the Secret Service.
secret.service.Service getFinish(gio.async_result.AsyncResult result)Complete an asynchronous operation to get a #SecretService proxy for the Secret Service.
secret.service.Service getSync(secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable = null)Get a #SecretService proxy for the Secret Service.
void open(gobject.types.GType serviceGtype, string serviceBusName, secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Create a new #SecretService proxy for the Secret Service.
secret.service.Service openFinish(gio.async_result.AsyncResult result)Complete an asynchronous operation to create a new #SecretService proxy for the Secret Service.
secret.service.Service openSync(gobject.types.GType serviceGtype, string serviceBusName, secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable = null)Create a new #SecretService proxy for the Secret Service.
void clear(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Remove unlocked items which match the attributes from the secret service.
bool clearFinish(gio.async_result.AsyncResult result)Finish asynchronous operation to remove items from the secret service.
bool clearSync(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable = null)Remove unlocked items which match the attributes from the secret service.
secret.value.Value decodeDbusSecret(glib.variant.Variant value)Decode a `structValue` into [glib.variant.Variant] received with the Secret Service DBus API.
glib.variant.Variant encodeDbusSecret(secret.value.Value value)Encodes a `structValue` into [glib.variant.Variant] for use with the Secret Service DBus API.
void ensureSession(gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Ensure that the #SecretService proxy has established a session with the Secret Service.
bool ensureSessionFinish(gio.async_result.AsyncResult result)Finish an asynchronous operation to ensure that the #SecretService proxy has established a session with the Secret Service.
bool ensureSessionSync(gio.cancellable.Cancellable cancellable = null)Ensure that the #SecretService proxy has established a session with the Secret Service.
gobject.types.GType getCollectionGtype()Get the GObject type for collections instantiated by this service.
secret.collection.Collection[] getCollections()Get a list of `classCollection` objects representing all the collections in the secret service.
secret.types.ServiceFlags getFlags()Get the flags representing what features of the #SecretService proxy have been initialized.
gobject.types.GType getItemGtype()Get the GObject type for items instantiated by this service.
string getSessionAlgorithms()Get the set of algorithms being used to transfer secrets between this secret service proxy and the Secret Service itself.
string getSessionDbusPath()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.
void loadCollections(gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Ensure that the #SecretService proxy has loaded all the collections present in the Secret Service.
bool loadCollectionsFinish(gio.async_result.AsyncResult result)Complete an asynchronous operation to ensure that the #SecretService proxy has loaded all the collections present in the Secret Service.
bool loadCollectionsSync(gio.cancellable.Cancellable cancellable = null)Ensure that the #SecretService proxy has loaded all the collections present in the Secret Service.
void lock(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Lock items or collections in the secret service.
int lockFinish(gio.async_result.AsyncResult result, out gio.dbus_proxy.DBusProxy[] locked)Complete asynchronous operation to lock items or collections in the secret service.
int lockSync(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable, out gio.dbus_proxy.DBusProxy[] locked)Lock items or collections in the secret service.
void lookup(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Lookup a secret value in the secret service.
secret.value.Value lookupFinish(gio.async_result.AsyncResult result)Finish asynchronous operation to lookup a secret value in the secret service.
secret.value.Value lookupSync(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable = null)Lookup a secret value in the secret service.
void prompt(secret.prompt.Prompt prompt, glib.variant_type.VariantType returnType = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Perform prompting for a `classPrompt`.
glib.variant.Variant promptFinish(gio.async_result.AsyncResult result)Complete asynchronous operation to perform prompting for a `classPrompt`.
glib.variant.Variant promptSync(secret.prompt.Prompt prompt, gio.cancellable.Cancellable cancellable, glib.variant_type.VariantType returnType)Perform prompting for a `classPrompt`.
void search(secret.schema.Schema schema, string[string] attributes, secret.types.SearchFlags flags, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Search for items matching the attributes.
secret.item.Item[] searchFinish(gio.async_result.AsyncResult result)Complete asynchronous operation to search for items.
secret.item.Item[] searchSync(secret.schema.Schema schema, string[string] attributes, secret.types.SearchFlags flags, gio.cancellable.Cancellable cancellable = null)Search for items matching the attributes.
void setAlias(string alias_, secret.collection.Collection collection = null, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Assign a collection to this alias.
bool setAliasFinish(gio.async_result.AsyncResult result)Finish an asynchronous operation to assign a collection to an alias.
bool setAliasSync(string alias_, secret.collection.Collection collection = null, gio.cancellable.Cancellable cancellable = null)Assign a collection to this alias. Aliases help determine well known collections, such as 'default'.
void store(secret.schema.Schema schema, string[string] attributes, string collection, string label, secret.value.Value value, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Store a secret value in the secret service.
bool storeFinish(gio.async_result.AsyncResult result)Finish asynchronous operation to store a secret value in the secret service.
bool storeSync(secret.schema.Schema schema, string[string] attributes, string collection, string label, secret.value.Value value, gio.cancellable.Cancellable cancellable = null)Store a secret value in the secret service.
void unlock(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable = null, gio.types.AsyncReadyCallback callback = null)Unlock items or collections in the secret service.
int unlockFinish(gio.async_result.AsyncResult result, out gio.dbus_proxy.DBusProxy[] unlocked)Complete asynchronous operation to unlock items or collections in the secret service.
int unlockSync(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable, out gio.dbus_proxy.DBusProxy[] unlocked)Unlock items or collections in the secret service.
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder for [secret.service.Service]

Methods