Skip to content

secret-password: Add necessary functions to migrate from D-Bus based API

Daiki Ueno requested to merge wip/dueno/simple-item into master

The motivation behind this MR is to encourage applications to switch from the complete API to the simple API, to make it easier to migrate from the D-Bus based secret store to the local storage. For that purpose, the following functions are added:

gchar *      secret_value_unref_to_password            (SecretValue *value,
						        gsize *length);

SecretValue *secret_password_lookup_binary_finish      (GAsyncResult *result,
							GError **error);
SecretValue *secret_password_lookup_binary_sync        (const SecretSchema *schema,
							GCancellable *cancellable,
							GError **error,
							...);
SecretValue *secret_password_lookupv_binary_sync       (const SecretSchema *schema,
							GHashTable *attributes,
							GCancellable *cancellable,
							GError **error);

void         secret_password_store_binary              (const SecretSchema *schema,
                                                        const gchar *collection,
                                                        const gchar *label,
                                                        SecretValue *value,
                                                        GCancellable *cancellable,
                                                        GAsyncReadyCallback callback,
                                                        gpointer user_data,
                                                        ...);
void         secret_password_storev_binary             (const SecretSchema *schema,
                                                        GHashTable *attributes,
                                                        const gchar *collection,
                                                        const gchar *label,
                                                        SecretValue *value,
                                                        GCancellable *cancellable,
                                                        GAsyncReadyCallback callback,
                                                        gpointer user_data);

void         secret_password_searchv                   (const SecretSchema *schema,
                                                        GHashTable *attributes,
                                                        SecretSearchFlags flags,
                                                        GCancellable *cancellable,
                                                        GAsyncReadyCallback callback,
                                                        gpointer user_data);
GList *      secret_password_search_sync               (const SecretSchema *schema,
                                                        SecretSearchFlags flags,
                                                        GCancellable *cancellable,
                                                        GError **error,
                                                        ...) G_GNUC_NULL_TERMINATED;
GList *      secret_password_searchv_sync              (const SecretSchema *schema,
                                                        GHashTable *attributes,
                                                        SecretSearchFlags flags,
                                                        GCancellable *cancellable,
                                                        GError **error);
GList *      secret_password_search_finish             (GAsyncResult *result,
                                                        GError **error);

For secret_password_search* functions, this is a resurrection of !7 (merged) (reverted in !10 (merged)) with some amendment. While previously the API coerced the matched items to GHashTable, this time it directly exposes SecretItem through the new SecretRetrievable interface.

Edited by Daiki Ueno

Merge request reports