summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-07-14 08:18:56 +0200
committerStef Walter <stefw@gnome.org>2012-07-14 08:20:32 +0200
commite0ba10ee09d66d5eba05798ea268437fb9e23518 (patch)
tree218e0477f33a0fa6172166e49d583e3f8b072712
parent7efb4d5073815f58c4ecb917821d3998dcd1e373 (diff)
downloadlibsecret-e0ba10ee09d66d5eba05798ea268437fb9e23518.tar.gz
Rename secret_password_remove() to secret_password_clear()
* It's clearer what happens here: we try to remove as many matching passwords as possible. * Also rename secret_service_remove() to secret_service_clear() * Rename secret_password_clear() which used to wipe password memory to secret_password_wipe().
-rw-r--r--docs/reference/libsecret/libsecret-sections.txt16
-rw-r--r--docs/reference/libsecret/migrating-libgnome-keyring.xml8
-rw-r--r--libsecret/Secret-1.metadata6
-rw-r--r--libsecret/secret-methods.c54
-rw-r--r--libsecret/secret-password.c88
-rw-r--r--libsecret/secret-password.h12
-rw-r--r--libsecret/secret-service.h6
-rw-r--r--libsecret/tests/Makefile.am4
-rw-r--r--libsecret/tests/test-methods.c46
-rw-r--r--libsecret/tests/test-password.c38
-rw-r--r--libsecret/tests/test-remove-password.js14
-rw-r--r--libsecret/tests/test-vala-lang.vala16
-rw-r--r--tool/secret-tool.c20
13 files changed, 162 insertions, 166 deletions
diff --git a/docs/reference/libsecret/libsecret-sections.txt b/docs/reference/libsecret/libsecret-sections.txt
index d7f0f80..f8a9c1b 100644
--- a/docs/reference/libsecret/libsecret-sections.txt
+++ b/docs/reference/libsecret/libsecret-sections.txt
@@ -128,12 +128,12 @@ secret_password_lookup_sync
secret_password_lookup_nonpageable_sync
secret_password_lookupv_sync
secret_password_lookupv_nonpageable_sync
-secret_password_remove
-secret_password_removev
-secret_password_remove_finish
-secret_password_remove_sync
-secret_password_removev_sync
secret_password_clear
+secret_password_clearv
+secret_password_clear_finish
+secret_password_clear_sync
+secret_password_clearv_sync
+secret_password_wipe
secret_password_free
</SECTION>
@@ -217,9 +217,9 @@ secret_service_store_sync
secret_service_lookup
secret_service_lookup_finish
secret_service_lookup_sync
-secret_service_remove
-secret_service_remove_finish
-secret_service_remove_sync
+secret_service_clear
+secret_service_clear_finish
+secret_service_clear_sync
secret_service_prompt
secret_service_prompt_finish
secret_service_prompt_sync
diff --git a/docs/reference/libsecret/migrating-libgnome-keyring.xml b/docs/reference/libsecret/migrating-libgnome-keyring.xml
index a675526..aa361f8 100644
--- a/docs/reference/libsecret/migrating-libgnome-keyring.xml
+++ b/docs/reference/libsecret/migrating-libgnome-keyring.xml
@@ -361,12 +361,12 @@
<tbody>
<row>
<entry>gnome_keyring_delete_password()</entry>
- <entry>secret_password_remove(), although we now try to delete
+ <entry>secret_password_clear(), although we now try to delete
all unlocked matching items</entry>
</row>
<row>
<entry>gnome_keyring_delete_password_sync()</entry>
- <entry>secret_password_remove_sync(), although we now try to delete
+ <entry>secret_password_clear_sync(), although we now try to delete
all unlocked matching items</entry>
</row>
<row>
@@ -403,11 +403,11 @@
</row>
<row>
<entry>gnome_keyring_item_delete()</entry>
- <entry>secret_item_delete(), although secret_password_remove() may be simpler</entry>
+ <entry>secret_item_delete(), although secret_password_clear() may be simpler</entry>
</row>
<row>
<entry>gnome_keyring_item_delete_sync()</entry>
- <entry>secret_item_delete_sync(), although secret_password_remove_sync() may be simpler</entry>
+ <entry>secret_item_delete_sync(), although secret_password_clear_sync() may be simpler</entry>
</row>
<row>
<entry>gnome_keyring_item_get_info()</entry>
diff --git a/libsecret/Secret-1.metadata b/libsecret/Secret-1.metadata
index be0ce37..fd69e67 100644
--- a/libsecret/Secret-1.metadata
+++ b/libsecret/Secret-1.metadata
@@ -10,10 +10,10 @@ password_lookup skip=false
password_lookup_sync skip=false throws="GLib.Error"
.error skip
password_lookupv finish_name="secret_password_lookup_finish"
-password_remove skip=false
-password_remove_sync skip=false throws="GLib.Error"
+password_clear skip=false
+password_clear_sync skip=false throws="GLib.Error"
.error skip
-password_removev finish_name="secret_password_remove_finish"
+password_clearv finish_name="secret_password_clear_finish"
password_store skip=false
password_store_sync skip=false throws="GLib.Error"
.error skip
diff --git a/libsecret/secret-methods.c b/libsecret/secret-methods.c
index 78b3eeb..438263c 100644
--- a/libsecret/secret-methods.c
+++ b/libsecret/secret-methods.c
@@ -1582,7 +1582,7 @@ on_delete_service (GObject *source,
}
/**
- * secret_service_remove:
+ * secret_service_clear:
* @service: (allow-none): the secret service
* @schema: (allow-none): the schema for the attributes
* @attributes: (element-type utf8 utf8): the attribute keys and values
@@ -1590,24 +1590,22 @@ on_delete_service (GObject *source,
* @callback: called when the operation completes
* @user_data: data to be passed to the callback
*
- * Remove a secret value from the secret service.
+ * Remove unlocked items which match the attributes from the secret service.
*
* The @attributes should be a set of key and value string pairs.
*
- * If multiple items match the attributes, then only one will be deleted.
- *
* 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_service_remove (SecretService *service,
- const SecretSchema *schema,
- GHashTable *attributes,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+secret_service_clear (SecretService *service,
+ const SecretSchema *schema,
+ GHashTable *attributes,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
const gchar *schema_name = NULL;
GSimpleAsyncResult *res;
@@ -1625,7 +1623,7 @@ secret_service_remove (SecretService *service,
schema_name = schema->name;
res = g_simple_async_result_new (G_OBJECT (service), callback, user_data,
- secret_service_remove);
+ secret_service_clear);
closure = g_slice_new0 (DeleteClosure);
closure->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
closure->attributes = _secret_attributes_to_variant (attributes, schema_name);
@@ -1649,20 +1647,20 @@ secret_service_remove (SecretService *service,
}
/**
- * secret_service_remove_finish:
+ * secret_service_clear_finish:
* @service: (allow-none): the secret service
* @result: the asynchronous result passed to the callback
* @error: location to place an error on failure
*
- * Finish asynchronous operation to remove a secret value from the secret
+ * Finish asynchronous operation to remove items from the secret
* service.
*
* Returns: whether the removal was successful or not
*/
gboolean
-secret_service_remove_finish (SecretService *service,
- GAsyncResult *result,
- GError **error)
+secret_service_clear_finish (SecretService *service,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *res;
DeleteClosure *closure;
@@ -1670,7 +1668,7 @@ secret_service_remove_finish (SecretService *service,
g_return_val_if_fail (service == NULL || SECRET_IS_SERVICE (service), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (service),
- secret_service_remove), FALSE);
+ secret_service_clear), FALSE);
res = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (res, error))
@@ -1681,19 +1679,17 @@ secret_service_remove_finish (SecretService *service,
}
/**
- * secret_service_remove_sync:
+ * secret_service_clear_sync:
* @service: (allow-none): the secret service
* @schema: (allow-none): the schema for the attributes
* @attributes: (element-type utf8 utf8): the attribute keys and values
* @cancellable: optional cancellation object
* @error: location to place an error on failure
*
- * Remove a secret value from the secret service.
+ * Remove unlocked items which match the attributes from the secret service.
*
* The @attributes should be a set of key and value string pairs.
*
- * If multiple items match the attributes, then only one will be deleted.
- *
* If @service is NULL, then secret_service_get_sync() will be called to get
* the default #SecretService proxy.
*
@@ -1703,11 +1699,11 @@ secret_service_remove_finish (SecretService *service,
* Returns: whether the removal was successful or not
*/
gboolean
-secret_service_remove_sync (SecretService *service,
- const SecretSchema *schema,
- GHashTable *attributes,
- GCancellable *cancellable,
- GError **error)
+secret_service_clear_sync (SecretService *service,
+ const SecretSchema *schema,
+ GHashTable *attributes,
+ GCancellable *cancellable,
+ GError **error)
{
SecretSync *sync;
gboolean result;
@@ -1723,12 +1719,12 @@ secret_service_remove_sync (SecretService *service,
sync = _secret_sync_new ();
g_main_context_push_thread_default (sync->context);
- secret_service_remove (service, schema, attributes, cancellable,
- _secret_sync_on_result, sync);
+ secret_service_clear (service, schema, attributes, cancellable,
+ _secret_sync_on_result, sync);
g_main_loop_run (sync->loop);
- result = secret_service_remove_finish (service, sync->result, error);
+ result = secret_service_clear_finish (service, sync->result, error);
g_main_context_pop_thread_default (sync->context);
_secret_sync_free (sync);
diff --git a/libsecret/secret-password.c b/libsecret/secret-password.c
index af4df1f..0969e42 100644
--- a/libsecret/secret-password.c
+++ b/libsecret/secret-password.c
@@ -633,30 +633,30 @@ secret_password_lookupv_sync (const SecretSchema *schema,
}
/**
- * secret_password_remove:
+ * secret_password_clear:
* @schema: the schema for the attributes
* @cancellable: optional cancellation object
* @callback: called when the operation completes
* @user_data: data to be passed to the callback
* @...: the attribute keys and values, terminated with %NULL
*
- * Remove passwords from the secret service.
+ * Clear unlocked matching passwords from the secret service.
*
* The variable argument list should contain pairs of a) The attribute name as
* a null-terminated string, followed by b) attribute value, either a character
* string, an int number, or a gboolean value, as defined in the password
* @schema. The list of attribtues should be terminated with a %NULL.
*
- * If multiple items match the attributes, then only one will be deleted.
+ * All unlocked items that match the attributes will be deleted.
*
* This method will return immediately and complete asynchronously.
*/
void
-secret_password_remove (const SecretSchema *schema,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data,
- ...)
+secret_password_clear (const SecretSchema *schema,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data,
+ ...)
{
GHashTable *attributes;
va_list va;
@@ -668,22 +668,22 @@ secret_password_remove (const SecretSchema *schema,
attributes = secret_attributes_buildv (schema, va);
va_end (va);
- secret_password_removev (schema, attributes, cancellable,
- callback, user_data);
+ secret_password_clearv (schema, attributes, cancellable,
+ callback, user_data);
g_hash_table_unref (attributes);
}
/**
- * secret_password_removev:
+ * secret_password_clearv:
* @schema: the schema for the attributes
* @attributes: (element-type utf8 utf8): the attribute keys and values
* @cancellable: optional cancellation object
* @callback: called when the operation completes
* @user_data: data to be passed to the callback
*
- * Remove passwords from the secret service.
+ * Remove unlocked matching passwords from the secret service.
*
* The @attributes should be a set of key and value string pairs.
*
@@ -691,14 +691,14 @@ secret_password_remove (const SecretSchema *schema,
*
* This method will return immediately and complete asynchronously.
*
- * Rename to: secret_password_remove
+ * Rename to: secret_password_clear
*/
void
-secret_password_removev (const SecretSchema *schema,
- GHashTable *attributes,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+secret_password_clearv (const SecretSchema *schema,
+ GHashTable *attributes,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
g_return_if_fail (schema != NULL);
g_return_if_fail (attributes != NULL);
@@ -708,12 +708,12 @@ secret_password_removev (const SecretSchema *schema,
if (!_secret_attributes_validate (schema, attributes, G_STRFUNC, TRUE))
return;
- secret_service_remove (NULL, schema, attributes,
- cancellable, callback, user_data);
+ secret_service_clear (NULL, schema, attributes,
+ cancellable, callback, user_data);
}
/**
- * secret_password_remove_finish:
+ * secret_password_clear_finish:
* @result: the asynchronous result passed to the callback
* @error: location to place an error on failure
*
@@ -723,21 +723,21 @@ secret_password_removev (const SecretSchema *schema,
* Returns: whether any passwords were removed
*/
gboolean
-secret_password_remove_finish (GAsyncResult *result,
- GError **error)
+secret_password_clear_finish (GAsyncResult *result,
+ GError **error)
{
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- return secret_service_remove_finish (NULL, result, error);
+ return secret_service_clear_finish (NULL, result, error);
}
/**
- * secret_password_remove_sync:
+ * secret_password_clear_sync:
* @schema: the schema for the attributes
* @cancellable: optional cancellation object
* @error: location to place an error on failure
* @...: the attribute keys and values, terminated with %NULL
*
- * Remove passwords from the secret service.
+ * Remove unlocked matching passwords from the secret service.
*
* The variable argument list should contain pairs of a) The attribute name as
* a null-terminated string, followed by b) attribute value, either a character
@@ -752,10 +752,10 @@ secret_password_remove_finish (GAsyncResult *result,
* Returns: whether the any passwords were removed
*/
gboolean
-secret_password_remove_sync (const SecretSchema* schema,
- GCancellable *cancellable,
- GError **error,
- ...)
+secret_password_clear_sync (const SecretSchema* schema,
+ GCancellable *cancellable,
+ GError **error,
+ ...)
{
GHashTable *attributes;
gboolean result;
@@ -769,8 +769,8 @@ secret_password_remove_sync (const SecretSchema* schema,
attributes = secret_attributes_buildv (schema, va);
va_end (va);
- result = secret_password_removev_sync (schema, attributes,
- cancellable, error);
+ result = secret_password_clearv_sync (schema, attributes,
+ cancellable, error);
g_hash_table_unref (attributes);
@@ -778,13 +778,13 @@ secret_password_remove_sync (const SecretSchema* schema,
}
/**
- * secret_password_removev_sync:
+ * secret_password_clearv_sync:
* @schema: the schema for the attributes
* @attributes: (element-type utf8 utf8): the attribute keys and values
* @cancellable: optional cancellation object
* @error: location to place an error on failure
*
- * Remove passwords from the secret service.
+ * Remove unlocked matching passwords from the secret service.
*
* The @attributes should be a set of key and value string pairs.
*
@@ -795,13 +795,13 @@ secret_password_remove_sync (const SecretSchema* schema,
*
* Returns: whether any passwords were removed
*
- * Rename to: secret_password_remove_sync
+ * Rename to: secret_password_clear_sync
*/
gboolean
-secret_password_removev_sync (const SecretSchema *schema,
- GHashTable *attributes,
- GCancellable *cancellable,
- GError **error)
+secret_password_clearv_sync (const SecretSchema *schema,
+ GHashTable *attributes,
+ GCancellable *cancellable,
+ GError **error)
{
SecretSync *sync;
gboolean result;
@@ -818,12 +818,12 @@ secret_password_removev_sync (const SecretSchema *schema,
sync = _secret_sync_new ();
g_main_context_push_thread_default (sync->context);
- secret_password_removev (schema, attributes, cancellable,
- _secret_sync_on_result, sync);
+ secret_password_clearv (schema, attributes, cancellable,
+ _secret_sync_on_result, sync);
g_main_loop_run (sync->loop);
- result = secret_password_remove_finish (sync->result, error);
+ result = secret_password_clear_finish (sync->result, error);
g_main_context_pop_thread_default (sync->context);
_secret_sync_free (sync);
@@ -852,13 +852,13 @@ secret_password_free (gchar *password)
}
/**
- * secret_password_clear:
+ * secret_password_wipe:
* @password: (allow-none): password to clear
*
* Clear the memory used by a password.
*/
void
-secret_password_clear (gchar *password)
+secret_password_wipe (gchar *password)
{
if (password == NULL)
return;
diff --git a/libsecret/secret-password.h b/libsecret/secret-password.h
index 02e5302..d47abb3 100644
--- a/libsecret/secret-password.h
+++ b/libsecret/secret-password.h
@@ -101,34 +101,34 @@ gchar * secret_password_lookupv_nonpageable_sync (const SecretSchema *sche
GCancellable *cancellable,
GError **error);
-void secret_password_remove (const SecretSchema *schema,
+void secret_password_clear (const SecretSchema *schema,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data,
...) G_GNUC_NULL_TERMINATED;
-void secret_password_removev (const SecretSchema *schema,
+void secret_password_clearv (const SecretSchema *schema,
GHashTable *attributes,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-gboolean secret_password_remove_finish (GAsyncResult *result,
+gboolean secret_password_clear_finish (GAsyncResult *result,
GError **error);
-gboolean secret_password_remove_sync (const SecretSchema* schema,
+gboolean secret_password_clear_sync (const SecretSchema* schema,
GCancellable *cancellable,
GError **error,
...) G_GNUC_NULL_TERMINATED;
-gboolean secret_password_removev_sync (const SecretSchema *schema,
+gboolean secret_password_clearv_sync (const SecretSchema *schema,
GHashTable *attributes,
GCancellable *cancellable,
GError **error);
void secret_password_free (gchar *password);
-void secret_password_clear (gchar *password);
+void secret_password_wipe (gchar *password);
G_END_DECLS
diff --git a/libsecret/secret-service.h b/libsecret/secret-service.h
index e73b622..9f06ab3 100644
--- a/libsecret/secret-service.h
+++ b/libsecret/secret-service.h
@@ -262,18 +262,18 @@ SecretValue * secret_service_lookup_sync (SecretService
GCancellable *cancellable,
GError **error);
-void secret_service_remove (SecretService *service,
+void secret_service_clear (SecretService *service,
const SecretSchema *schema,
GHashTable *attributes,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-gboolean secret_service_remove_finish (SecretService *service,
+gboolean secret_service_clear_finish (SecretService *service,
GAsyncResult *result,
GError **error);
-gboolean secret_service_remove_sync (SecretService *service,
+gboolean secret_service_clear_sync (SecretService *service,
const SecretSchema *schema,
GHashTable *attributes,
GCancellable *cancellable,
diff --git a/libsecret/tests/Makefile.am b/libsecret/tests/Makefile.am
index c5a6a29..2bdd314 100644
--- a/libsecret/tests/Makefile.am
+++ b/libsecret/tests/Makefile.am
@@ -59,7 +59,7 @@ noinst_PROGRAMS = \
JS_TESTS = \
test-lookup-password.js \
- test-remove-password.js \
+ test-clear-password.js \
test-store-password.js \
test-unstable.js
@@ -69,7 +69,7 @@ JS_ENV = \
PY_TESTS = \
test-lookup-password.py \
- test-remove-password.py \
+ test-clear-password.py \
test-store-password.py \
test-unstable.py
diff --git a/libsecret/tests/test-methods.c b/libsecret/tests/test-methods.c
index 2398185..b94188a 100644
--- a/libsecret/tests/test-methods.c
+++ b/libsecret/tests/test-methods.c
@@ -448,8 +448,8 @@ test_unlock_sync (Test *test,
}
static void
-test_remove_sync (Test *test,
- gconstpointer used)
+test_clear_sync (Test *test,
+ gconstpointer used)
{
GError *error = NULL;
GHashTable *attributes;
@@ -461,7 +461,7 @@ test_remove_sync (Test *test,
"number", 1,
NULL);
- ret = secret_service_remove_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
+ ret = secret_service_clear_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
g_assert_no_error (error);
g_assert (ret == TRUE);
@@ -470,8 +470,8 @@ test_remove_sync (Test *test,
}
static void
-test_remove_async (Test *test,
- gconstpointer used)
+test_clear_async (Test *test,
+ gconstpointer used)
{
GError *error = NULL;
GAsyncResult *result = NULL;
@@ -484,15 +484,15 @@ test_remove_async (Test *test,
"number", 1,
NULL);
- secret_service_remove (test->service, &MOCK_SCHEMA, attributes, NULL,
- on_complete_get_result, &result);
+ secret_service_clear (test->service, &MOCK_SCHEMA, attributes, NULL,
+ on_complete_get_result, &result);
g_hash_table_unref (attributes);
g_assert (result == NULL);
egg_test_wait ();
- ret = secret_service_remove_finish (test->service, result, &error);
+ ret = secret_service_clear_finish (test->service, result, &error);
g_assert_no_error (error);
g_assert (ret == TRUE);
@@ -500,8 +500,8 @@ test_remove_async (Test *test,
}
static void
-test_remove_locked (Test *test,
- gconstpointer used)
+test_clear_locked (Test *test,
+ gconstpointer used)
{
GError *error = NULL;
GHashTable *attributes;
@@ -514,7 +514,7 @@ test_remove_locked (Test *test,
NULL);
/* Locked items can't be removed via this API */
- ret = secret_service_remove_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
+ ret = secret_service_clear_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
g_hash_table_unref (attributes);
g_assert_no_error (error);
@@ -522,8 +522,8 @@ test_remove_locked (Test *test,
}
static void
-test_remove_no_match (Test *test,
- gconstpointer used)
+test_clear_no_match (Test *test,
+ gconstpointer used)
{
GError *error = NULL;
GHashTable *attributes;
@@ -535,7 +535,7 @@ test_remove_no_match (Test *test,
NULL);
/* Won't match anything */
- ret = secret_service_remove_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
+ ret = secret_service_clear_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
g_hash_table_unref (attributes);
g_assert_no_error (error);
@@ -543,8 +543,8 @@ test_remove_no_match (Test *test,
}
static void
-test_remove_no_name (Test *test,
- gconstpointer used)
+test_clear_no_name (Test *test,
+ gconstpointer used)
{
const gchar *paths[] = { "/org/freedesktop/secrets/collection/german", NULL };
GError *error = NULL;
@@ -556,7 +556,7 @@ test_remove_no_name (Test *test,
NULL);
/* Shouldn't match anything, because no item with 5 in mock schema */
- ret = secret_service_remove_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
+ ret = secret_service_clear_sync (test->service, &MOCK_SCHEMA, attributes, NULL, &error);
g_assert_no_error (error);
g_assert (ret == FALSE);
@@ -565,7 +565,7 @@ test_remove_no_name (Test *test,
g_assert_no_error (error);
/* We have an item with 5 in prime schema, but should match anyway becase of flags */
- ret = secret_service_remove_sync (test->service, &NO_NAME_SCHEMA, attributes, NULL, &error);
+ ret = secret_service_clear_sync (test->service, &NO_NAME_SCHEMA, attributes, NULL, &error);
g_assert_no_error (error);
g_assert (ret == TRUE);
@@ -929,11 +929,11 @@ main (int argc, char **argv)
g_test_add ("/service/lookup-no-match", Test, "mock-service-normal.py", setup, test_lookup_no_match, teardown);
g_test_add ("/service/lookup-no-name", Test, "mock-service-normal.py", setup, test_lookup_no_name, teardown);
- g_test_add ("/service/remove-sync", Test, "mock-service-delete.py", setup, test_remove_sync, teardown);
- g_test_add ("/service/remove-async", Test, "mock-service-delete.py", setup, test_remove_async, teardown);
- g_test_add ("/service/remove-locked", Test, "mock-service-delete.py", setup, test_remove_locked, teardown);
- g_test_add ("/service/remove-no-match", Test, "mock-service-delete.py", setup, test_remove_no_match, teardown);
- g_test_add ("/service/remove-no-name", Test, "mock-service-delete.py", setup, test_remove_no_name, teardown);
+ g_test_add ("/service/clear-sync", Test, "mock-service-delete.py", setup, test_clear_sync, teardown);
+ g_test_add ("/service/clear-async", Test, "mock-service-delete.py", setup, test_clear_async, teardown);
+ g_test_add ("/service/clear-locked", Test, "mock-service-delete.py", setup, test_clear_locked, teardown);
+ g_test_add ("/service/clear-no-match", Test, "mock-service-delete.py", setup, test_clear_no_match, teardown);
+ g_test_add ("/service/clear-no-name", Test, "mock-service-delete.py", setup, test_clear_no_name, teardown);
g_test_add ("/service/store-sync", Test, "mock-service-normal.py", setup, test_store_sync, teardown);
g_test_add ("/service/store-async", Test, "mock-service-normal.py", setup, test_store_async, teardown);
diff --git a/libsecret/tests/test-password.c b/libsecret/tests/test-password.c
index 303fae7..758ab65 100644
--- a/libsecret/tests/test-password.c
+++ b/libsecret/tests/test-password.c
@@ -230,11 +230,11 @@ test_delete_sync (Test *test,
GError *error = NULL;
gboolean ret;
- ret = secret_password_remove_sync (&MOCK_SCHEMA, NULL, &error,
- "even", FALSE,
- "string", "one",
- "number", 1,
- NULL);
+ ret = secret_password_clear_sync (&MOCK_SCHEMA, NULL, &error,
+ "even", FALSE,
+ "string", "one",
+ "number", 1,
+ NULL);
g_assert_no_error (error);
g_assert (ret == TRUE);
@@ -248,18 +248,18 @@ test_delete_async (Test *test,
GAsyncResult *result = NULL;
gboolean ret;
- secret_password_remove (&MOCK_SCHEMA, NULL,
- on_complete_get_result, &result,
- "even", FALSE,
- "string", "one",
- "number", 1,
- NULL);
+ secret_password_clear (&MOCK_SCHEMA, NULL,
+ on_complete_get_result, &result,
+ "even", FALSE,
+ "string", "one",
+ "number", 1,
+ NULL);
g_assert (result == NULL);
egg_test_wait ();
- ret = secret_password_remove_finish (result, &error);
+ ret = secret_password_clear_finish (result, &error);
g_assert_no_error (error);
g_assert (ret == TRUE);
@@ -267,8 +267,8 @@ test_delete_async (Test *test,
}
static void
-test_remove_no_name (Test *test,
- gconstpointer used)
+test_clear_no_name (Test *test,
+ gconstpointer used)
{
const gchar *paths[] = { "/org/freedesktop/secrets/collection/german", NULL };
SecretService *service;
@@ -276,9 +276,9 @@ test_remove_no_name (Test *test,
gboolean ret;
/* Shouldn't match anything, because no item with 5 in mock schema */
- ret = secret_password_remove_sync (&MOCK_SCHEMA, NULL, &error,
- "number", 5,
- NULL);
+ ret = secret_password_clear_sync (&MOCK_SCHEMA, NULL, &error,
+ "number", 5,
+ NULL);
g_assert_no_error (error);
g_assert (ret == FALSE);
@@ -290,7 +290,7 @@ test_remove_no_name (Test *test,
g_object_unref (service);
/* We have an item with 5 in prime schema, but should match anyway becase of flags */
- ret = secret_password_remove_sync (&NO_NAME_SCHEMA, NULL, &error,
+ ret = secret_password_clear_sync (&NO_NAME_SCHEMA, NULL, &error,
"number", 5,
NULL);
@@ -320,7 +320,7 @@ main (int argc, char **argv)
g_test_add ("/password/delete-sync", Test, "mock-service-delete.py", setup, test_delete_sync, teardown);
g_test_add ("/password/delete-async", Test, "mock-service-delete.py", setup, test_delete_async, teardown);
- g_test_add ("/password/remove-no-name", Test, "mock-service-delete.py", setup, test_remove_no_name, teardown);
+ g_test_add ("/password/clear-no-name", Test, "mock-service-delete.py", setup, test_clear_no_name, teardown);
g_test_add_func ("/password/free-null", test_password_free_null);
diff --git a/libsecret/tests/test-remove-password.js b/libsecret/tests/test-remove-password.js
index 2d5a978..d7d0218 100644
--- a/libsecret/tests/test-remove-password.js
+++ b/libsecret/tests/test-remove-password.js
@@ -26,13 +26,13 @@ var attributes = { "number": "1", "string": "one", "even": "false" };
var password = Secret.password_lookup_sync (STORE_SCHEMA, attributes, null);
assertEquals("111", password);
-var deleted = Secret.password_remove_sync (STORE_SCHEMA, attributes, null);
+var deleted = Secret.password_clear_sync (STORE_SCHEMA, attributes, null);
assertEquals(true, deleted);
var password = Secret.password_lookup_sync (STORE_SCHEMA, attributes, null);
assertEquals(null, password);
-var deleted = Secret.password_remove_sync (STORE_SCHEMA, attributes, null);
+var deleted = Secret.password_clear_sync (STORE_SCHEMA, attributes, null);
assertEquals(false, deleted);
/* Asynchronous */
@@ -44,10 +44,10 @@ assertEquals("222", password);
var loop = new GLib.MainLoop.new(null, false);
-Secret.password_remove (STORE_SCHEMA, attributes,
- null, function(source, result) {
+Secret.password_clear (STORE_SCHEMA, attributes,
+ null, function(source, result) {
loop.quit();
- var deleted = Secret.password_remove_finish(result);
+ var deleted = Secret.password_clear_finish(result);
assertEquals(true, deleted);
});
@@ -56,10 +56,10 @@ loop.run();
var password = Secret.password_lookup_sync (STORE_SCHEMA, attributes, null);
assertEquals(null, password);
-Secret.password_remove (STORE_SCHEMA, attributes,
+Secret.password_clear (STORE_SCHEMA, attributes,
null, function(source, result) {
loop.quit();
- var deleted = Secret.password_remove_finish(result);
+ var deleted = Secret.password_clear_finish(result);
assertEquals(false, deleted);
});
diff --git a/libsecret/tests/test-vala-lang.vala b/libsecret/tests/test-vala-lang.vala
index 3bcee8d..fad5252 100644
--- a/libsecret/tests/test-vala-lang.vala
+++ b/libsecret/tests/test-vala-lang.vala
@@ -87,7 +87,7 @@ private void test_store_async () {
loop.run ();
}
-private void test_remove_sync () {
+private void test_clear_sync () {
try {
var attributes = new GLib.HashTable<string,string> (GLib.str_hash, GLib.str_equal);
attributes["even"] = "false";
@@ -97,7 +97,7 @@ private void test_remove_sync () {
string? password = Secret.password_lookupv_sync (schema, attributes);
GLib.assert (password == "999");
- bool removed = Secret.password_removev_sync (schema, attributes, null);
+ bool removed = Secret.password_clearv_sync (schema, attributes, null);
GLib.assert (removed);
password = Secret.password_lookupv_sync (schema, attributes);
@@ -107,7 +107,7 @@ private void test_remove_sync () {
}
}
-private async void test_remove_async_ex () {
+private async void test_clear_async_ex () {
var attributes = new GLib.HashTable<string,string> (GLib.str_hash, GLib.str_equal);
attributes["even"] = "true";
attributes["string"] = "eight";
@@ -117,7 +117,7 @@ private async void test_remove_async_ex () {
string? password = yield Secret.password_lookupv (schema, attributes, null);
GLib.assert (password == "999");
- bool removed = yield Secret.password_removev (schema, attributes, null);
+ bool removed = yield Secret.password_clearv (schema, attributes, null);
GLib.assert (removed);
password = yield Secret.password_lookupv (schema, attributes, null);
@@ -127,9 +127,9 @@ private async void test_remove_async_ex () {
}
}
-private void test_remove_async () {
+private void test_clear_async () {
var loop = new GLib.MainLoop ();
- test_remove_async_ex.begin ((obj, async_res) => {
+ test_clear_async_ex.begin ((obj, async_res) => {
loop.quit ();
});
loop.run ();
@@ -160,8 +160,8 @@ private static int main (string[] args) {
GLib.Test.add_data_func ("/vala/lookup/no-name", test_lookup_no_name);
GLib.Test.add_data_func ("/vala/store/sync", test_store_sync);
GLib.Test.add_data_func ("/vala/store/async", test_store_async);
- GLib.Test.add_data_func ("/vala/remove/sync", test_remove_sync);
- GLib.Test.add_data_func ("/vala/remove/async", test_remove_async);
+ GLib.Test.add_data_func ("/vala/clear/sync", test_clear_sync);
+ GLib.Test.add_data_func ("/vala/clear/async", test_clear_async);
var res = GLib.Test.run ();
diff --git a/tool/secret-tool.c b/tool/secret-tool.c
index c393112..fd0792b 100644
--- a/tool/secret-tool.c
+++ b/tool/secret-tool.c
@@ -48,10 +48,10 @@ static const GOptionEntry LOOKUP_OPTIONS[] = {
{ NULL }
};
-/* secret-tool remove name:xxxx yyyy:zzzz */
-static const GOptionEntry REMOVE_OPTIONS[] = {
+/* secret-tool clear name:xxxx yyyy:zzzz */
+static const GOptionEntry CLEAR_OPTIONS[] = {
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &attribute_args,
- N_("attribute value pairs which match item to remove"), NULL },
+ N_("attribute value pairs which match items to clear"), NULL },
{ NULL }
};
@@ -64,7 +64,7 @@ usage (void)
{
g_printerr ("usage: secret-tool store --label='label' attribute value ...\n");
g_printerr (" secret-tool lookup attribute value ...\n");
- g_printerr (" secret-tool remove attribute value ...\n");
+ g_printerr (" secret-tool clear attribute value ...\n");
exit (2);
}
@@ -113,8 +113,8 @@ attributes_from_arguments (gchar **args)
}
static int
-secret_tool_action_remove (int argc,
- char *argv[])
+secret_tool_action_clear (int argc,
+ char *argv[])
{
GError *error = NULL;
GOptionContext *context;
@@ -122,7 +122,7 @@ secret_tool_action_remove (int argc,
GHashTable *attributes;
context = g_option_context_new ("attribute value ...");
- g_option_context_add_main_entries (context, REMOVE_OPTIONS, GETTEXT_PACKAGE);
+ g_option_context_add_main_entries (context, CLEAR_OPTIONS, GETTEXT_PACKAGE);
if (!g_option_context_parse (context, &argc, &argv, &error)) {
g_printerr ("%s\n", error->message);
usage();
@@ -135,7 +135,7 @@ secret_tool_action_remove (int argc,
service = secret_service_get_sync (SECRET_SERVICE_NONE, NULL, &error);
if (error == NULL)
- secret_service_remove_sync (service, NULL, attributes, NULL, &error);
+ secret_service_clear_sync (service, NULL, attributes, NULL, &error);
g_object_unref (service);
g_hash_table_unref (attributes);
@@ -345,8 +345,8 @@ main (int argc,
action = secret_tool_action_store;
} else if (g_str_equal (argv[1], "lookup")) {
action = secret_tool_action_lookup;
- } else if (g_str_equal (argv[1], "remove")) {
- action = secret_tool_action_remove;
+ } else if (g_str_equal (argv[1], "clear")) {
+ action = secret_tool_action_clear;
} else {
usage ();
}