mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2025-01-03 02:28:53 +00:00
Rename the functions that operate on a dbus item path
* They all contain '_dbus_path' in their name * Move secret_service_get_session_path() to the paths functionality * Move the secret_collection_new() and secret_item_new() functionality to the path based section.
This commit is contained in:
parent
3cb0d8047d
commit
7098b856b7
@ -4,9 +4,6 @@
|
||||
SecretCollection
|
||||
SecretCollectionClass
|
||||
SecretCollectionFlags
|
||||
secret_collection_new
|
||||
secret_collection_new_finish
|
||||
secret_collection_new_sync
|
||||
secret_collection_load_items
|
||||
secret_collection_load_items_finish
|
||||
secret_collection_load_items_sync
|
||||
@ -46,9 +43,6 @@ secret_collection_flags_get_type
|
||||
SecretItem
|
||||
SecretItemClass
|
||||
SecretItemFlags
|
||||
secret_item_new
|
||||
secret_item_new_finish
|
||||
secret_item_new_sync
|
||||
secret_item_create
|
||||
secret_item_create_finish
|
||||
secret_item_create_sync
|
||||
@ -186,7 +180,6 @@ secret_service_new_sync
|
||||
secret_service_get_collections
|
||||
secret_service_get_flags
|
||||
secret_service_get_session_algorithms
|
||||
secret_service_get_session_path
|
||||
secret_service_ensure_session
|
||||
secret_service_ensure_session_finish
|
||||
secret_service_ensure_session_sync
|
||||
@ -239,39 +232,46 @@ secret_service_get_type
|
||||
<SECTION>
|
||||
<FILE>secret-paths</FILE>
|
||||
<INCLUDE>secret/secret-unstable.h</INCLUDE>
|
||||
secret_service_search_for_paths
|
||||
secret_service_search_for_paths_finish
|
||||
secret_service_search_for_paths_sync
|
||||
secret_service_get_secrets_for_paths
|
||||
secret_service_get_secrets_for_paths_finish
|
||||
secret_service_get_secrets_for_paths_sync
|
||||
secret_service_get_secret_for_path
|
||||
secret_service_get_secret_for_path_finish
|
||||
secret_service_get_secret_for_path_sync
|
||||
secret_service_lock_paths
|
||||
secret_service_lock_paths_finish
|
||||
secret_service_lock_paths_sync
|
||||
secret_service_unlock_paths
|
||||
secret_service_unlock_paths_finish
|
||||
secret_service_unlock_paths_sync
|
||||
secret_service_prompt_path
|
||||
secret_service_prompt_path_finish
|
||||
secret_service_prompt_path_sync
|
||||
secret_service_create_collection_path
|
||||
secret_service_create_collection_path_finish
|
||||
secret_service_create_collection_path_sync
|
||||
secret_service_create_item_path
|
||||
secret_service_create_item_path_finish
|
||||
secret_service_create_item_path_sync
|
||||
secret_service_delete_path
|
||||
secret_service_delete_path_finish
|
||||
secret_service_delete_path_sync
|
||||
secret_service_read_alias_path
|
||||
secret_service_read_alias_path_finish
|
||||
secret_service_read_alias_path_sync
|
||||
secret_service_set_alias_path
|
||||
secret_service_set_alias_path_finish
|
||||
secret_service_set_alias_path_sync
|
||||
secret_collection_new_for_dbus_path
|
||||
secret_collection_new_for_dbus_path_finish
|
||||
secret_collection_new_for_dbus_path_sync
|
||||
secret_item_new_for_dbus_path
|
||||
secret_item_new_for_dbus_path_finish
|
||||
secret_item_new_for_dbus_path_sync
|
||||
secret_service_get_session_dbus_path
|
||||
secret_service_search_for_dbus_paths
|
||||
secret_service_search_for_dbus_paths_finish
|
||||
secret_service_search_for_dbus_paths_sync
|
||||
secret_service_get_secrets_for_dbus_paths
|
||||
secret_service_get_secrets_for_dbus_paths_finish
|
||||
secret_service_get_secrets_for_dbus_paths_sync
|
||||
secret_service_get_secret_for_dbus_path
|
||||
secret_service_get_secret_for_dbus_path_finish
|
||||
secret_service_get_secret_for_dbus_path_sync
|
||||
secret_service_lock_dbus_paths
|
||||
secret_service_lock_dbus_paths_finish
|
||||
secret_service_lock_dbus_paths_sync
|
||||
secret_service_unlock_dbus_paths
|
||||
secret_service_unlock_dbus_paths_finish
|
||||
secret_service_unlock_dbus_paths_sync
|
||||
secret_service_prompt_at_dbus_path
|
||||
secret_service_prompt_at_dbus_path_finish
|
||||
secret_service_prompt_at_dbus_path_sync
|
||||
secret_service_create_collection_dbus_path
|
||||
secret_service_create_collection_dbus_path_finish
|
||||
secret_service_create_collection_dbus_path_sync
|
||||
secret_service_create_item_dbus_path
|
||||
secret_service_create_item_dbus_path_finish
|
||||
secret_service_create_item_dbus_path_sync
|
||||
secret_service_delete_item_dbus_path
|
||||
secret_service_delete_item_dbus_path_finish
|
||||
secret_service_delete_item_dbus_path_sync
|
||||
secret_service_read_alias_dbus_path
|
||||
secret_service_read_alias_dbus_path_finish
|
||||
secret_service_read_alias_dbus_path_sync
|
||||
secret_service_set_alias_to_dbus_path
|
||||
secret_service_set_alias_to_dbus_path_finish
|
||||
secret_service_set_alias_to_dbus_path_sync
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -699,131 +699,6 @@ secret_collection_async_initable_iface (GAsyncInitableIface *iface)
|
||||
iface->init_finish = secret_collection_async_initable_init_finish;
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_collection_new:
|
||||
* @service: (allow-none): a secret service object
|
||||
* @collection_path: the D-Bus path of the collection
|
||||
* @flags: options for the collection initialization
|
||||
* @cancellable: optional cancellation object
|
||||
* @callback: called when the operation completes
|
||||
* @user_data: data to be passed to the callback
|
||||
*
|
||||
* Get a new collection proxy for a collection in the secret service.
|
||||
*
|
||||
* If @service is NULL, then secret_service_get() will be called to get
|
||||
* the default #SecretService proxy.
|
||||
*
|
||||
* This method will return immediately and complete asynchronously.
|
||||
*/
|
||||
void
|
||||
secret_collection_new (SecretService *service,
|
||||
const gchar *collection_path,
|
||||
SecretCollectionFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GDBusProxy *proxy;
|
||||
|
||||
g_return_if_fail (service == NULL || SECRET_IS_SERVICE (service));
|
||||
g_return_if_fail (collection_path != NULL);
|
||||
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
||||
|
||||
proxy = G_DBUS_PROXY (service);
|
||||
|
||||
g_async_initable_new_async (SECRET_SERVICE_GET_CLASS (service)->collection_gtype,
|
||||
G_PRIORITY_DEFAULT, cancellable, callback, user_data,
|
||||
"g-flags", G_DBUS_CALL_FLAGS_NONE,
|
||||
"g-interface-info", _secret_gen_collection_interface_info (),
|
||||
"g-name", g_dbus_proxy_get_name (proxy),
|
||||
"g-connection", g_dbus_proxy_get_connection (proxy),
|
||||
"g-object-path", collection_path,
|
||||
"g-interface-name", SECRET_COLLECTION_INTERFACE,
|
||||
"service", service,
|
||||
"flags", flags,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_collection_new_finish:
|
||||
* @result: the asynchronous result passed to the callback
|
||||
* @error: location to place an error on failure
|
||||
*
|
||||
* Finish asynchronous operation to get a new collection proxy for a
|
||||
* collection in the secret service.
|
||||
*
|
||||
* Returns: (transfer full): the new collection, which should be unreferenced
|
||||
* with g_object_unref()
|
||||
*/
|
||||
SecretCollection *
|
||||
secret_collection_new_finish (GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
GObject *source_object;
|
||||
GObject *object;
|
||||
|
||||
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
source_object = g_async_result_get_source_object (result);
|
||||
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
|
||||
result, error);
|
||||
g_object_unref (source_object);
|
||||
|
||||
if (object == NULL)
|
||||
return NULL;
|
||||
|
||||
return SECRET_COLLECTION (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_collection_new_sync:
|
||||
* @service: (allow-none): a secret service object
|
||||
* @collection_path: the D-Bus path of the collection
|
||||
* @flags: options for the collection initialization
|
||||
* @cancellable: optional cancellation object
|
||||
* @error: location to place an error on failure
|
||||
*
|
||||
* Get a new collection proxy for a collection in the secret service.
|
||||
*
|
||||
* If @service is NULL, then secret_service_get_sync() will be called to get
|
||||
* the default #SecretService proxy.
|
||||
*
|
||||
* This method may block indefinitely and should not be used in user interface
|
||||
* threads.
|
||||
*
|
||||
* Returns: (transfer full): the new collection, which should be unreferenced
|
||||
* with g_object_unref()
|
||||
*/
|
||||
SecretCollection *
|
||||
secret_collection_new_sync (SecretService *service,
|
||||
const gchar *collection_path,
|
||||
SecretCollectionFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GDBusProxy *proxy;
|
||||
|
||||
g_return_val_if_fail (service == NULL || SECRET_IS_SERVICE (service), NULL);
|
||||
g_return_val_if_fail (collection_path != NULL, NULL);
|
||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
proxy = G_DBUS_PROXY (service);
|
||||
|
||||
return g_initable_new (SECRET_SERVICE_GET_CLASS (service)->collection_gtype,
|
||||
cancellable, error,
|
||||
"g-flags", G_DBUS_CALL_FLAGS_NONE,
|
||||
"g-interface-info", _secret_gen_collection_interface_info (),
|
||||
"g-name", g_dbus_proxy_get_name (proxy),
|
||||
"g-connection", g_dbus_proxy_get_connection (proxy),
|
||||
"g-object-path", collection_path,
|
||||
"g-interface-name", SECRET_COLLECTION_INTERFACE,
|
||||
"service", service,
|
||||
"flags", flags,
|
||||
NULL);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
GCancellable *cancellable;
|
||||
GHashTable *items;
|
||||
@ -853,7 +728,7 @@ on_load_item (GObject *source,
|
||||
|
||||
closure->items_loading--;
|
||||
|
||||
item = secret_item_new_finish (result, &error);
|
||||
item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
@ -921,7 +796,7 @@ secret_collection_load_items (SecretCollection *self,
|
||||
|
||||
/* No such collection yet create a new one */
|
||||
if (item == NULL) {
|
||||
secret_item_new (self->pv->service, path, SECRET_ITEM_NONE,
|
||||
secret_item_new_for_dbus_path (self->pv->service, path, SECRET_ITEM_NONE,
|
||||
cancellable, on_load_item, g_object_ref (res));
|
||||
closure->items_loading++;
|
||||
|
||||
@ -1012,7 +887,7 @@ secret_collection_load_items_sync (SecretCollection *self,
|
||||
|
||||
/* No such collection yet create a new one */
|
||||
if (item == NULL) {
|
||||
item = secret_item_new_sync (self->pv->service, path,
|
||||
item = secret_item_new_for_dbus_path_sync (self->pv->service, path,
|
||||
SECRET_ITEM_NONE,
|
||||
cancellable, error);
|
||||
if (item == NULL) {
|
||||
@ -1079,7 +954,7 @@ on_create_collection (GObject *source,
|
||||
CreateClosure *closure = g_simple_async_result_get_op_res_gpointer (res);
|
||||
GError *error = NULL;
|
||||
|
||||
closure->collection = secret_collection_new_finish (result, &error);
|
||||
closure->collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
|
||||
@ -1098,9 +973,9 @@ on_create_path (GObject *source,
|
||||
GError *error = NULL;
|
||||
gchar *path;
|
||||
|
||||
path = secret_service_create_collection_path_finish (service, result, &error);
|
||||
path = secret_service_create_collection_dbus_path_finish (service, result, &error);
|
||||
if (error == NULL) {
|
||||
secret_collection_new (service, path, SECRET_COLLECTION_LOAD_ITEMS,
|
||||
secret_collection_new_for_dbus_path (service, path, SECRET_COLLECTION_LOAD_ITEMS,
|
||||
closure->cancellable,
|
||||
on_create_collection, g_object_ref (res));
|
||||
} else {
|
||||
@ -1123,7 +998,7 @@ on_create_service (GObject *source,
|
||||
|
||||
service = secret_service_get_finish (result, &error);
|
||||
if (error == NULL) {
|
||||
secret_service_create_collection_path (service, create->properties,
|
||||
secret_service_create_collection_dbus_path (service, create->properties,
|
||||
create->alias, create->cancellable,
|
||||
on_create_path, g_object_ref (async));
|
||||
g_object_unref (service);
|
||||
@ -1205,7 +1080,7 @@ secret_collection_create (SecretService *service,
|
||||
on_create_service, g_object_ref (res));
|
||||
|
||||
} else {
|
||||
secret_service_create_collection_path (service, closure->properties,
|
||||
secret_service_create_collection_dbus_path (service, closure->properties,
|
||||
closure->alias, closure->cancellable,
|
||||
on_create_path, g_object_ref (res));
|
||||
}
|
||||
@ -1298,7 +1173,7 @@ secret_collection_create_sync (SecretService *service,
|
||||
|
||||
properties = collection_properties_new (label);
|
||||
|
||||
path = secret_service_create_collection_path_sync (service, properties, alias,
|
||||
path = secret_service_create_collection_dbus_path_sync (service, properties, alias,
|
||||
cancellable, error);
|
||||
|
||||
g_hash_table_unref (properties);
|
||||
@ -1308,7 +1183,7 @@ secret_collection_create_sync (SecretService *service,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
collection = secret_collection_new_sync (service, path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (service, path,
|
||||
SECRET_COLLECTION_LOAD_ITEMS,
|
||||
cancellable, error);
|
||||
|
||||
@ -1326,7 +1201,7 @@ on_service_delete_path (GObject *source,
|
||||
GSimpleAsyncResult *async = G_SIMPLE_ASYNC_RESULT (user_data);
|
||||
GError *error = NULL;
|
||||
|
||||
secret_service_delete_path_finish (SECRET_SERVICE (source), result, &error);
|
||||
_secret_service_delete_path_finish (SECRET_SERVICE (source), result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (async, error);
|
||||
g_simple_async_result_complete (async);
|
||||
|
@ -56,22 +56,6 @@ struct _SecretCollectionClass {
|
||||
|
||||
GType secret_collection_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void secret_collection_new (SecretService *service,
|
||||
const gchar *collection_path,
|
||||
SecretCollectionFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
SecretCollection * secret_collection_new_finish (GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
SecretCollection * secret_collection_new_sync (SecretService *service,
|
||||
const gchar *collection_path,
|
||||
SecretCollectionFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_collection_load_items (SecretCollection *self,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
|
@ -597,128 +597,6 @@ secret_item_async_initable_iface (GAsyncInitableIface *iface)
|
||||
iface->init_finish = secret_item_async_initable_init_finish;
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_item_new:
|
||||
* @service: (allow-none): a secret service object
|
||||
* @item_path: the D-Bus path of the collection
|
||||
* @flags: initialization flags for the new item
|
||||
* @cancellable: optional cancellation object
|
||||
* @callback: called when the operation completes
|
||||
* @user_data: data to be passed to the callback
|
||||
*
|
||||
* Get a new item proxy for a secret item in the secret service.
|
||||
*
|
||||
* If @service is NULL, then secret_service_get() will be called to get
|
||||
* the default #SecretService proxy.
|
||||
*
|
||||
* This method will return immediately and complete asynchronously.
|
||||
*/
|
||||
void
|
||||
secret_item_new (SecretService *service,
|
||||
const gchar *item_path,
|
||||
SecretItemFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GDBusProxy *proxy;
|
||||
|
||||
g_return_if_fail (service == NULL || SECRET_IS_SERVICE (service));
|
||||
g_return_if_fail (item_path != NULL);
|
||||
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
||||
|
||||
proxy = G_DBUS_PROXY (service);
|
||||
|
||||
g_async_initable_new_async (SECRET_SERVICE_GET_CLASS (service)->item_gtype,
|
||||
G_PRIORITY_DEFAULT, cancellable, callback, user_data,
|
||||
"g-flags", G_DBUS_CALL_FLAGS_NONE,
|
||||
"g-interface-info", _secret_gen_item_interface_info (),
|
||||
"g-name", g_dbus_proxy_get_name (proxy),
|
||||
"g-connection", g_dbus_proxy_get_connection (proxy),
|
||||
"g-object-path", item_path,
|
||||
"g-interface-name", SECRET_ITEM_INTERFACE,
|
||||
"service", service,
|
||||
"flags", flags,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_item_new_finish:
|
||||
* @result: the asynchronous result passed to the callback
|
||||
* @error: location to place an error on failure
|
||||
*
|
||||
* Finish asynchronous operation to get a new item proxy for an secret
|
||||
* item in the secret service.
|
||||
*
|
||||
* Returns: (transfer full): the new item, which should be unreferenced
|
||||
* with g_object_unref()
|
||||
*/
|
||||
SecretItem *
|
||||
secret_item_new_finish (GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
GObject *object;
|
||||
GObject *source_object;
|
||||
|
||||
source_object = g_async_result_get_source_object (result);
|
||||
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
|
||||
result, error);
|
||||
g_object_unref (source_object);
|
||||
|
||||
if (object == NULL)
|
||||
return NULL;
|
||||
|
||||
return SECRET_ITEM (object);
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_item_new_sync:
|
||||
* @service: (allow-none): a secret service object
|
||||
* @item_path: the D-Bus path of the item
|
||||
* @flags: initialization flags for the new item
|
||||
* @cancellable: optional cancellation object
|
||||
* @error: location to place an error on failure
|
||||
*
|
||||
* Get a new item proxy for a secret item in the secret service.
|
||||
*
|
||||
* If @service is NULL, then secret_service_get_sync() will be called to get
|
||||
* the default #SecretService proxy.
|
||||
*
|
||||
* This method may block indefinitely and should not be used in user interface
|
||||
* threads.
|
||||
*
|
||||
* Returns: (transfer full): the new item, which should be unreferenced
|
||||
* with g_object_unref()
|
||||
*/
|
||||
SecretItem *
|
||||
secret_item_new_sync (SecretService *service,
|
||||
const gchar *item_path,
|
||||
SecretItemFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GDBusProxy *proxy;
|
||||
|
||||
g_return_val_if_fail (service == NULL || SECRET_IS_SERVICE (service), NULL);
|
||||
g_return_val_if_fail (item_path != NULL, NULL);
|
||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
proxy = G_DBUS_PROXY (service);
|
||||
|
||||
return g_initable_new (SECRET_SERVICE_GET_CLASS (service)->item_gtype,
|
||||
cancellable, error,
|
||||
"g-flags", G_DBUS_CALL_FLAGS_NONE,
|
||||
"g-interface-info", _secret_gen_item_interface_info (),
|
||||
"g-name", g_dbus_proxy_get_name (proxy),
|
||||
"g-connection", g_dbus_proxy_get_connection (proxy),
|
||||
"g-object-path", item_path,
|
||||
"g-interface-name", SECRET_ITEM_INTERFACE,
|
||||
"service", service,
|
||||
"flags", flags,
|
||||
NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_item_refresh:
|
||||
* @self: the collection
|
||||
@ -795,7 +673,7 @@ on_create_item (GObject *source,
|
||||
CreateClosure *closure = g_simple_async_result_get_op_res_gpointer (res);
|
||||
GError *error = NULL;
|
||||
|
||||
closure->item = secret_item_new_finish (result, &error);
|
||||
closure->item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
|
||||
@ -817,9 +695,9 @@ on_create_path (GObject *source,
|
||||
GError *error = NULL;
|
||||
gchar *path;
|
||||
|
||||
path = secret_service_create_item_path_finish (service, result, &error);
|
||||
path = secret_service_create_item_dbus_path_finish (service, result, &error);
|
||||
if (error == NULL) {
|
||||
secret_item_new (service, path, SECRET_ITEM_NONE,
|
||||
secret_item_new_for_dbus_path (service, path, SECRET_ITEM_NONE,
|
||||
closure->cancellable, on_create_item,
|
||||
g_object_ref (res));
|
||||
} else {
|
||||
@ -908,7 +786,7 @@ secret_item_create (SecretCollection *collection,
|
||||
|
||||
collection_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (collection));
|
||||
|
||||
secret_service_create_item_path (service, collection_path, properties,
|
||||
secret_service_create_item_dbus_path (service, collection_path, properties,
|
||||
value, replace, cancellable,
|
||||
on_create_path, g_object_ref (res));
|
||||
|
||||
@ -1000,11 +878,11 @@ secret_item_create_sync (SecretCollection *collection,
|
||||
|
||||
collection_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (collection));
|
||||
|
||||
path = secret_service_create_item_path_sync (service, collection_path, properties,
|
||||
path = secret_service_create_item_dbus_path_sync (service, collection_path, properties,
|
||||
value, replace, cancellable, error);
|
||||
|
||||
if (path != NULL) {
|
||||
item = secret_item_new_sync (service, path, SECRET_ITEM_NONE,
|
||||
item = secret_item_new_for_dbus_path_sync (service, path, SECRET_ITEM_NONE,
|
||||
cancellable, error);
|
||||
g_free (path);
|
||||
}
|
||||
@ -1024,7 +902,7 @@ on_item_deleted (GObject *source,
|
||||
SecretItem *self = SECRET_ITEM (g_async_result_get_source_object (user_data));
|
||||
GError *error = NULL;
|
||||
|
||||
if (secret_service_delete_path_finish (SECRET_SERVICE (source), result, &error))
|
||||
if (_secret_service_delete_path_finish (SECRET_SERVICE (source), result, &error))
|
||||
g_simple_async_result_set_op_res_gboolean (res, TRUE);
|
||||
|
||||
if (error != NULL)
|
||||
@ -1279,12 +1157,13 @@ on_load_ensure_session (GObject *source,
|
||||
const gchar *session_path;
|
||||
GError *error = NULL;
|
||||
|
||||
session_path = secret_service_ensure_session_finish (self->pv->service, result, &error);
|
||||
secret_service_ensure_session_finish (self->pv->service, result, &error);
|
||||
if (error != NULL) {
|
||||
g_simple_async_result_take_error (res, error);
|
||||
g_simple_async_result_complete (res);
|
||||
|
||||
} else {
|
||||
session_path = secret_service_get_session_dbus_path (self->pv->service);
|
||||
g_assert (session_path != NULL && session_path[0] != '\0');
|
||||
g_dbus_proxy_call (G_DBUS_PROXY (self), "GetSecret",
|
||||
g_variant_new ("(o)", session_path),
|
||||
@ -1481,13 +1360,13 @@ on_loads_secrets_session (GObject *source,
|
||||
GError *error = NULL;
|
||||
const gchar *session;
|
||||
|
||||
session = secret_service_ensure_session_finish (SECRET_SERVICE (source),
|
||||
result, &error);
|
||||
secret_service_ensure_session_finish (SECRET_SERVICE (source), result, &error);
|
||||
if (error != NULL) {
|
||||
g_simple_async_result_take_error (async, error);
|
||||
g_simple_async_result_complete (async);
|
||||
|
||||
} else {
|
||||
session = secret_service_get_session_dbus_path (SECRET_SERVICE (source));
|
||||
g_dbus_proxy_call (G_DBUS_PROXY (source), "GetSecrets",
|
||||
g_variant_new ("(@aoo)", loads->in, session),
|
||||
G_DBUS_CALL_FLAGS_NO_AUTO_START, -1,
|
||||
|
@ -58,22 +58,6 @@ struct _SecretItemClass {
|
||||
|
||||
GType secret_item_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void secret_item_new (SecretService *service,
|
||||
const gchar *item_path,
|
||||
SecretItemFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
SecretItem * secret_item_new_finish (GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
SecretItem * secret_item_new_sync (SecretService *service,
|
||||
const gchar *item_path,
|
||||
SecretItemFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_item_refresh (SecretItem *self);
|
||||
|
||||
void secret_item_create (SecretCollection *collection,
|
||||
|
@ -127,7 +127,7 @@ on_search_loaded (GObject *source,
|
||||
|
||||
closure->loading--;
|
||||
|
||||
item = secret_item_new_finish (result, &error);
|
||||
item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
|
||||
@ -170,7 +170,7 @@ search_load_item_async (SecretService *self,
|
||||
|
||||
item = _secret_service_find_item_instance (self, path);
|
||||
if (item == NULL) {
|
||||
secret_item_new (self, path, SECRET_ITEM_NONE, closure->cancellable,
|
||||
secret_item_new_for_dbus_path (self, path, SECRET_ITEM_NONE, closure->cancellable,
|
||||
on_search_loaded, g_object_ref (res));
|
||||
closure->loading++;
|
||||
} else {
|
||||
@ -190,7 +190,7 @@ on_search_paths (GObject *source,
|
||||
gint want = 1;
|
||||
guint i;
|
||||
|
||||
secret_service_search_for_paths_finish (self, result, &closure->unlocked,
|
||||
secret_service_search_for_dbus_paths_finish (self, result, &closure->unlocked,
|
||||
&closure->locked, &error);
|
||||
if (error == NULL) {
|
||||
want = 1;
|
||||
@ -367,7 +367,7 @@ service_load_items_sync (SecretService *service,
|
||||
for (i = 0; *have < want && paths[i] != NULL; i++) {
|
||||
item = _secret_service_find_item_instance (service, paths[i]);
|
||||
if (item == NULL)
|
||||
item = secret_item_new_sync (service, paths[i], SECRET_ITEM_NONE,
|
||||
item = secret_item_new_for_dbus_path_sync (service, paths[i], SECRET_ITEM_NONE,
|
||||
cancellable, error);
|
||||
if (item == NULL) {
|
||||
return FALSE;
|
||||
@ -448,7 +448,7 @@ secret_service_search_sync (SecretService *service,
|
||||
g_object_ref (service);
|
||||
}
|
||||
|
||||
if (!secret_service_search_for_paths_sync (service, schema, attributes, cancellable,
|
||||
if (!secret_service_search_for_dbus_paths_sync (service, schema, attributes, cancellable,
|
||||
&unlocked_paths, &locked_paths, error)) {
|
||||
g_object_unref (service);
|
||||
return NULL;
|
||||
@ -714,10 +714,6 @@ service_xlock_finish (SecretService *service,
|
||||
*
|
||||
* Lock items or collections in the secret service.
|
||||
*
|
||||
* This method takes a list of #SecretItem or #SecretCollection proxy objects.
|
||||
* If you only have the D-Bus object paths of the items or collections, use
|
||||
* secret_service_lock_paths() instead.
|
||||
*
|
||||
* The secret service may not be able to lock items individually, and may
|
||||
* lock an entire collection instead.
|
||||
*
|
||||
@ -780,10 +776,6 @@ secret_service_lock_finish (SecretService *service,
|
||||
*
|
||||
* Lock items or collections in the secret service.
|
||||
*
|
||||
* This method takes a list of #SecretItem or #SecretCollection proxy objects.
|
||||
* If you only have the D-Bus object paths of the items or collections, use
|
||||
* secret_service_lock_paths_sync() instead.
|
||||
*
|
||||
* The secret service may not be able to lock items individually, and may
|
||||
* lock an entire collection instead.
|
||||
*
|
||||
@ -836,10 +828,6 @@ secret_service_lock_sync (SecretService *service,
|
||||
*
|
||||
* Unlock items or collections in the secret service.
|
||||
*
|
||||
* This method takes a list of #SecretItem or #SecretCollection proxy objects.
|
||||
* If you only have the D-Bus object paths of the items or collections, use
|
||||
* secret_service_unlock_paths() instead.
|
||||
*
|
||||
* The secret service may not be able to unlock items individually, and may
|
||||
* unlock an entire collection instead.
|
||||
*
|
||||
@ -902,10 +890,6 @@ secret_service_unlock_finish (SecretService *service,
|
||||
*
|
||||
* Unlock items or collections in the secret service.
|
||||
*
|
||||
* This method takes a list of #SecretItem or #SecretCollection proxy objects.
|
||||
* If you only have the D-Bus object paths of the items or collections, use
|
||||
* secret_service_unlock_paths_sync() instead.
|
||||
*
|
||||
* The secret service may not be able to unlock items individually, and may
|
||||
* unlock an entire collection instead.
|
||||
*
|
||||
@ -976,7 +960,7 @@ on_store_create (GObject *source,
|
||||
GError *error = NULL;
|
||||
gchar *path;
|
||||
|
||||
path = secret_service_create_item_path_finish (SECRET_SERVICE (source), result, &error);
|
||||
path = secret_service_create_item_dbus_path_finish (SECRET_SERVICE (source), result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (async, error);
|
||||
g_free (path);
|
||||
@ -997,7 +981,7 @@ on_store_service (GObject *source,
|
||||
|
||||
service = secret_service_get_finish (result, &error);
|
||||
if (error == NULL) {
|
||||
secret_service_create_item_path (service, store->collection_path,
|
||||
secret_service_create_item_dbus_path (service, store->collection_path,
|
||||
store->properties, store->value,
|
||||
TRUE, store->cancellable,
|
||||
on_store_create, g_object_ref (async));
|
||||
@ -1093,7 +1077,7 @@ secret_service_store (SecretService *service,
|
||||
on_store_service, g_object_ref (async));
|
||||
|
||||
} else {
|
||||
secret_service_create_item_path (service, store->collection_path,
|
||||
secret_service_create_item_dbus_path (service, store->collection_path,
|
||||
store->properties, store->value,
|
||||
TRUE, store->cancellable,
|
||||
on_store_create, g_object_ref (async));
|
||||
@ -1225,7 +1209,7 @@ on_lookup_get_secret (GObject *source,
|
||||
SecretService *self = SECRET_SERVICE (source);
|
||||
GError *error = NULL;
|
||||
|
||||
closure->value = secret_service_get_secret_for_path_finish (self, result, &error);
|
||||
closure->value = secret_service_get_secret_for_dbus_path_finish (self, result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
|
||||
@ -1244,14 +1228,14 @@ on_lookup_unlocked (GObject *source,
|
||||
GError *error = NULL;
|
||||
gchar **unlocked = NULL;
|
||||
|
||||
secret_service_unlock_paths_finish (SECRET_SERVICE (source),
|
||||
secret_service_unlock_dbus_paths_finish (SECRET_SERVICE (source),
|
||||
result, &unlocked, &error);
|
||||
if (error != NULL) {
|
||||
g_simple_async_result_take_error (res, error);
|
||||
g_simple_async_result_complete (res);
|
||||
|
||||
} else if (unlocked && unlocked[0]) {
|
||||
secret_service_get_secret_for_path (self, unlocked[0],
|
||||
secret_service_get_secret_for_dbus_path (self, unlocked[0],
|
||||
closure->cancellable,
|
||||
on_lookup_get_secret,
|
||||
g_object_ref (res));
|
||||
@ -1276,20 +1260,20 @@ on_lookup_searched (GObject *source,
|
||||
gchar **unlocked = NULL;
|
||||
gchar **locked = NULL;
|
||||
|
||||
secret_service_search_for_paths_finish (self, result, &unlocked, &locked, &error);
|
||||
secret_service_search_for_dbus_paths_finish (self, result, &unlocked, &locked, &error);
|
||||
if (error != NULL) {
|
||||
g_simple_async_result_take_error (res, error);
|
||||
g_simple_async_result_complete (res);
|
||||
|
||||
} else if (unlocked && unlocked[0]) {
|
||||
secret_service_get_secret_for_path (self, unlocked[0],
|
||||
secret_service_get_secret_for_dbus_path (self, unlocked[0],
|
||||
closure->cancellable,
|
||||
on_lookup_get_secret,
|
||||
g_object_ref (res));
|
||||
|
||||
} else if (locked && locked[0]) {
|
||||
const gchar *paths[] = { locked[0], NULL };
|
||||
secret_service_unlock_paths (self, paths,
|
||||
secret_service_unlock_dbus_paths (self, paths,
|
||||
closure->cancellable,
|
||||
on_lookup_unlocked,
|
||||
g_object_ref (res));
|
||||
@ -1510,7 +1494,7 @@ on_delete_password_complete (GObject *source,
|
||||
DeleteClosure *closure = g_simple_async_result_get_op_res_gpointer (res);
|
||||
GError *error = NULL;
|
||||
|
||||
closure->deleted = secret_service_delete_path_finish (SECRET_SERVICE (source), result, &error);
|
||||
closure->deleted = _secret_service_delete_path_finish (SECRET_SERVICE (source), result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
|
||||
@ -1531,7 +1515,7 @@ on_delete_searched (GObject *source,
|
||||
gchar **locked;
|
||||
gchar **unlocked;
|
||||
|
||||
secret_service_search_for_paths_finish (SECRET_SERVICE (source), result, &unlocked, &locked, &error);
|
||||
secret_service_search_for_dbus_paths_finish (SECRET_SERVICE (source), result, &unlocked, &locked, &error);
|
||||
if (error != NULL) {
|
||||
g_simple_async_result_take_error (res, error);
|
||||
g_simple_async_result_complete (res);
|
||||
@ -1765,7 +1749,7 @@ on_read_alias_collection (GObject *source,
|
||||
ReadClosure *read = g_simple_async_result_get_op_res_gpointer (async);
|
||||
GError *error = NULL;
|
||||
|
||||
read->collection = secret_collection_new_finish (result, &error);
|
||||
read->collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (async, error);
|
||||
|
||||
@ -1784,7 +1768,7 @@ on_read_alias_path (GObject *source,
|
||||
GError *error = NULL;
|
||||
gchar *collection_path;
|
||||
|
||||
collection_path = secret_service_read_alias_path_finish (self, result, &error);
|
||||
collection_path = secret_service_read_alias_dbus_path_finish (self, result, &error);
|
||||
if (error == NULL) {
|
||||
|
||||
/* No collection for this alias */
|
||||
@ -1799,9 +1783,11 @@ on_read_alias_path (GObject *source,
|
||||
|
||||
/* No collection loaded, but valid path, load */
|
||||
} else {
|
||||
secret_collection_new (self, collection_path, SECRET_COLLECTION_NONE,
|
||||
secret_collection_new_for_dbus_path (self, collection_path,
|
||||
SECRET_COLLECTION_NONE,
|
||||
read->cancellable,
|
||||
on_read_alias_collection, g_object_ref (async));
|
||||
on_read_alias_collection,
|
||||
g_object_ref (async));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1826,7 +1812,7 @@ on_read_alias_service (GObject *source,
|
||||
|
||||
service = secret_service_get_finish (result, &error);
|
||||
if (error == NULL) {
|
||||
secret_service_read_alias_path (service, read->alias, read->cancellable,
|
||||
secret_service_read_alias_dbus_path (service, read->alias, read->cancellable,
|
||||
on_read_alias_path, g_object_ref (async));
|
||||
g_object_unref (service);
|
||||
|
||||
@ -1879,7 +1865,7 @@ secret_service_read_alias (SecretService *service,
|
||||
secret_service_get (SECRET_SERVICE_NONE, cancellable,
|
||||
on_read_alias_service, g_object_ref (async));
|
||||
} else {
|
||||
secret_service_read_alias_path (service, read->alias, read->cancellable,
|
||||
secret_service_read_alias_dbus_path (service, read->alias, read->cancellable,
|
||||
on_read_alias_path, g_object_ref (async));
|
||||
}
|
||||
|
||||
@ -1950,7 +1936,7 @@ secret_service_read_alias_sync (SecretService *service,
|
||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
collection_path = secret_service_read_alias_path_sync (service, alias,
|
||||
collection_path = secret_service_read_alias_dbus_path_sync (service, alias,
|
||||
cancellable, error);
|
||||
if (collection_path == NULL)
|
||||
return NULL;
|
||||
@ -1965,7 +1951,7 @@ secret_service_read_alias_sync (SecretService *service,
|
||||
|
||||
/* No collection loaded, but valid path, load */
|
||||
if (collection == NULL) {
|
||||
collection = secret_collection_new_sync (service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (service, collection_path,
|
||||
SECRET_COLLECTION_LOAD_ITEMS,
|
||||
cancellable, error);
|
||||
}
|
||||
@ -2021,7 +2007,7 @@ secret_service_set_alias (SecretService *service,
|
||||
g_object_ref (service);
|
||||
}
|
||||
|
||||
secret_service_set_alias_path (service, alias, collection_path, cancellable,
|
||||
secret_service_set_alias_to_dbus_path (service, alias, collection_path, cancellable,
|
||||
callback, user_data);
|
||||
|
||||
g_object_unref (service);
|
||||
@ -2052,7 +2038,7 @@ secret_service_set_alias_finish (SecretService *service,
|
||||
else
|
||||
g_object_ref (service);
|
||||
|
||||
ret = secret_service_set_alias_path_finish (service, result, error);
|
||||
ret = secret_service_set_alias_to_dbus_path_finish (service, result, error);
|
||||
|
||||
g_object_unref (service);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -22,6 +22,8 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
#include "secret-collection.h"
|
||||
#include "secret-item.h"
|
||||
#include "secret-prompt.h"
|
||||
#include "secret-schema.h"
|
||||
#include "secret-types.h"
|
||||
@ -29,20 +31,56 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void secret_service_search_for_paths (SecretService *self,
|
||||
|
||||
void secret_collection_new_for_dbus_path (SecretService *service,
|
||||
const gchar *collection_path,
|
||||
SecretCollectionFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
SecretCollection * secret_collection_new_for_dbus_path_finish (GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
SecretCollection * secret_collection_new_for_dbus_path_sync (SecretService *service,
|
||||
const gchar *collection_path,
|
||||
SecretCollectionFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
||||
void secret_item_new_for_dbus_path (SecretService *service,
|
||||
const gchar *item_path,
|
||||
SecretItemFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
SecretItem * secret_item_new_for_dbus_path_finish (GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
SecretItem * secret_item_new_for_dbus_path_sync (SecretService *service,
|
||||
const gchar *item_path,
|
||||
SecretItemFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
const gchar * secret_service_get_session_dbus_path (SecretService *self);
|
||||
|
||||
void secret_service_search_for_dbus_paths (SecretService *self,
|
||||
const SecretSchema *schema,
|
||||
GHashTable *attributes,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean secret_service_search_for_paths_finish (SecretService *self,
|
||||
gboolean secret_service_search_for_dbus_paths_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
gchar ***unlocked,
|
||||
gchar ***locked,
|
||||
GError **error);
|
||||
|
||||
gboolean secret_service_search_for_paths_sync (SecretService *self,
|
||||
gboolean secret_service_search_for_dbus_paths_sync (SecretService *self,
|
||||
const SecretSchema *schema,
|
||||
GHashTable *attributes,
|
||||
GCancellable *cancellable,
|
||||
@ -50,120 +88,120 @@ gboolean secret_service_search_for_paths_sync (SecretService
|
||||
gchar ***locked,
|
||||
GError **error);
|
||||
|
||||
void secret_service_get_secret_for_path (SecretService *self,
|
||||
void secret_service_get_secret_for_dbus_path (SecretService *self,
|
||||
const gchar *item_path,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
SecretValue * secret_service_get_secret_for_path_finish (SecretService *self,
|
||||
SecretValue * secret_service_get_secret_for_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
SecretValue * secret_service_get_secret_for_path_sync (SecretService *self,
|
||||
SecretValue * secret_service_get_secret_for_dbus_path_sync (SecretService *self,
|
||||
const gchar *item_path,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_service_get_secrets_for_paths (SecretService *self,
|
||||
void secret_service_get_secrets_for_dbus_paths (SecretService *self,
|
||||
const gchar **item_paths,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
GHashTable * secret_service_get_secrets_for_paths_finish (SecretService *self,
|
||||
GHashTable * secret_service_get_secrets_for_dbus_paths_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
GHashTable * secret_service_get_secrets_for_paths_sync (SecretService *self,
|
||||
GHashTable * secret_service_get_secrets_for_dbus_paths_sync (SecretService *self,
|
||||
const gchar **item_paths,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
gint secret_service_lock_paths_sync (SecretService *self,
|
||||
gint secret_service_lock_dbus_paths_sync (SecretService *self,
|
||||
const gchar **paths,
|
||||
GCancellable *cancellable,
|
||||
gchar ***locked,
|
||||
GError **error);
|
||||
|
||||
void secret_service_lock_paths (SecretService *self,
|
||||
void secret_service_lock_dbus_paths (SecretService *self,
|
||||
const gchar **paths,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gint secret_service_lock_paths_finish (SecretService *self,
|
||||
gint secret_service_lock_dbus_paths_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
gchar ***locked,
|
||||
GError **error);
|
||||
|
||||
gint secret_service_unlock_paths_sync (SecretService *self,
|
||||
gint secret_service_unlock_dbus_paths_sync (SecretService *self,
|
||||
const gchar **paths,
|
||||
GCancellable *cancellable,
|
||||
gchar ***unlocked,
|
||||
GError **error);
|
||||
|
||||
void secret_service_unlock_paths (SecretService *self,
|
||||
void secret_service_unlock_dbus_paths (SecretService *self,
|
||||
const gchar **paths,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gint secret_service_unlock_paths_finish (SecretService *self,
|
||||
gint secret_service_unlock_dbus_paths_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
gchar ***unlocked,
|
||||
GError **error);
|
||||
|
||||
GVariant * secret_service_prompt_path_sync (SecretService *self,
|
||||
GVariant * secret_service_prompt_at_dbus_path_sync (SecretService *self,
|
||||
const gchar *prompt_path,
|
||||
GCancellable *cancellable,
|
||||
const GVariantType *return_type,
|
||||
GError **error);
|
||||
|
||||
void secret_service_prompt_path (SecretService *self,
|
||||
void secret_service_prompt_at_dbus_path (SecretService *self,
|
||||
const gchar *prompt_path,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
GVariant * secret_service_prompt_path_finish (SecretService *self,
|
||||
GVariant * secret_service_prompt_at_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
const GVariantType *return_type,
|
||||
GError **error);
|
||||
|
||||
void secret_service_delete_path (SecretService *self,
|
||||
void secret_service_delete_item_dbus_path (SecretService *self,
|
||||
const gchar *item_path,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean secret_service_delete_path_finish (SecretService *self,
|
||||
gboolean secret_service_delete_item_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
gboolean secret_service_delete_path_sync (SecretService *self,
|
||||
gboolean secret_service_delete_item_dbus_path_sync (SecretService *self,
|
||||
const gchar *item_path,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_service_create_collection_path (SecretService *self,
|
||||
void secret_service_create_collection_dbus_path (SecretService *self,
|
||||
GHashTable *properties,
|
||||
const gchar *alias,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gchar * secret_service_create_collection_path_finish (SecretService *self,
|
||||
gchar * secret_service_create_collection_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
gchar * secret_service_create_collection_path_sync (SecretService *self,
|
||||
gchar * secret_service_create_collection_dbus_path_sync (SecretService *self,
|
||||
GHashTable *properties,
|
||||
const gchar *alias,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_service_create_item_path (SecretService *self,
|
||||
void secret_service_create_item_dbus_path (SecretService *self,
|
||||
const gchar *collection_path,
|
||||
GHashTable *properties,
|
||||
SecretValue *value,
|
||||
@ -172,11 +210,11 @@ void secret_service_create_item_path (SecretService
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gchar * secret_service_create_item_path_finish (SecretService *self,
|
||||
gchar * secret_service_create_item_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
gchar * secret_service_create_item_path_sync (SecretService *self,
|
||||
gchar * secret_service_create_item_dbus_path_sync (SecretService *self,
|
||||
const gchar *collection_path,
|
||||
GHashTable *properties,
|
||||
SecretValue *value,
|
||||
@ -184,33 +222,33 @@ gchar * secret_service_create_item_path_sync (SecretService
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_service_read_alias_path (SecretService *self,
|
||||
void secret_service_read_alias_dbus_path (SecretService *self,
|
||||
const gchar *alias,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gchar * secret_service_read_alias_path_finish (SecretService *self,
|
||||
gchar * secret_service_read_alias_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
gchar * secret_service_read_alias_path_sync (SecretService *self,
|
||||
gchar * secret_service_read_alias_dbus_path_sync (SecretService *self,
|
||||
const gchar *alias,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void secret_service_set_alias_path (SecretService *self,
|
||||
void secret_service_set_alias_to_dbus_path (SecretService *self,
|
||||
const gchar *alias,
|
||||
const gchar *collection_path,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean secret_service_set_alias_path_finish (SecretService *self,
|
||||
gboolean secret_service_set_alias_to_dbus_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
gboolean secret_service_set_alias_path_sync (SecretService *self,
|
||||
gboolean secret_service_set_alias_to_dbus_path_sync (SecretService *self,
|
||||
const gchar *alias,
|
||||
const gchar *collection_path,
|
||||
GCancellable *cancellable,
|
||||
|
@ -127,6 +127,10 @@ void _secret_service_delete_path (SecretService *se
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _secret_service_delete_path_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
void _secret_service_search_for_paths_variant (SecretService *self,
|
||||
GVariant *attributes,
|
||||
GCancellable *cancellable,
|
||||
|
@ -1145,7 +1145,7 @@ secret_service_get_session_algorithms (SecretService *self)
|
||||
}
|
||||
|
||||
/**
|
||||
* secret_service_get_session_path:
|
||||
* secret_service_get_session_dbus_path:
|
||||
* @self: the secret service proxy
|
||||
*
|
||||
* Get the D-Bus object path of the session object being used to transfer
|
||||
@ -1158,7 +1158,7 @@ secret_service_get_session_algorithms (SecretService *self)
|
||||
* session
|
||||
*/
|
||||
const gchar *
|
||||
secret_service_get_session_path (SecretService *self)
|
||||
secret_service_get_session_dbus_path (SecretService *self)
|
||||
{
|
||||
SecretSession *session;
|
||||
const gchar *path;
|
||||
@ -1227,24 +1227,24 @@ secret_service_ensure_session (SecretService *self,
|
||||
* Finish an asynchronous operation to ensure that the #SecretService proxy
|
||||
* has established a session with the Secret Service.
|
||||
*
|
||||
* Returns: the path of the established session
|
||||
* Returns: whether a session is established or not
|
||||
*/
|
||||
const gchar *
|
||||
gboolean
|
||||
secret_service_ensure_session_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (SECRET_IS_SERVICE (self), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
g_return_val_if_fail (SECRET_IS_SERVICE (self), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
if (!g_simple_async_result_is_valid (result, G_OBJECT (self),
|
||||
secret_service_ensure_session)) {
|
||||
if (!_secret_session_open_finish (result, error))
|
||||
return NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_return_val_if_fail (self->pv->session != NULL, NULL);
|
||||
return secret_service_get_session_path (self);
|
||||
g_return_val_if_fail (self->pv->session != NULL, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1264,19 +1264,19 @@ secret_service_ensure_session_finish (SecretService *self,
|
||||
* This method may block indefinitely and should not be used in user interface
|
||||
* threads.
|
||||
*
|
||||
* Returns: the path of the established session
|
||||
* Returns: whether a session is established or not
|
||||
*/
|
||||
const gchar *
|
||||
gboolean
|
||||
secret_service_ensure_session_sync (SecretService *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
SecretSync *sync;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
g_return_val_if_fail (SECRET_IS_SERVICE (self), NULL);
|
||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
g_return_val_if_fail (SECRET_IS_SERVICE (self), FALSE);
|
||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
sync = _secret_sync_new ();
|
||||
g_main_context_push_thread_default (sync->context);
|
||||
@ -1286,12 +1286,12 @@ secret_service_ensure_session_sync (SecretService *self,
|
||||
|
||||
g_main_loop_run (sync->loop);
|
||||
|
||||
path = secret_service_ensure_session_finish (self, sync->result, error);
|
||||
ret = secret_service_ensure_session_finish (self, sync->result, error);
|
||||
|
||||
g_main_context_pop_thread_default (sync->context);
|
||||
_secret_sync_free (sync);
|
||||
|
||||
return path;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static SecretCollection *
|
||||
@ -1370,7 +1370,7 @@ on_ensure_collection (GObject *source,
|
||||
|
||||
closure->collections_loading--;
|
||||
|
||||
collection = secret_collection_new_finish (result, &error);
|
||||
collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
@ -1438,8 +1438,8 @@ secret_service_load_collections (SecretService *self,
|
||||
|
||||
/* No such collection yet create a new one */
|
||||
if (collection == NULL) {
|
||||
secret_collection_new (self, path, SECRET_COLLECTION_LOAD_ITEMS, cancellable,
|
||||
on_ensure_collection, g_object_ref (res));
|
||||
secret_collection_new_for_dbus_path (self, path, SECRET_COLLECTION_LOAD_ITEMS,
|
||||
cancellable, on_ensure_collection, g_object_ref (res));
|
||||
closure->collections_loading++;
|
||||
} else {
|
||||
g_hash_table_insert (closure->collections, g_strdup (path), collection);
|
||||
@ -1528,7 +1528,7 @@ secret_service_load_collections_sync (SecretService *self,
|
||||
|
||||
/* No such collection yet create a new one */
|
||||
if (collection == NULL) {
|
||||
collection = secret_collection_new_sync (self, path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (self, path,
|
||||
SECRET_COLLECTION_LOAD_ITEMS,
|
||||
cancellable, error);
|
||||
if (collection == NULL) {
|
||||
|
@ -122,8 +122,6 @@ SecretServiceFlags secret_service_get_flags (SecretService
|
||||
|
||||
const gchar * secret_service_get_session_algorithms (SecretService *self);
|
||||
|
||||
const gchar * secret_service_get_session_path (SecretService *self);
|
||||
|
||||
GList * secret_service_get_collections (SecretService *self);
|
||||
|
||||
void secret_service_ensure_session (SecretService *self,
|
||||
@ -131,11 +129,11 @@ void secret_service_ensure_session (SecretService
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
const gchar * secret_service_ensure_session_finish (SecretService *self,
|
||||
gboolean secret_service_ensure_session_finish (SecretService *self,
|
||||
GAsyncResult *result,
|
||||
GError **error);
|
||||
|
||||
const gchar * secret_service_ensure_session_sync (SecretService *self,
|
||||
gboolean secret_service_ensure_session_sync (SecretService *self,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
#include "secret-collection.h"
|
||||
#include "secret-service.h"
|
||||
#include "secret-paths.h"
|
||||
#include "secret-private.h"
|
||||
|
||||
#include "mock-service.h"
|
||||
@ -89,7 +90,7 @@ test_new_sync (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretCollection *collection;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -108,13 +109,13 @@ test_new_async (Test *test,
|
||||
SecretCollection *collection;
|
||||
GAsyncResult *result = NULL;
|
||||
|
||||
secret_collection_new (test->service, collection_path,
|
||||
secret_collection_new_for_dbus_path (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
collection = secret_collection_new_finish (result, &error);
|
||||
collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -132,7 +133,7 @@ test_new_sync_noexist (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretCollection *collection;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (collection == NULL);
|
||||
@ -147,13 +148,13 @@ test_new_async_noexist (Test *test,
|
||||
SecretCollection *collection;
|
||||
GAsyncResult *result = NULL;
|
||||
|
||||
secret_collection_new (test->service, collection_path,
|
||||
secret_collection_new_for_dbus_path (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
collection = secret_collection_new_finish (result, &error);
|
||||
collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (collection == NULL);
|
||||
g_object_unref (result);
|
||||
@ -216,7 +217,7 @@ test_properties (Test *test,
|
||||
gboolean locked;
|
||||
gchar *label;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -287,7 +288,7 @@ test_items (Test *test,
|
||||
GError *error = NULL;
|
||||
GList *items;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_LOAD_ITEMS, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -319,7 +320,7 @@ test_items_empty (Test *test,
|
||||
GError *error = NULL;
|
||||
GList *items;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_LOAD_ITEMS, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -344,14 +345,14 @@ test_items_empty_async (Test *test,
|
||||
GError *error = NULL;
|
||||
GList *items;
|
||||
|
||||
secret_collection_new (test->service, collection_path,
|
||||
secret_collection_new_for_dbus_path (test->service, collection_path,
|
||||
SECRET_COLLECTION_LOAD_ITEMS,
|
||||
NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
collection = secret_collection_new_finish (result, &error);
|
||||
collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -376,7 +377,7 @@ test_set_label_sync (Test *test,
|
||||
gboolean ret;
|
||||
gchar *label;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -406,7 +407,7 @@ test_set_label_async (Test *test,
|
||||
gboolean ret;
|
||||
gchar *label;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -442,10 +443,11 @@ test_set_label_prop (Test *test,
|
||||
guint sigs = 2;
|
||||
gchar *label;
|
||||
|
||||
secret_collection_new (test->service, collection_path, SECRET_COLLECTION_NONE, NULL, on_async_result, &result);
|
||||
secret_collection_new_for_dbus_path (test->service, collection_path, SECRET_COLLECTION_NONE,
|
||||
NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
egg_test_wait ();
|
||||
collection = secret_collection_new_finish (result, &error);
|
||||
collection = secret_collection_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -475,7 +477,7 @@ test_delete_sync (Test *test,
|
||||
GError *error = NULL;
|
||||
gboolean ret;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -485,7 +487,7 @@ test_delete_sync (Test *test,
|
||||
|
||||
g_object_unref (collection);
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (collection == NULL);
|
||||
@ -501,7 +503,7 @@ test_delete_async (Test *test,
|
||||
GError *error = NULL;
|
||||
gboolean ret;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -517,7 +519,7 @@ test_delete_async (Test *test,
|
||||
|
||||
g_object_unref (collection);
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (collection == NULL);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "secret-collection.h"
|
||||
#include "secret-item.h"
|
||||
#include "secret-service.h"
|
||||
#include "secret-paths.h"
|
||||
#include "secret-private.h"
|
||||
|
||||
#include "mock-service.h"
|
||||
@ -90,7 +91,7 @@ test_new_sync (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretItem *item;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert_cmpstr (g_dbus_proxy_get_object_path (G_DBUS_PROXY (item)), ==, item_path);
|
||||
@ -106,7 +107,7 @@ test_new_sync_noexist (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretItem *item;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (item == NULL);
|
||||
}
|
||||
@ -120,13 +121,13 @@ test_new_async (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretItem *item;
|
||||
|
||||
secret_item_new (test->service, item_path, SECRET_ITEM_NONE,
|
||||
secret_item_new_for_dbus_path (test->service, item_path, SECRET_ITEM_NONE,
|
||||
NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
item = secret_item_new_finish (result, &error);
|
||||
item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -144,13 +145,13 @@ test_new_async_noexist (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretItem *item;
|
||||
|
||||
secret_item_new (test->service, item_path, SECRET_ITEM_NONE,
|
||||
secret_item_new_for_dbus_path (test->service, item_path, SECRET_ITEM_NONE,
|
||||
NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
item = secret_item_new_finish (result, &error);
|
||||
item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (item == NULL);
|
||||
g_object_unref (result);
|
||||
@ -167,7 +168,7 @@ test_create_sync (Test *test,
|
||||
GHashTable *attributes;
|
||||
SecretValue *value;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -206,7 +207,7 @@ test_create_async (Test *test,
|
||||
GHashTable *attributes;
|
||||
SecretValue *value;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -253,7 +254,7 @@ test_properties (Test *test,
|
||||
gboolean locked;
|
||||
gchar *label;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (secret_item_get_locked (item) == FALSE);
|
||||
@ -309,7 +310,7 @@ test_set_label_sync (Test *test,
|
||||
gboolean ret;
|
||||
gchar *label;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
label = secret_item_get_label (item);
|
||||
@ -338,7 +339,7 @@ test_set_label_async (Test *test,
|
||||
gboolean ret;
|
||||
gchar *label;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
label = secret_item_get_label (item);
|
||||
@ -373,10 +374,10 @@ test_set_label_prop (Test *test,
|
||||
guint sigs = 2;
|
||||
gchar *label;
|
||||
|
||||
secret_item_new (test->service, item_path, SECRET_ITEM_NONE, NULL, on_async_result, &result);
|
||||
secret_item_new_for_dbus_path (test->service, item_path, SECRET_ITEM_NONE, NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
egg_test_wait ();
|
||||
item = secret_item_new_finish (result, &error);
|
||||
item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -407,7 +408,7 @@ test_set_attributes_sync (Test *test,
|
||||
gboolean ret;
|
||||
GHashTable *attributes;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
attributes = secret_item_get_attributes (item);
|
||||
@ -445,7 +446,7 @@ test_set_attributes_async (Test *test,
|
||||
SecretItem *item;
|
||||
gboolean ret;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
attributes = secret_item_get_attributes (item);
|
||||
@ -488,10 +489,10 @@ test_set_attributes_prop (Test *test,
|
||||
GHashTable *attributes;
|
||||
guint sigs = 2;
|
||||
|
||||
secret_item_new (test->service, item_path, SECRET_ITEM_NONE, NULL, on_async_result, &result);
|
||||
secret_item_new_for_dbus_path (test->service, item_path, SECRET_ITEM_NONE, NULL, on_async_result, &result);
|
||||
g_assert (result == NULL);
|
||||
egg_test_wait ();
|
||||
item = secret_item_new_finish (result, &error);
|
||||
item = secret_item_new_for_dbus_path_finish (result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -534,7 +535,7 @@ test_load_secret_sync (Test *test,
|
||||
gboolean ret;
|
||||
gsize length;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
value = secret_item_get_secret (item);
|
||||
@ -568,7 +569,7 @@ test_load_secret_async (Test *test,
|
||||
gboolean ret;
|
||||
gsize length;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
value = secret_item_get_secret (item);
|
||||
@ -610,7 +611,7 @@ test_set_secret_sync (Test *test,
|
||||
|
||||
value = secret_value_new ("Sinking", -1, "strange/content-type");
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
ret = secret_item_set_secret_sync (item, value, NULL, &error);
|
||||
@ -653,9 +654,9 @@ test_secrets_sync (Test *test,
|
||||
gboolean ret;
|
||||
gsize length;
|
||||
|
||||
item_one = secret_item_new_sync (test->service, path_item_one, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_two = secret_item_new_sync (test->service, path_item_two, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_three = secret_item_new_sync (test->service, path_item_three, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_one = secret_item_new_for_dbus_path_sync (test->service, path_item_one, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_two = secret_item_new_for_dbus_path_sync (test->service, path_item_two, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_three = secret_item_new_for_dbus_path_sync (test->service, path_item_three, SECRET_ITEM_NONE, NULL, &error);
|
||||
|
||||
items = g_list_append (items, item_one);
|
||||
items = g_list_append (items, item_two);
|
||||
@ -702,13 +703,13 @@ test_secrets_async (Test *test,
|
||||
gsize length;
|
||||
gboolean ret;
|
||||
|
||||
item_one = secret_item_new_sync (test->service, path_item_one, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_one = secret_item_new_for_dbus_path_sync (test->service, path_item_one, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
item_two = secret_item_new_sync (test->service, path_item_two, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_two = secret_item_new_for_dbus_path_sync (test->service, path_item_two, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
item_three = secret_item_new_sync (test->service, path_item_three, SECRET_ITEM_NONE, NULL, &error);
|
||||
item_three = secret_item_new_for_dbus_path_sync (test->service, path_item_three, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
|
||||
@ -759,7 +760,7 @@ test_delete_sync (Test *test,
|
||||
SecretItem *item;
|
||||
gboolean ret;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
ret = secret_item_delete_sync (item, NULL, &error);
|
||||
@ -768,7 +769,7 @@ test_delete_sync (Test *test,
|
||||
|
||||
g_object_unref (item);
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (item == NULL);
|
||||
}
|
||||
@ -783,7 +784,7 @@ test_delete_async (Test *test,
|
||||
SecretItem *item;
|
||||
gboolean ret;
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
secret_item_delete (item, NULL, on_async_result, &result);
|
||||
@ -797,7 +798,7 @@ test_delete_async (Test *test,
|
||||
|
||||
g_object_unref (item);
|
||||
|
||||
item = secret_item_new_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
item = secret_item_new_for_dbus_path_sync (test->service, item_path, SECRET_ITEM_NONE, NULL, &error);
|
||||
g_assert_error (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD);
|
||||
g_assert (item == NULL);
|
||||
}
|
||||
|
@ -398,7 +398,7 @@ test_lock_sync (Test *test,
|
||||
GList *objects;
|
||||
gboolean ret;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -428,7 +428,7 @@ test_unlock_sync (Test *test,
|
||||
GList *objects;
|
||||
gboolean ret;
|
||||
|
||||
collection = secret_collection_new_sync (test->service, collection_path,
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service, collection_path,
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -736,7 +736,7 @@ test_store_sync (Test *test,
|
||||
g_hash_table_insert (attributes, "string", "seventeen");
|
||||
g_hash_table_insert (attributes, "number", "17");
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||
NULL, &paths, NULL, &error);
|
||||
g_hash_table_unref (attributes);
|
||||
g_assert (ret == TRUE);
|
||||
@ -745,7 +745,7 @@ test_store_sync (Test *test,
|
||||
g_assert (paths[0] != NULL);
|
||||
g_assert (paths[1] == NULL);
|
||||
|
||||
value = secret_service_get_secret_for_path_sync (test->service, paths[0],
|
||||
value = secret_service_get_secret_for_dbus_path_sync (test->service, paths[0],
|
||||
NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -789,7 +789,7 @@ test_store_replace (Test *test,
|
||||
g_hash_table_insert (attributes, "string", "seventeen");
|
||||
g_hash_table_insert (attributes, "number", "17");
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||
NULL, &paths, NULL, &error);
|
||||
g_hash_table_unref (attributes);
|
||||
g_assert (ret == TRUE);
|
||||
@ -837,7 +837,7 @@ test_store_async (Test *test,
|
||||
g_hash_table_insert (attributes, "string", "seventeen");
|
||||
g_hash_table_insert (attributes, "number", "17");
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||
NULL, &paths, NULL, &error);
|
||||
g_hash_table_unref (attributes);
|
||||
g_assert (ret == TRUE);
|
||||
@ -846,7 +846,7 @@ test_store_async (Test *test,
|
||||
g_assert (paths[0] != NULL);
|
||||
g_assert (paths[1] == NULL);
|
||||
|
||||
value = secret_service_get_secret_for_path_sync (test->service, paths[0],
|
||||
value = secret_service_get_secret_for_dbus_path_sync (test->service, paths[0],
|
||||
NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
@ -925,7 +925,8 @@ test_set_alias_sync (Test *test,
|
||||
g_assert_no_error (error);
|
||||
g_assert (blah == NULL);
|
||||
|
||||
collection = secret_collection_new_sync (test->service, "/org/freedesktop/secrets/collection/english",
|
||||
collection = secret_collection_new_for_dbus_path_sync (test->service,
|
||||
"/org/freedesktop/secrets/collection/english",
|
||||
SECRET_COLLECTION_NONE, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (SECRET_IS_COLLECTION (collection));
|
||||
|
@ -130,7 +130,7 @@ test_search_paths_sync (Test *test,
|
||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
g_hash_table_insert (attributes, "number", "1");
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
&unlocked, &locked, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
@ -161,12 +161,12 @@ test_search_paths_async (Test *test,
|
||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
g_hash_table_insert (attributes, "number", "1");
|
||||
|
||||
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
secret_service_search_for_dbus_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
on_complete_get_result, &result);
|
||||
egg_test_wait ();
|
||||
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
ret = secret_service_search_for_paths_finish (test->service, result,
|
||||
ret = secret_service_search_for_dbus_paths_finish (test->service, result,
|
||||
&unlocked, &locked,
|
||||
&error);
|
||||
g_assert_no_error (error);
|
||||
@ -198,7 +198,7 @@ test_search_paths_nulls (Test *test,
|
||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
g_hash_table_insert (attributes, "number", "1");
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
&paths, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
@ -206,7 +206,7 @@ test_search_paths_nulls (Test *test,
|
||||
g_assert_cmpstr (paths[0], ==, "/org/freedesktop/secrets/collection/english/1");
|
||||
g_strfreev (paths);
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
NULL, &paths, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
@ -214,16 +214,16 @@ test_search_paths_nulls (Test *test,
|
||||
g_assert_cmpstr (paths[0], ==, "/org/freedesktop/secrets/collection/spanish/10");
|
||||
g_strfreev (paths);
|
||||
|
||||
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
ret = secret_service_search_for_dbus_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
NULL, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
secret_service_search_for_dbus_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
on_complete_get_result, &result);
|
||||
egg_test_wait ();
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
ret = secret_service_search_for_paths_finish (test->service, result,
|
||||
ret = secret_service_search_for_dbus_paths_finish (test->service, result,
|
||||
&paths, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
@ -232,11 +232,11 @@ test_search_paths_nulls (Test *test,
|
||||
g_strfreev (paths);
|
||||
g_clear_object (&result);
|
||||
|
||||
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
secret_service_search_for_dbus_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
on_complete_get_result, &result);
|
||||
egg_test_wait ();
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
ret = secret_service_search_for_paths_finish (test->service, result,
|
||||
ret = secret_service_search_for_dbus_paths_finish (test->service, result,
|
||||
NULL, &paths, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
@ -245,11 +245,11 @@ test_search_paths_nulls (Test *test,
|
||||
g_strfreev (paths);
|
||||
g_clear_object (&result);
|
||||
|
||||
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
secret_service_search_for_dbus_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||
on_complete_get_result, &result);
|
||||
egg_test_wait ();
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
ret = secret_service_search_for_paths_finish (test->service, result,
|
||||
ret = secret_service_search_for_dbus_paths_finish (test->service, result,
|
||||
NULL, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
@ -269,7 +269,7 @@ test_secret_for_path_sync (Test *test,
|
||||
gsize length;
|
||||
|
||||
path = "/org/freedesktop/secrets/collection/english/1";
|
||||
value = secret_service_get_secret_for_path_sync (test->service, path, NULL, &error);
|
||||
value = secret_service_get_secret_for_dbus_path_sync (test->service, path, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (value != NULL);
|
||||
|
||||
@ -295,12 +295,12 @@ test_secret_for_path_async (Test *test,
|
||||
gsize length;
|
||||
|
||||
path = "/org/freedesktop/secrets/collection/english/1";
|
||||
secret_service_get_secret_for_path (test->service, path, NULL,
|
||||
secret_service_get_secret_for_dbus_path (test->service, path, NULL,
|
||||
on_complete_get_result, &result);
|
||||
g_assert (result == NULL);
|
||||
egg_test_wait ();
|
||||
|
||||
value = secret_service_get_secret_for_path_finish (test->service, result, &error);
|
||||
value = secret_service_get_secret_for_dbus_path_finish (test->service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (value != NULL);
|
||||
g_object_unref (result);
|
||||
@ -336,7 +336,7 @@ test_secrets_for_paths_sync (Test *test,
|
||||
const gchar *password;
|
||||
gsize length;
|
||||
|
||||
values = secret_service_get_secrets_for_paths_sync (test->service, paths, NULL, &error);
|
||||
values = secret_service_get_secrets_for_dbus_paths_sync (test->service, paths, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (values != NULL);
|
||||
@ -379,12 +379,12 @@ test_secrets_for_paths_async (Test *test,
|
||||
GAsyncResult *result = NULL;
|
||||
gsize length;
|
||||
|
||||
secret_service_get_secrets_for_paths (test->service, paths, NULL,
|
||||
secret_service_get_secrets_for_dbus_paths (test->service, paths, NULL,
|
||||
on_complete_get_result, &result);
|
||||
g_assert (result == NULL);
|
||||
egg_test_wait ();
|
||||
|
||||
values = secret_service_get_secrets_for_paths_finish (test->service, result, &error);
|
||||
values = secret_service_get_secrets_for_dbus_paths_finish (test->service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
@ -415,7 +415,7 @@ test_delete_for_path_sync (Test *test,
|
||||
GError *error = NULL;
|
||||
gboolean ret;
|
||||
|
||||
ret = secret_service_delete_path_sync (test->service, path_item_one, NULL, &error);
|
||||
ret = secret_service_delete_item_dbus_path_sync (test->service, path_item_one, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
}
|
||||
@ -429,7 +429,7 @@ test_delete_for_path_sync_prompt (Test *test,
|
||||
GError *error = NULL;
|
||||
gboolean ret;
|
||||
|
||||
ret = secret_service_delete_path_sync (test->service, path_item_one, NULL, &error);
|
||||
ret = secret_service_delete_item_dbus_path_sync (test->service, path_item_one, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
}
|
||||
@ -448,7 +448,7 @@ test_lock_paths_sync (Test *test,
|
||||
gchar **locked = NULL;
|
||||
gboolean ret;
|
||||
|
||||
ret = secret_service_lock_paths_sync (test->service, paths, NULL, &locked, &error);
|
||||
ret = secret_service_lock_dbus_paths_sync (test->service, paths, NULL, &locked, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
@ -472,7 +472,7 @@ test_lock_prompt_sync (Test *test,
|
||||
gchar **locked = NULL;
|
||||
gboolean ret;
|
||||
|
||||
ret = secret_service_lock_paths_sync (test->service, paths, NULL, &locked, &error);
|
||||
ret = secret_service_lock_dbus_paths_sync (test->service, paths, NULL, &locked, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
@ -496,7 +496,7 @@ test_unlock_paths_sync (Test *test,
|
||||
gchar **unlocked = NULL;
|
||||
gboolean ret;
|
||||
|
||||
ret = secret_service_unlock_paths_sync (test->service, paths, NULL, &unlocked, &error);
|
||||
ret = secret_service_unlock_dbus_paths_sync (test->service, paths, NULL, &unlocked, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
@ -520,7 +520,7 @@ test_unlock_prompt_sync (Test *test,
|
||||
gchar **unlocked = NULL;
|
||||
gboolean ret;
|
||||
|
||||
ret = secret_service_unlock_paths_sync (test->service, paths, NULL, &unlocked, &error);
|
||||
ret = secret_service_unlock_dbus_paths_sync (test->service, paths, NULL, &unlocked, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
@ -543,7 +543,7 @@ test_collection_sync (Test *test,
|
||||
g_hash_table_insert (properties, SECRET_COLLECTION_INTERFACE ".Label",
|
||||
g_variant_ref_sink (g_variant_new_string ("Wheeee")));
|
||||
|
||||
path = secret_service_create_collection_path_sync (test->service, properties,
|
||||
path = secret_service_create_collection_dbus_path_sync (test->service, properties,
|
||||
NULL, NULL, &error);
|
||||
|
||||
g_hash_table_unref (properties);
|
||||
@ -569,7 +569,7 @@ test_collection_async (Test *test,
|
||||
g_hash_table_insert (properties, SECRET_COLLECTION_INTERFACE ".Label",
|
||||
g_variant_ref_sink (g_variant_new_string ("Wheeee")));
|
||||
|
||||
secret_service_create_collection_path (test->service, properties,
|
||||
secret_service_create_collection_dbus_path (test->service, properties,
|
||||
NULL, NULL, on_complete_get_result, &result);
|
||||
|
||||
g_hash_table_unref (properties);
|
||||
@ -577,7 +577,7 @@ test_collection_async (Test *test,
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
path = secret_service_create_collection_path_finish (test->service, result, &error);
|
||||
path = secret_service_create_collection_dbus_path_finish (test->service, result, &error);
|
||||
g_object_unref (result);
|
||||
|
||||
g_assert_no_error (error);
|
||||
@ -614,7 +614,7 @@ test_item_sync (Test *test,
|
||||
|
||||
value = secret_value_new ("andmoreandmore", -1, "text/plain");
|
||||
|
||||
path = secret_service_create_item_path_sync (test->service, collection_path,
|
||||
path = secret_service_create_item_dbus_path_sync (test->service, collection_path,
|
||||
properties, value, FALSE,
|
||||
NULL, &error);
|
||||
|
||||
@ -656,7 +656,7 @@ test_item_async (Test *test,
|
||||
|
||||
value = secret_value_new ("andmoreandmore", -1, "text/plain");
|
||||
|
||||
secret_service_create_item_path (test->service, collection_path,
|
||||
secret_service_create_item_dbus_path (test->service, collection_path,
|
||||
properties, value, FALSE,
|
||||
NULL, on_complete_get_result, &result);
|
||||
|
||||
@ -666,7 +666,7 @@ test_item_async (Test *test,
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
path = secret_service_create_item_path_finish (test->service, result, &error);
|
||||
path = secret_service_create_item_dbus_path_finish (test->service, result, &error);
|
||||
g_object_unref (result);
|
||||
|
||||
g_assert_no_error (error);
|
||||
@ -684,24 +684,24 @@ test_set_alias_path (Test *test,
|
||||
GError *error = NULL;
|
||||
gboolean ret;
|
||||
|
||||
path = secret_service_read_alias_path_sync (test->service, "blah", NULL, &error);
|
||||
path = secret_service_read_alias_dbus_path_sync (test->service, "blah", NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path == NULL);
|
||||
|
||||
ret = secret_service_set_alias_path_sync (test->service, "blah", "/org/freedesktop/secrets/collection/english", NULL, &error);
|
||||
ret = secret_service_set_alias_to_dbus_path_sync (test->service, "blah", "/org/freedesktop/secrets/collection/english", NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
path = secret_service_read_alias_path_sync (test->service, "blah", NULL, &error);
|
||||
path = secret_service_read_alias_dbus_path_sync (test->service, "blah", NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert_cmpstr (path, ==, "/org/freedesktop/secrets/collection/english");
|
||||
g_free (path);
|
||||
|
||||
ret = secret_service_set_alias_path_sync (test->service, "blah", NULL, NULL, &error);
|
||||
ret = secret_service_set_alias_to_dbus_path_sync (test->service, "blah", NULL, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
path = secret_service_read_alias_path_sync (test->service, "blah", NULL, &error);
|
||||
path = secret_service_read_alias_dbus_path_sync (test->service, "blah", NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path == NULL);
|
||||
}
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "secret-collection.h"
|
||||
#include "secret-item.h"
|
||||
#include "secret-service.h"
|
||||
#include "secret-paths.h"
|
||||
#include "secret-private.h"
|
||||
|
||||
#include "mock-service.h"
|
||||
@ -177,7 +178,7 @@ test_get_more_sync (Test *test,
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_OPEN_SESSION | SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path != NULL);
|
||||
|
||||
g_object_unref (service2);
|
||||
@ -208,7 +209,7 @@ test_get_more_async (Test *test,
|
||||
result = NULL;
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_OPEN_SESSION | SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path != NULL);
|
||||
|
||||
collections = secret_service_get_collections (service);
|
||||
@ -231,7 +232,7 @@ test_get_more_async (Test *test,
|
||||
g_object_unref (result);
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path == NULL);
|
||||
|
||||
collections = secret_service_get_collections (service);
|
||||
@ -324,7 +325,7 @@ test_new_more_sync (Test *test,
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_NONE);
|
||||
g_assert (secret_service_get_collections (service) == NULL);
|
||||
g_assert (secret_service_get_session_path (service) == NULL);
|
||||
g_assert (secret_service_get_session_dbus_path (service) == NULL);
|
||||
|
||||
g_object_unref (service);
|
||||
egg_assert_not_object (service);
|
||||
@ -338,7 +339,7 @@ test_new_more_sync (Test *test,
|
||||
collections = secret_service_get_collections (service);
|
||||
g_assert (collections != NULL);
|
||||
g_list_free_full (collections, g_object_unref);
|
||||
g_assert (secret_service_get_session_path (service) == NULL);
|
||||
g_assert (secret_service_get_session_dbus_path (service) == NULL);
|
||||
|
||||
g_object_unref (service);
|
||||
egg_assert_not_object (service);
|
||||
@ -350,7 +351,7 @@ test_new_more_sync (Test *test,
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_OPEN_SESSION);
|
||||
g_assert (secret_service_get_collections (service) == NULL);
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path != NULL);
|
||||
|
||||
g_object_unref (service);
|
||||
@ -379,7 +380,7 @@ test_new_more_async (Test *test,
|
||||
result = NULL;
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_OPEN_SESSION | SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path != NULL);
|
||||
|
||||
collections = secret_service_get_collections (service);
|
||||
@ -402,7 +403,7 @@ test_new_more_async (Test *test,
|
||||
g_object_unref (result);
|
||||
|
||||
g_assert_cmpuint (secret_service_get_flags (service), ==, SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path == NULL);
|
||||
|
||||
collections = secret_service_get_collections (service);
|
||||
@ -433,7 +434,7 @@ test_connect_async (Test *test,
|
||||
g_assert_no_error (error);
|
||||
g_object_unref (result);
|
||||
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path == NULL);
|
||||
|
||||
g_object_unref (service);
|
||||
@ -461,7 +462,7 @@ test_connect_ensure_async (Test *test,
|
||||
g_assert (SECRET_IS_SERVICE (service));
|
||||
g_object_unref (result);
|
||||
|
||||
path = secret_service_get_session_path (service);
|
||||
path = secret_service_get_session_dbus_path (service);
|
||||
g_assert (path != NULL);
|
||||
|
||||
g_object_unref (service);
|
||||
@ -476,7 +477,6 @@ test_ensure_sync (Test *test,
|
||||
GError *error = NULL;
|
||||
SecretService *service;
|
||||
SecretServiceFlags flags;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
/* Passing true, ensures session is established */
|
||||
@ -495,9 +495,9 @@ test_ensure_sync (Test *test,
|
||||
g_object_get (service, "flags", &flags, NULL);
|
||||
g_assert_cmpuint (flags, ==, SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
|
||||
path = secret_service_ensure_session_sync (service, NULL, &error);
|
||||
ret = secret_service_ensure_session_sync (service, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path != NULL);
|
||||
g_assert (ret == TRUE);
|
||||
|
||||
flags = secret_service_get_flags (service);
|
||||
g_assert_cmpuint (flags, ==, SECRET_SERVICE_OPEN_SESSION | SECRET_SERVICE_LOAD_COLLECTIONS);
|
||||
@ -514,7 +514,6 @@ test_ensure_async (Test *test,
|
||||
SecretServiceFlags flags;
|
||||
SecretService *service;
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
/* Passing true, ensures session is established */
|
||||
@ -545,9 +544,9 @@ test_ensure_async (Test *test,
|
||||
|
||||
egg_test_wait ();
|
||||
|
||||
path = secret_service_ensure_session_finish (service, result, &error);
|
||||
ret = secret_service_ensure_session_finish (service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path != NULL);
|
||||
g_assert (ret == TRUE);
|
||||
g_object_unref (result);
|
||||
result = NULL;
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include "secret-item.h"
|
||||
#include "secret-service.h"
|
||||
#include "secret-paths.h"
|
||||
#include "secret-private.h"
|
||||
|
||||
#include "mock-service.h"
|
||||
@ -60,15 +61,15 @@ test_ensure (Test *test,
|
||||
gconstpointer unused)
|
||||
{
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), ==, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, NULL);
|
||||
|
||||
path = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
ret = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), !=, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "dh-ietf1024-sha256-aes128-cbc-pkcs7");
|
||||
}
|
||||
|
||||
@ -77,22 +78,26 @@ test_ensure_twice (Test *test,
|
||||
gconstpointer unused)
|
||||
{
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), ==, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, NULL);
|
||||
|
||||
path = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
ret = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), !=, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "dh-ietf1024-sha256-aes128-cbc-pkcs7");
|
||||
|
||||
path = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
path = g_strdup (secret_service_get_session_dbus_path (test->service));
|
||||
ret = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), ==, path);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "dh-ietf1024-sha256-aes128-cbc-pkcs7");
|
||||
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -100,16 +105,16 @@ test_ensure_plain (Test *test,
|
||||
gconstpointer unused)
|
||||
{
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), ==, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, NULL);
|
||||
|
||||
path = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
ret = secret_service_ensure_session_sync (test->service, NULL, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), !=, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "plain");
|
||||
}
|
||||
|
||||
@ -131,17 +136,17 @@ test_ensure_async_plain (Test *test,
|
||||
{
|
||||
GAsyncResult *result = NULL;
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
secret_service_ensure_session (test->service, NULL, on_complete_get_result, &result);
|
||||
egg_test_wait ();
|
||||
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
path = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
ret = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), !=, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "plain");
|
||||
|
||||
g_object_unref (result);
|
||||
@ -153,17 +158,17 @@ test_ensure_async_aes (Test *test,
|
||||
{
|
||||
GAsyncResult *result = NULL;
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
|
||||
secret_service_ensure_session (test->service, NULL, on_complete_get_result, &result);
|
||||
egg_test_wait_until (500);
|
||||
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
path = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
ret = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), !=, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "dh-ietf1024-sha256-aes128-cbc-pkcs7");
|
||||
|
||||
g_object_unref (result);
|
||||
@ -175,34 +180,37 @@ test_ensure_async_twice (Test *test,
|
||||
{
|
||||
GAsyncResult *result = NULL;
|
||||
GError *error = NULL;
|
||||
const gchar *path;
|
||||
gboolean ret;
|
||||
gchar *path;
|
||||
|
||||
secret_service_ensure_session (test->service, NULL, on_complete_get_result, &result);
|
||||
egg_test_wait_until (500);
|
||||
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
path = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
ret = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), !=, NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "plain");
|
||||
|
||||
g_object_unref (result);
|
||||
result = NULL;
|
||||
|
||||
path = g_strdup (secret_service_get_session_dbus_path (test->service));
|
||||
secret_service_ensure_session (test->service, NULL, on_complete_get_result, &result);
|
||||
egg_test_wait_until (500);
|
||||
|
||||
g_assert (G_IS_ASYNC_RESULT (result));
|
||||
path = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
ret = secret_service_ensure_session_finish (test->service, result, &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
g_assert (path != NULL);
|
||||
g_assert_cmpstr (secret_service_get_session_path (test->service), ==, path);
|
||||
g_assert (ret == TRUE);
|
||||
g_assert_cmpstr (secret_service_get_session_dbus_path (test->service), ==, path);
|
||||
g_assert_cmpstr (secret_service_get_session_algorithms (test->service), ==, "plain");
|
||||
|
||||
g_object_unref (result);
|
||||
g_free (path);
|
||||
}
|
||||
|
||||
int
|
||||
|
Loading…
Reference in New Issue
Block a user