Service

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.

class Service : DBusProxy , Backend {}

Members

Functions

clear
void clear(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

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

clearFinish
bool clearFinish(gio.async_result.AsyncResult result)

Finish asynchronous operation to remove items from the secret service.

clearSync
bool clearSync(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable)

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

decodeDbusSecret
secret.value.Value decodeDbusSecret(glib.variant.VariantG value)

Decode a structValue into glib.variant.VariantG received with the Secret Service DBus API.

encodeDbusSecret
glib.variant.VariantG encodeDbusSecret(secret.value.Value value)

Encodes a structValue into glib.variant.VariantG for use with the Secret Service DBus API.

ensureSession
void ensureSession(gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

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

ensureSessionFinish
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.

ensureSessionSync
bool ensureSessionSync(gio.cancellable.Cancellable cancellable)

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

getCollectionGtype
gobject.types.GType getCollectionGtype()

Get the GObject type for collections instantiated by this service.

getCollections
secret.collection.Collection[] getCollections()

Get a list of classCollection objects representing all the collections in the secret service.

getFlags
secret.types.ServiceFlags getFlags()

Get the flags representing what features of the #SecretService proxy have been initialized.

getItemGtype
gobject.types.GType getItemGtype()

Get the GObject type for items instantiated by this service.

getSessionAlgorithms
string getSessionAlgorithms()

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

getSessionDbusPath
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.

loadCollections
void loadCollections(gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

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

loadCollectionsFinish
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.

loadCollectionsSync
bool loadCollectionsSync(gio.cancellable.Cancellable cancellable)

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

lock
void lock(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Lock items or collections in the secret service.

lockFinish
int lockFinish(gio.async_result.AsyncResult result, gio.dbus_proxy.DBusProxy[] locked)

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

lockSync
int lockSync(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable, gio.dbus_proxy.DBusProxy[] locked)

Lock items or collections in the secret service.

lookup
void lookup(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Lookup a secret value in the secret service.

lookupFinish
secret.value.Value lookupFinish(gio.async_result.AsyncResult result)

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

lookupSync
secret.value.Value lookupSync(secret.schema.Schema schema, string[string] attributes, gio.cancellable.Cancellable cancellable)

Lookup a secret value in the secret service.

prompt
void prompt(secret.prompt.Prompt prompt, glib.variant_type.VariantType returnType, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Perform prompting for a classPrompt.

promptFinish
glib.variant.VariantG promptFinish(gio.async_result.AsyncResult result)

Complete asynchronous operation to perform prompting for a classPrompt.

promptSync
glib.variant.VariantG promptSync(secret.prompt.Prompt prompt, gio.cancellable.Cancellable cancellable, glib.variant_type.VariantType returnType)

Perform prompting for a classPrompt.

search
void search(secret.schema.Schema schema, string[string] attributes, secret.types.SearchFlags flags, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Search for items matching the attributes.

searchFinish
secret.item.Item[] searchFinish(gio.async_result.AsyncResult result)

Complete asynchronous operation to search for items.

searchSync
secret.item.Item[] searchSync(secret.schema.Schema schema, string[string] attributes, secret.types.SearchFlags flags, gio.cancellable.Cancellable cancellable)

Search for items matching the attributes.

setAlias
void setAlias(string alias_, secret.collection.Collection collection, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Assign a collection to this alias.

setAliasFinish
bool setAliasFinish(gio.async_result.AsyncResult result)

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

setAliasSync
bool setAliasSync(string alias_, secret.collection.Collection collection, gio.cancellable.Cancellable cancellable)

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

store
void store(secret.schema.Schema schema, string[string] attributes, string collection, string label, secret.value.Value value, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Store a secret value in the secret service.

storeFinish
bool storeFinish(gio.async_result.AsyncResult result)

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

storeSync
bool storeSync(secret.schema.Schema schema, string[string] attributes, string collection, string label, secret.value.Value value, gio.cancellable.Cancellable cancellable)

Store a secret value in the secret service.

unlock
void unlock(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Unlock items or collections in the secret service.

unlockFinish
int unlockFinish(gio.async_result.AsyncResult result, gio.dbus_proxy.DBusProxy[] unlocked)

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

unlockSync
int unlockSync(gio.dbus_proxy.DBusProxy[] objects, gio.cancellable.Cancellable cancellable, gio.dbus_proxy.DBusProxy[] unlocked)

Unlock items or collections in the secret service.

Static functions

disconnect
void disconnect()

Disconnect the default #SecretService proxy returned by secret.service.Service.get and secret.service.Service.getSync.

get
void get(secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Get a #SecretService proxy for the Secret Service.

getFinish
secret.service.Service getFinish(gio.async_result.AsyncResult result)

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

getSync
secret.service.Service getSync(secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable)

Get a #SecretService proxy for the Secret Service.

open
void open(gobject.types.GType serviceGtype, string serviceBusName, secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Create a new #SecretService proxy for the Secret Service.

openFinish
secret.service.Service openFinish(gio.async_result.AsyncResult result)

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

openSync
secret.service.Service openSync(gobject.types.GType serviceGtype, string serviceBusName, secret.types.ServiceFlags flags, gio.cancellable.Cancellable cancellable)

Create a new #SecretService proxy for the Secret Service.

Inherited Members

From DBusProxy

newFinish
gio.dbus_proxy.DBusProxy newFinish(gio.async_result.AsyncResult res)

Finishes creating a #GDBusProxy.

newForBusFinish
gio.dbus_proxy.DBusProxy newForBusFinish(gio.async_result.AsyncResult res)

Finishes creating a #GDBusProxy.

newForBusSync
gio.dbus_proxy.DBusProxy newForBusSync(gio.types.BusType busType, gio.types.DBusProxyFlags flags, gio.dbus_interface_info.DBusInterfaceInfo info, string name, string objectPath, string interfaceName, gio.cancellable.Cancellable cancellable)

Like gio.dbus_proxy.DBusProxy.newSync but takes a #GBusType instead of a #GDBusConnection.

newSync
gio.dbus_proxy.DBusProxy newSync(gio.dbus_connection.DBusConnection connection, gio.types.DBusProxyFlags flags, gio.dbus_interface_info.DBusInterfaceInfo info, string name, string objectPath, string interfaceName, gio.cancellable.Cancellable cancellable)

Creates a proxy for accessing interface_name on the remote object at object_path owned by name at connection and synchronously loads D-Bus properties unless the gio.types.DBusProxyFlags.DoNotLoadProperties flag is used.

new_
void new_(gio.dbus_connection.DBusConnection connection, gio.types.DBusProxyFlags flags, gio.dbus_interface_info.DBusInterfaceInfo info, string name, string objectPath, string interfaceName, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Creates a proxy for accessing interface_name on the remote object at object_path owned by name at connection and asynchronously loads D-Bus properties unless the gio.types.DBusProxyFlags.DoNotLoadProperties flag is used. Connect to the #GDBusProxy::g-properties-changed signal to get notified about property changes.

newForBus
void newForBus(gio.types.BusType busType, gio.types.DBusProxyFlags flags, gio.dbus_interface_info.DBusInterfaceInfo info, string name, string objectPath, string interfaceName, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Like gio.dbus_proxy.DBusProxy.new_ but takes a #GBusType instead of a #GDBusConnection.

call
void call(string methodName, glib.variant.VariantG parameters, gio.types.DBusCallFlags flags, int timeoutMsec, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Asynchronously invokes the method_name method on proxy.

callFinish
glib.variant.VariantG callFinish(gio.async_result.AsyncResult res)

Finishes an operation started with gio.dbus_proxy.DBusProxy.call.

callSync
glib.variant.VariantG callSync(string methodName, glib.variant.VariantG parameters, gio.types.DBusCallFlags flags, int timeoutMsec, gio.cancellable.Cancellable cancellable)

Synchronously invokes the method_name method on proxy.

callWithUnixFdList
void callWithUnixFdList(string methodName, glib.variant.VariantG parameters, gio.types.DBusCallFlags flags, int timeoutMsec, gio.unix_fdlist.UnixFDList fdList, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Like gio.dbus_proxy.DBusProxy.call but also takes a #GUnixFDList object.

callWithUnixFdListFinish
glib.variant.VariantG callWithUnixFdListFinish(gio.unix_fdlist.UnixFDList outFdList, gio.async_result.AsyncResult res)

Finishes an operation started with gio.dbus_proxy.DBusProxy.callWithUnixFdList.

callWithUnixFdListSync
glib.variant.VariantG callWithUnixFdListSync(string methodName, glib.variant.VariantG parameters, gio.types.DBusCallFlags flags, int timeoutMsec, gio.unix_fdlist.UnixFDList fdList, gio.unix_fdlist.UnixFDList outFdList, gio.cancellable.Cancellable cancellable)

Like gio.dbus_proxy.DBusProxy.callSync but also takes and returns #GUnixFDList objects.

getCachedProperty
glib.variant.VariantG getCachedProperty(string propertyName)

Looks up the value for a property from the cache. This call does no blocking IO.

getCachedPropertyNames
string[] getCachedPropertyNames()

Gets the names of all cached properties on proxy.

getConnection
gio.dbus_connection.DBusConnection getConnection()

Gets the connection proxy is for.

getDefaultTimeout
int getDefaultTimeout()

Gets the timeout to use if -1 (specifying default timeout) is passed as timeout_msec in the gio.dbus_proxy.DBusProxy.call and gio.dbus_proxy.DBusProxy.callSync functions.

getFlags
gio.types.DBusProxyFlags getFlags()

Gets the flags that proxy was constructed with.

getInterfaceInfo
gio.dbus_interface_info.DBusInterfaceInfo getInterfaceInfo()

Returns the #GDBusInterfaceInfo, if any, specifying the interface that proxy conforms to. See the #GDBusProxy:g-interface-info property for more details.

getInterfaceName
string getInterfaceName()

Gets the D-Bus interface name proxy is for.

getName
string getName()

Gets the name that proxy was constructed for.

getNameOwner
string getNameOwner()

The unique name that owns the name that proxy is for or null if no-one currently owns that name. You may connect to the #GObject::notify signal to track changes to the #GDBusProxy:g-name-owner property.

getObjectPath
string getObjectPath()

Gets the object path proxy is for.

setCachedProperty
void setCachedProperty(string propertyName, glib.variant.VariantG value)

If value is not null, sets the cached value for the property with name property_name to the value in value.

setDefaultTimeout
void setDefaultTimeout(int timeoutMsec)

Sets the timeout to use if -1 (specifying default timeout) is passed as timeout_msec in the gio.dbus_proxy.DBusProxy.call and gio.dbus_proxy.DBusProxy.callSync functions.

setInterfaceInfo
void setInterfaceInfo(gio.dbus_interface_info.DBusInterfaceInfo info)

Ensure that interactions with proxy conform to the given interface. See the #GDBusProxy:g-interface-info property for more details.

connectGPropertiesChanged
ulong connectGPropertiesChanged(T callback, Flag!"After" after)

Connect to GPropertiesChanged signal.

connectGSignal
ulong connectGSignal(string detail, T callback, Flag!"After" after)

Connect to GSignal signal.

From Backend

get
void get(secret.types.BackendFlags flags, gio.cancellable.Cancellable cancellable, gio.types.AsyncReadyCallback callback)

Get a #SecretBackend instance.

getFinish
secret.backend.Backend getFinish(gio.async_result.AsyncResult result)

Complete an asynchronous operation to get a #SecretBackend.