mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2025-01-03 02:28:53 +00:00
secret_service_search() accepts a SecretSchema
* For validation and adding the xdg:schema attribute
This commit is contained in:
parent
889f6d66b7
commit
3f0c69d862
@ -215,6 +215,7 @@ on_search_paths (GObject *source,
|
|||||||
/**
|
/**
|
||||||
* secret_service_search:
|
* secret_service_search:
|
||||||
* @self: the secret service
|
* @self: the secret service
|
||||||
|
* @schema: (allow-none): the schema for the attributes
|
||||||
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
||||||
* @flags: search option flags
|
* @flags: search option flags
|
||||||
* @cancellable: optional cancellation object
|
* @cancellable: optional cancellation object
|
||||||
@ -239,6 +240,7 @@ on_search_paths (GObject *source,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
secret_service_search (SecretService *self,
|
secret_service_search (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
SecretSearchFlags flags,
|
SecretSearchFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
@ -252,6 +254,10 @@ secret_service_search (SecretService *self,
|
|||||||
g_return_if_fail (attributes != NULL);
|
g_return_if_fail (attributes != NULL);
|
||||||
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
||||||
|
|
||||||
|
/* Warnings raised already */
|
||||||
|
if (schema != NULL && !_secret_attributes_validate (schema, attributes))
|
||||||
|
return;
|
||||||
|
|
||||||
res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
|
res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
|
||||||
secret_service_search);
|
secret_service_search);
|
||||||
closure = g_slice_new0 (SearchClosure);
|
closure = g_slice_new0 (SearchClosure);
|
||||||
@ -261,7 +267,7 @@ secret_service_search (SecretService *self,
|
|||||||
closure->flags = flags;
|
closure->flags = flags;
|
||||||
g_simple_async_result_set_op_res_gpointer (res, closure, search_closure_free);
|
g_simple_async_result_set_op_res_gpointer (res, closure, search_closure_free);
|
||||||
|
|
||||||
secret_service_search_for_paths (self, attributes, cancellable,
|
secret_service_search_for_paths (self, schema, attributes, cancellable,
|
||||||
on_search_paths, g_object_ref (res));
|
on_search_paths, g_object_ref (res));
|
||||||
|
|
||||||
g_object_unref (res);
|
g_object_unref (res);
|
||||||
@ -337,6 +343,7 @@ service_load_items_sync (SecretService *self,
|
|||||||
/**
|
/**
|
||||||
* secret_service_search_sync:
|
* secret_service_search_sync:
|
||||||
* @self: the secret service
|
* @self: the secret service
|
||||||
|
* @schema: (allow-none): the schema for the attributes
|
||||||
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
||||||
* @flags: search option flags
|
* @flags: search option flags
|
||||||
* @cancellable: optional cancellation object
|
* @cancellable: optional cancellation object
|
||||||
@ -366,6 +373,7 @@ service_load_items_sync (SecretService *self,
|
|||||||
*/
|
*/
|
||||||
GList *
|
GList *
|
||||||
secret_service_search_sync (SecretService *self,
|
secret_service_search_sync (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
SecretSearchFlags flags,
|
SecretSearchFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
@ -384,7 +392,11 @@ secret_service_search_sync (SecretService *self,
|
|||||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), 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 (error == NULL || *error == NULL, NULL);
|
||||||
|
|
||||||
if (!secret_service_search_for_paths_sync (self, attributes, cancellable,
|
/* Warnings raised already */
|
||||||
|
if (schema != NULL && !_secret_attributes_validate (schema, attributes))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (!secret_service_search_for_paths_sync (self, schema, attributes, cancellable,
|
||||||
&unlocked_paths, &locked_paths, error))
|
&unlocked_paths, &locked_paths, error))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ on_search_items_complete (GObject *source,
|
|||||||
/**
|
/**
|
||||||
* secret_service_search_for_paths:
|
* secret_service_search_for_paths:
|
||||||
* @self: the secret service
|
* @self: the secret service
|
||||||
|
* @schema: (allow-none): the schema for the attributes
|
||||||
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
||||||
* @cancellable: optional cancellation object
|
* @cancellable: optional cancellation object
|
||||||
* @callback: called when the operation completes
|
* @callback: called when the operation completes
|
||||||
@ -80,16 +81,26 @@ on_search_items_complete (GObject *source,
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
secret_service_search_for_paths (SecretService *self,
|
secret_service_search_for_paths (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
const gchar *schema_name = NULL;
|
||||||
|
|
||||||
g_return_if_fail (SECRET_IS_SERVICE (self));
|
g_return_if_fail (SECRET_IS_SERVICE (self));
|
||||||
g_return_if_fail (attributes != NULL);
|
g_return_if_fail (attributes != NULL);
|
||||||
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
||||||
|
|
||||||
_secret_service_search_for_paths_variant (self, _secret_attributes_to_variant (attributes, NULL),
|
/* Warnings raised already */
|
||||||
|
if (schema != NULL && !_secret_attributes_validate (schema, attributes))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (schema != NULL && !(schema->flags & SECRET_SCHEMA_DONT_MATCH_NAME))
|
||||||
|
schema_name = schema->name;
|
||||||
|
|
||||||
|
_secret_service_search_for_paths_variant (self, _secret_attributes_to_variant (attributes, schema_name),
|
||||||
cancellable, callback, user_data);
|
cancellable, callback, user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +188,7 @@ secret_service_search_for_paths_finish (SecretService *self,
|
|||||||
/**
|
/**
|
||||||
* secret_service_search_for_paths_sync:
|
* secret_service_search_for_paths_sync:
|
||||||
* @self: the secret service
|
* @self: the secret service
|
||||||
|
* @schema: (allow-none): the schema for the attributes
|
||||||
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
* @attributes: (element-type utf8 utf8): search for items matching these attributes
|
||||||
* @cancellable: optional cancellation object
|
* @cancellable: optional cancellation object
|
||||||
* @unlocked: (out) (transfer full) (array zero-terminated=1) (allow-none):
|
* @unlocked: (out) (transfer full) (array zero-terminated=1) (allow-none):
|
||||||
@ -205,12 +217,14 @@ secret_service_search_for_paths_finish (SecretService *self,
|
|||||||
*/
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
secret_service_search_for_paths_sync (SecretService *self,
|
secret_service_search_for_paths_sync (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
gchar ***unlocked,
|
gchar ***unlocked,
|
||||||
gchar ***locked,
|
gchar ***locked,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
|
const gchar *schema_name = NULL;
|
||||||
gchar **dummy = NULL;
|
gchar **dummy = NULL;
|
||||||
GVariant *response;
|
GVariant *response;
|
||||||
|
|
||||||
@ -219,9 +233,16 @@ secret_service_search_for_paths_sync (SecretService *self,
|
|||||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
|
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
|
||||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||||
|
|
||||||
|
/* Warnings raised already */
|
||||||
|
if (schema != NULL && !_secret_attributes_validate (schema, attributes))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (schema != NULL && !(schema->flags & SECRET_SCHEMA_DONT_MATCH_NAME))
|
||||||
|
schema_name = schema->name;
|
||||||
|
|
||||||
response = g_dbus_proxy_call_sync (G_DBUS_PROXY (self), "SearchItems",
|
response = g_dbus_proxy_call_sync (G_DBUS_PROXY (self), "SearchItems",
|
||||||
g_variant_new ("(@a{ss})",
|
g_variant_new ("(@a{ss})",
|
||||||
_secret_attributes_to_variant (attributes, NULL)),
|
_secret_attributes_to_variant (attributes, schema_name)),
|
||||||
G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error);
|
G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error);
|
||||||
|
|
||||||
if (response != NULL) {
|
if (response != NULL) {
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
void secret_service_search_for_paths (SecretService *self,
|
void secret_service_search_for_paths (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
@ -42,6 +43,7 @@ gboolean secret_service_search_for_paths_finish (SecretService
|
|||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
gboolean secret_service_search_for_paths_sync (SecretService *self,
|
gboolean secret_service_search_for_paths_sync (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
gchar ***unlocked,
|
gchar ***unlocked,
|
||||||
|
@ -151,6 +151,7 @@ gboolean secret_service_ensure_collections_sync (SecretService
|
|||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
void secret_service_search (SecretService *self,
|
void secret_service_search (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
SecretSearchFlags flags,
|
SecretSearchFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
@ -162,6 +163,7 @@ GList * secret_service_search_finish (SecretService
|
|||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
GList * secret_service_search_sync (SecretService *self,
|
GList * secret_service_search_sync (SecretService *self,
|
||||||
|
const SecretSchema *schema,
|
||||||
GHashTable *attributes,
|
GHashTable *attributes,
|
||||||
SecretSearchFlags flags,
|
SecretSearchFlags flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
|
@ -127,8 +127,8 @@ test_search_sync (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
items = secret_service_search_sync (test->service, attributes, SECRET_SEARCH_NONE,
|
items = secret_service_search_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
NULL, &error);
|
SECRET_SEARCH_NONE, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
|
|
||||||
@ -151,7 +151,8 @@ test_search_async (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
secret_service_search (test->service, attributes, SECRET_SEARCH_NONE, NULL,
|
secret_service_search (test->service, &MOCK_SCHEMA, attributes,
|
||||||
|
SECRET_SEARCH_NONE, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
g_assert (result == NULL);
|
g_assert (result == NULL);
|
||||||
@ -181,8 +182,8 @@ test_search_all_sync (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
items = secret_service_search_sync (test->service, attributes, SECRET_SEARCH_ALL,
|
items = secret_service_search_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
NULL, &error);
|
SECRET_SEARCH_ALL, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
|
|
||||||
@ -212,7 +213,8 @@ test_search_all_async (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
secret_service_search (test->service, attributes, SECRET_SEARCH_ALL, NULL,
|
secret_service_search (test->service, &MOCK_SCHEMA, attributes,
|
||||||
|
SECRET_SEARCH_ALL, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
g_assert (result == NULL);
|
g_assert (result == NULL);
|
||||||
@ -249,7 +251,7 @@ test_search_unlock_sync (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
items = secret_service_search_sync (test->service, attributes,
|
items = secret_service_search_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
SECRET_SEARCH_ALL | SECRET_SEARCH_UNLOCK,
|
SECRET_SEARCH_ALL | SECRET_SEARCH_UNLOCK,
|
||||||
NULL, &error);
|
NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -281,7 +283,7 @@ test_search_unlock_async (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
secret_service_search (test->service, attributes,
|
secret_service_search (test->service, &MOCK_SCHEMA, attributes,
|
||||||
SECRET_SEARCH_ALL | SECRET_SEARCH_UNLOCK, NULL,
|
SECRET_SEARCH_ALL | SECRET_SEARCH_UNLOCK, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
@ -320,7 +322,7 @@ test_search_secrets_sync (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
items = secret_service_search_sync (test->service, attributes,
|
items = secret_service_search_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
SECRET_SEARCH_ALL | SECRET_SEARCH_LOAD_SECRETS,
|
SECRET_SEARCH_ALL | SECRET_SEARCH_LOAD_SECRETS,
|
||||||
NULL, &error);
|
NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
@ -355,7 +357,7 @@ test_search_secrets_async (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
secret_service_search (test->service, attributes,
|
secret_service_search (test->service, &MOCK_SCHEMA, attributes,
|
||||||
SECRET_SEARCH_ALL | SECRET_SEARCH_LOAD_SECRETS, NULL,
|
SECRET_SEARCH_ALL | SECRET_SEARCH_LOAD_SECRETS, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
@ -731,8 +733,8 @@ test_store_sync (Test *test,
|
|||||||
g_hash_table_insert (attributes, "string", "seventeen");
|
g_hash_table_insert (attributes, "string", "seventeen");
|
||||||
g_hash_table_insert (attributes, "number", "17");
|
g_hash_table_insert (attributes, "number", "17");
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
&paths, NULL, &error);
|
NULL, &paths, NULL, &error);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
@ -784,8 +786,8 @@ test_store_replace (Test *test,
|
|||||||
g_hash_table_insert (attributes, "string", "seventeen");
|
g_hash_table_insert (attributes, "string", "seventeen");
|
||||||
g_hash_table_insert (attributes, "number", "17");
|
g_hash_table_insert (attributes, "number", "17");
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
&paths, NULL, &error);
|
NULL, &paths, NULL, &error);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
@ -832,8 +834,8 @@ test_store_async (Test *test,
|
|||||||
g_hash_table_insert (attributes, "string", "seventeen");
|
g_hash_table_insert (attributes, "string", "seventeen");
|
||||||
g_hash_table_insert (attributes, "number", "17");
|
g_hash_table_insert (attributes, "number", "17");
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes,
|
||||||
&paths, NULL, &error);
|
NULL, &paths, NULL, &error);
|
||||||
g_hash_table_unref (attributes);
|
g_hash_table_unref (attributes);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
|
@ -129,8 +129,8 @@ test_search_paths_sync (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
&unlocked, &locked, &error);
|
&unlocked, &locked, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
@ -160,7 +160,7 @@ test_search_paths_async (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
secret_service_search_for_paths (test->service, attributes, NULL,
|
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
egg_test_wait ();
|
egg_test_wait ();
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ test_search_paths_nulls (Test *test,
|
|||||||
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
attributes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||||
g_hash_table_insert (attributes, "number", "1");
|
g_hash_table_insert (attributes, "number", "1");
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
&paths, NULL, &error);
|
&paths, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
@ -205,7 +205,7 @@ test_search_paths_nulls (Test *test,
|
|||||||
g_assert_cmpstr (paths[0], ==, "/org/freedesktop/secrets/collection/english/1");
|
g_assert_cmpstr (paths[0], ==, "/org/freedesktop/secrets/collection/english/1");
|
||||||
g_strfreev (paths);
|
g_strfreev (paths);
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
NULL, &paths, &error);
|
NULL, &paths, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
@ -213,12 +213,12 @@ test_search_paths_nulls (Test *test,
|
|||||||
g_assert_cmpstr (paths[0], ==, "/org/freedesktop/secrets/collection/spanish/10");
|
g_assert_cmpstr (paths[0], ==, "/org/freedesktop/secrets/collection/spanish/10");
|
||||||
g_strfreev (paths);
|
g_strfreev (paths);
|
||||||
|
|
||||||
ret = secret_service_search_for_paths_sync (test->service, attributes, NULL,
|
ret = secret_service_search_for_paths_sync (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
NULL, NULL, &error);
|
NULL, NULL, &error);
|
||||||
g_assert_no_error (error);
|
g_assert_no_error (error);
|
||||||
g_assert (ret == TRUE);
|
g_assert (ret == TRUE);
|
||||||
|
|
||||||
secret_service_search_for_paths (test->service, attributes, NULL,
|
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
egg_test_wait ();
|
egg_test_wait ();
|
||||||
g_assert (G_IS_ASYNC_RESULT (result));
|
g_assert (G_IS_ASYNC_RESULT (result));
|
||||||
@ -231,7 +231,7 @@ test_search_paths_nulls (Test *test,
|
|||||||
g_strfreev (paths);
|
g_strfreev (paths);
|
||||||
g_clear_object (&result);
|
g_clear_object (&result);
|
||||||
|
|
||||||
secret_service_search_for_paths (test->service, attributes, NULL,
|
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
egg_test_wait ();
|
egg_test_wait ();
|
||||||
g_assert (G_IS_ASYNC_RESULT (result));
|
g_assert (G_IS_ASYNC_RESULT (result));
|
||||||
@ -244,7 +244,7 @@ test_search_paths_nulls (Test *test,
|
|||||||
g_strfreev (paths);
|
g_strfreev (paths);
|
||||||
g_clear_object (&result);
|
g_clear_object (&result);
|
||||||
|
|
||||||
secret_service_search_for_paths (test->service, attributes, NULL,
|
secret_service_search_for_paths (test->service, &MOCK_SCHEMA, attributes, NULL,
|
||||||
on_complete_get_result, &result);
|
on_complete_get_result, &result);
|
||||||
egg_test_wait ();
|
egg_test_wait ();
|
||||||
g_assert (G_IS_ASYNC_RESULT (result));
|
g_assert (G_IS_ASYNC_RESULT (result));
|
||||||
|
Loading…
Reference in New Issue
Block a user