mirror of
https://gitlab.gnome.org/GNOME/libsecret.git
synced 2024-12-22 04:38:55 +00:00
Implement the Service.SearchPath() method
This commit is contained in:
parent
6b4d7b6484
commit
737e3a1ca3
@ -34,7 +34,10 @@ AM_GLIB_GNU_GETTEXT
|
||||
# GLib
|
||||
#
|
||||
|
||||
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28.0 gio-2.0 >= 2.28.0 gthread-2.0 >= 2.16.0)
|
||||
PKG_CHECK_MODULES(GLIB,
|
||||
glib-2.0 >= 2.30.0
|
||||
gio-2.0 >= 2.30.0
|
||||
gio-unix-2.0)
|
||||
LIBS="$LIBS $GLIB_LIBS"
|
||||
CFLAGS="$CFLAGS $GLIB_CFLAGS"
|
||||
|
||||
|
@ -11,11 +11,15 @@ module_flags = \
|
||||
|
||||
lib_LTLIBRARIES = libgsecret.la
|
||||
|
||||
BUILT_SOURCES = \
|
||||
gsecret-dbus-generated.c gsecret-dbus-generated.h
|
||||
|
||||
libgsecret_la_SOURCES = \
|
||||
gsecret-value.h gsecret-value.c \
|
||||
gsecret-item.h gsecret-item.c \
|
||||
gsecret-service.h gsecret-service.c \
|
||||
gsecret-util.c \
|
||||
$(BUILT_SOURCES) \
|
||||
$(NULL)
|
||||
|
||||
libgsecret_la_CFLAGS = \
|
||||
@ -25,3 +29,14 @@ libgsecret_la_LIBADD = \
|
||||
$(top_builddir)/egg/libegg.la \
|
||||
$(LIBGCRYPT_LIBS) \
|
||||
$(LIBS)
|
||||
|
||||
DBUS_XML_DEFINITIONS = \
|
||||
org.freedesktop.Secrets.xml
|
||||
|
||||
gsecret-dbus-generated.c: $(DBUS_XML_DEFINITIONS) Makefile.am
|
||||
$(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.Secret. \
|
||||
--generate-c-code gsecret-dbus-generated --c-namespace GSecretGen \
|
||||
$(DBUS_XML_DEFINITIONS)
|
||||
$(AM_V_GEN) sed -i -e 's/gsecret_gen_/_gsecret_gen_/g' gsecret-dbus-generated.[ch]
|
||||
|
||||
gsecret-dbus-generated.h: gsecret-dbus-generated.c
|
||||
|
3125
library/gsecret-dbus-generated.c
Normal file
3125
library/gsecret-dbus-generated.c
Normal file
File diff suppressed because it is too large
Load Diff
444
library/gsecret-dbus-generated.h
Normal file
444
library/gsecret-dbus-generated.h
Normal file
@ -0,0 +1,444 @@
|
||||
/*
|
||||
* Generated by gdbus-codegen 2.30.1. DO NOT EDIT.
|
||||
*
|
||||
* The license of this code is the same as for the source it was derived from.
|
||||
*/
|
||||
|
||||
#ifndef __GSECRET_DBUS_GENERATED_H__
|
||||
#define __GSECRET_DBUS_GENERATED_H__
|
||||
|
||||
#include <gio/gio.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
/* Declarations for org.freedesktop.Secret.Service */
|
||||
|
||||
#define GSECRET_GEN_TYPE_SERVICE (_gsecret_gen_service_get_type ())
|
||||
#define GSECRET_GEN_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSECRET_GEN_TYPE_SERVICE, GSecretGenService))
|
||||
#define GSECRET_GEN_IS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSECRET_GEN_TYPE_SERVICE))
|
||||
#define GSECRET_GEN_SERVICE_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GSECRET_GEN_TYPE_SERVICE, GSecretGenServiceIface))
|
||||
|
||||
struct _GSecretGenService;
|
||||
typedef struct _GSecretGenService GSecretGenService;
|
||||
typedef struct _GSecretGenServiceIface GSecretGenServiceIface;
|
||||
|
||||
struct _GSecretGenServiceIface
|
||||
{
|
||||
GTypeInterface parent_iface;
|
||||
|
||||
|
||||
|
||||
gboolean (*handle_create_collection) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *arg_properties,
|
||||
const gchar *arg_alias);
|
||||
|
||||
gboolean (*handle_get_secrets) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *const *arg_items,
|
||||
const gchar *arg_session);
|
||||
|
||||
gboolean (*handle_lock) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *const *arg_objects);
|
||||
|
||||
gboolean (*handle_open_session) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *arg_algorithm,
|
||||
GVariant *arg_input);
|
||||
|
||||
gboolean (*handle_read_alias) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *arg_name);
|
||||
|
||||
gboolean (*handle_search_items) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *arg_attributes);
|
||||
|
||||
gboolean (*handle_set_alias) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *arg_name,
|
||||
const gchar *arg_collection);
|
||||
|
||||
gboolean (*handle_unlock) (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *const *arg_objects);
|
||||
|
||||
const gchar *const * (*get_collections) (GSecretGenService *object);
|
||||
|
||||
void (*collection_changed) (
|
||||
GSecretGenService *object,
|
||||
const gchar *arg_collection);
|
||||
|
||||
void (*collection_created) (
|
||||
GSecretGenService *object,
|
||||
const gchar *arg_collection);
|
||||
|
||||
void (*collection_deleted) (
|
||||
GSecretGenService *object,
|
||||
const gchar *arg_collection);
|
||||
|
||||
};
|
||||
|
||||
GType _gsecret_gen_service_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDBusInterfaceInfo *_gsecret_gen_service_interface_info (void);
|
||||
guint _gsecret_gen_service_override_properties (GObjectClass *klass, guint property_id_begin);
|
||||
|
||||
|
||||
/* D-Bus method call completion functions: */
|
||||
void _gsecret_gen_service_complete_open_session (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *output,
|
||||
const gchar *result);
|
||||
|
||||
void _gsecret_gen_service_complete_create_collection (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *collection,
|
||||
const gchar *prompt);
|
||||
|
||||
void _gsecret_gen_service_complete_search_items (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *const *unlocked,
|
||||
const gchar *const *locked);
|
||||
|
||||
void _gsecret_gen_service_complete_unlock (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *const *unlocked,
|
||||
const gchar *prompt);
|
||||
|
||||
void _gsecret_gen_service_complete_lock (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *const *locked,
|
||||
const gchar *Prompt);
|
||||
|
||||
void _gsecret_gen_service_complete_get_secrets (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
GVariant *secrets);
|
||||
|
||||
void _gsecret_gen_service_complete_read_alias (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation,
|
||||
const gchar *collection);
|
||||
|
||||
void _gsecret_gen_service_complete_set_alias (
|
||||
GSecretGenService *object,
|
||||
GDBusMethodInvocation *invocation);
|
||||
|
||||
|
||||
|
||||
/* D-Bus signal emissions functions: */
|
||||
void _gsecret_gen_service_emit_collection_created (
|
||||
GSecretGenService *object,
|
||||
const gchar *arg_collection);
|
||||
|
||||
void _gsecret_gen_service_emit_collection_deleted (
|
||||
GSecretGenService *object,
|
||||
const gchar *arg_collection);
|
||||
|
||||
void _gsecret_gen_service_emit_collection_changed (
|
||||
GSecretGenService *object,
|
||||
const gchar *arg_collection);
|
||||
|
||||
|
||||
|
||||
/* D-Bus method calls: */
|
||||
void _gsecret_gen_service_call_open_session (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *arg_algorithm,
|
||||
GVariant *arg_input,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_open_session_finish (
|
||||
GSecretGenService *proxy,
|
||||
GVariant **out_output,
|
||||
gchar **out_result,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_open_session_sync (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *arg_algorithm,
|
||||
GVariant *arg_input,
|
||||
GVariant **out_output,
|
||||
gchar **out_result,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_create_collection (
|
||||
GSecretGenService *proxy,
|
||||
GVariant *arg_properties,
|
||||
const gchar *arg_alias,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_create_collection_finish (
|
||||
GSecretGenService *proxy,
|
||||
gchar **out_collection,
|
||||
gchar **out_prompt,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_create_collection_sync (
|
||||
GSecretGenService *proxy,
|
||||
GVariant *arg_properties,
|
||||
const gchar *arg_alias,
|
||||
gchar **out_collection,
|
||||
gchar **out_prompt,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_search_items (
|
||||
GSecretGenService *proxy,
|
||||
GVariant *arg_attributes,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_search_items_finish (
|
||||
GSecretGenService *proxy,
|
||||
gchar ***out_unlocked,
|
||||
gchar ***out_locked,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_search_items_sync (
|
||||
GSecretGenService *proxy,
|
||||
GVariant *arg_attributes,
|
||||
gchar ***out_unlocked,
|
||||
gchar ***out_locked,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_unlock (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *const *arg_objects,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_unlock_finish (
|
||||
GSecretGenService *proxy,
|
||||
gchar ***out_unlocked,
|
||||
gchar **out_prompt,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_unlock_sync (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *const *arg_objects,
|
||||
gchar ***out_unlocked,
|
||||
gchar **out_prompt,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_lock (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *const *arg_objects,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_lock_finish (
|
||||
GSecretGenService *proxy,
|
||||
gchar ***out_locked,
|
||||
gchar **out_Prompt,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_lock_sync (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *const *arg_objects,
|
||||
gchar ***out_locked,
|
||||
gchar **out_Prompt,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_get_secrets (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *const *arg_items,
|
||||
const gchar *arg_session,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_get_secrets_finish (
|
||||
GSecretGenService *proxy,
|
||||
GVariant **out_secrets,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_get_secrets_sync (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *const *arg_items,
|
||||
const gchar *arg_session,
|
||||
GVariant **out_secrets,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_read_alias (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *arg_name,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_read_alias_finish (
|
||||
GSecretGenService *proxy,
|
||||
gchar **out_collection,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_read_alias_sync (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *arg_name,
|
||||
gchar **out_collection,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_call_set_alias (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *arg_name,
|
||||
const gchar *arg_collection,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean _gsecret_gen_service_call_set_alias_finish (
|
||||
GSecretGenService *proxy,
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
|
||||
gboolean _gsecret_gen_service_call_set_alias_sync (
|
||||
GSecretGenService *proxy,
|
||||
const gchar *arg_name,
|
||||
const gchar *arg_collection,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
||||
|
||||
/* D-Bus property accessors: */
|
||||
const gchar *const *_gsecret_gen_service_get_collections (GSecretGenService *object);
|
||||
gchar **_gsecret_gen_service_dup_collections (GSecretGenService *object);
|
||||
void _gsecret_gen_service_set_collections (GSecretGenService *object, const gchar *const *value);
|
||||
|
||||
|
||||
/* ---- */
|
||||
|
||||
#define GSECRET_GEN_TYPE_SERVICE_PROXY (_gsecret_gen_service_proxy_get_type ())
|
||||
#define GSECRET_GEN_SERVICE_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSECRET_GEN_TYPE_SERVICE_PROXY, GSecretGenServiceProxy))
|
||||
#define GSECRET_GEN_SERVICE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSECRET_GEN_TYPE_SERVICE_PROXY, GSecretGenServiceProxyClass))
|
||||
#define GSECRET_GEN_SERVICE_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSECRET_GEN_TYPE_SERVICE_PROXY, GSecretGenServiceProxyClass))
|
||||
#define GSECRET_GEN_IS_SERVICE_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSECRET_GEN_TYPE_SERVICE_PROXY))
|
||||
#define GSECRET_GEN_IS_SERVICE_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSECRET_GEN_TYPE_SERVICE_PROXY))
|
||||
|
||||
typedef struct _GSecretGenServiceProxy GSecretGenServiceProxy;
|
||||
typedef struct _GSecretGenServiceProxyClass GSecretGenServiceProxyClass;
|
||||
typedef struct _GSecretGenServiceProxyPrivate GSecretGenServiceProxyPrivate;
|
||||
|
||||
struct _GSecretGenServiceProxy
|
||||
{
|
||||
/*< private >*/
|
||||
GDBusProxy parent_instance;
|
||||
GSecretGenServiceProxyPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GSecretGenServiceProxyClass
|
||||
{
|
||||
GDBusProxyClass parent_class;
|
||||
};
|
||||
|
||||
GType _gsecret_gen_service_proxy_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void _gsecret_gen_service_proxy_new (
|
||||
GDBusConnection *connection,
|
||||
GDBusProxyFlags flags,
|
||||
const gchar *name,
|
||||
const gchar *object_path,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GSecretGenService *_gsecret_gen_service_proxy_new_finish (
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
GSecretGenService *_gsecret_gen_service_proxy_new_sync (
|
||||
GDBusConnection *connection,
|
||||
GDBusProxyFlags flags,
|
||||
const gchar *name,
|
||||
const gchar *object_path,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
void _gsecret_gen_service_proxy_new_for_bus (
|
||||
GBusType bus_type,
|
||||
GDBusProxyFlags flags,
|
||||
const gchar *name,
|
||||
const gchar *object_path,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GSecretGenService *_gsecret_gen_service_proxy_new_for_bus_finish (
|
||||
GAsyncResult *res,
|
||||
GError **error);
|
||||
GSecretGenService *_gsecret_gen_service_proxy_new_for_bus_sync (
|
||||
GBusType bus_type,
|
||||
GDBusProxyFlags flags,
|
||||
const gchar *name,
|
||||
const gchar *object_path,
|
||||
GCancellable *cancellable,
|
||||
GError **error);
|
||||
|
||||
|
||||
/* ---- */
|
||||
|
||||
#define GSECRET_GEN_TYPE_SERVICE_SKELETON (_gsecret_gen_service_skeleton_get_type ())
|
||||
#define GSECRET_GEN_SERVICE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSECRET_GEN_TYPE_SERVICE_SKELETON, GSecretGenServiceSkeleton))
|
||||
#define GSECRET_GEN_SERVICE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GSECRET_GEN_TYPE_SERVICE_SKELETON, GSecretGenServiceSkeletonClass))
|
||||
#define GSECRET_GEN_SERVICE_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSECRET_GEN_TYPE_SERVICE_SKELETON, GSecretGenServiceSkeletonClass))
|
||||
#define GSECRET_GEN_IS_SERVICE_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSECRET_GEN_TYPE_SERVICE_SKELETON))
|
||||
#define GSECRET_GEN_IS_SERVICE_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSECRET_GEN_TYPE_SERVICE_SKELETON))
|
||||
|
||||
typedef struct _GSecretGenServiceSkeleton GSecretGenServiceSkeleton;
|
||||
typedef struct _GSecretGenServiceSkeletonClass GSecretGenServiceSkeletonClass;
|
||||
typedef struct _GSecretGenServiceSkeletonPrivate GSecretGenServiceSkeletonPrivate;
|
||||
|
||||
struct _GSecretGenServiceSkeleton
|
||||
{
|
||||
/*< private >*/
|
||||
GDBusInterfaceSkeleton parent_instance;
|
||||
GSecretGenServiceSkeletonPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GSecretGenServiceSkeletonClass
|
||||
{
|
||||
GDBusInterfaceSkeletonClass parent_class;
|
||||
};
|
||||
|
||||
GType _gsecret_gen_service_skeleton_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GSecretGenService *_gsecret_gen_service_skeleton_new (void);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSECRET_DBUS_GENERATED_H__ */
|
@ -12,6 +12,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gsecret-dbus-generated.h"
|
||||
#include "gsecret-private.h"
|
||||
#include "gsecret-service.h"
|
||||
#include "gsecret-types.h"
|
||||
@ -130,7 +131,7 @@ _gsecret_service_bare_instance (GDBusConnection *connection,
|
||||
|
||||
service = g_initable_new (GSECRET_TYPE_SERVICE, NULL, &error,
|
||||
"g-flags", G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
|
||||
"g-interface-info", NULL, /* TODO: */
|
||||
"g-interface-info", _gsecret_gen_service_interface_info (),
|
||||
"g-name", bus_name,
|
||||
"g-connection", connection,
|
||||
"g-object-path", GSECRET_SERVICE_PATH,
|
||||
@ -867,3 +868,134 @@ _gsecret_service_encode_secret (GSecretService *self,
|
||||
g_variant_type_free (type);
|
||||
return result;
|
||||
}
|
||||
|
||||
static GVariant *
|
||||
_gsecret_util_variant_for_attributes (GHashTable *attributes)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
GVariantBuilder builder;
|
||||
const gchar *name;
|
||||
const gchar *value;
|
||||
|
||||
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ssv)"));
|
||||
|
||||
g_hash_table_iter_init (&iter, attributes);
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *)&name, (gpointer *)&value))
|
||||
g_variant_builder_add (&builder, "(ss)", name, value);
|
||||
|
||||
return g_variant_builder_end (&builder);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
on_search_items_complete (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *res = G_SIMPLE_ASYNC_RESULT (user_data);
|
||||
GError *error = NULL;
|
||||
GVariant *response;
|
||||
|
||||
response = g_dbus_proxy_call_finish (G_DBUS_PROXY (source), result, &error);
|
||||
if (error != NULL)
|
||||
g_simple_async_result_take_error (res, error);
|
||||
else
|
||||
g_simple_async_result_set_op_res_gpointer (res, response,
|
||||
(GDestroyNotify)g_variant_unref);
|
||||
|
||||
g_simple_async_result_complete (res);
|
||||
g_object_unref (res);
|
||||
}
|
||||
|
||||
void
|
||||
gsecret_service_search_paths (GSecretService *self,
|
||||
GHashTable *attributes,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *res;
|
||||
|
||||
g_return_if_fail (GSECRET_IS_SERVICE (self));
|
||||
g_return_if_fail (attributes != NULL);
|
||||
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
|
||||
|
||||
res = g_simple_async_result_new (G_OBJECT (self), callback, user_data,
|
||||
gsecret_service_search_paths);
|
||||
|
||||
g_dbus_proxy_call (G_DBUS_PROXY (self), "SearchItems",
|
||||
_gsecret_util_variant_for_attributes (attributes),
|
||||
G_DBUS_CALL_FLAGS_NONE, -1, cancellable,
|
||||
on_search_items_complete, g_object_ref (res));
|
||||
|
||||
g_object_unref (res);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gsecret_service_search_paths_finish (GSecretService *self,
|
||||
GAsyncResult *result,
|
||||
gchar ***unlocked,
|
||||
gchar ***locked,
|
||||
GError **error)
|
||||
{
|
||||
GVariant *response;
|
||||
GSimpleAsyncResult *res;
|
||||
gchar **dummy = NULL;
|
||||
|
||||
g_return_val_if_fail (g_simple_async_result_is_valid (result, G_OBJECT (self),
|
||||
gsecret_service_search_paths), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
res = G_SIMPLE_ASYNC_RESULT (result);
|
||||
if (g_simple_async_result_propagate_error (res, error))
|
||||
return FALSE;
|
||||
|
||||
if (unlocked || locked) {
|
||||
if (!unlocked)
|
||||
unlocked = &dummy;
|
||||
else if (!locked)
|
||||
locked = &dummy;
|
||||
response = g_simple_async_result_get_op_res_gpointer (res);
|
||||
g_variant_get (response, "(^ao^ao)", unlocked, locked);
|
||||
}
|
||||
|
||||
g_strfreev (dummy);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gsecret_service_search_paths_sync (GSecretService *self,
|
||||
GHashTable *attributes,
|
||||
GCancellable *cancellable,
|
||||
gchar ***unlocked,
|
||||
gchar ***locked,
|
||||
GError **error)
|
||||
{
|
||||
gchar **dummy = NULL;
|
||||
GVariant *response;
|
||||
|
||||
g_return_val_if_fail (GSECRET_IS_SERVICE (self), FALSE);
|
||||
g_return_val_if_fail (attributes != NULL, FALSE);
|
||||
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
response = g_dbus_proxy_call_sync (G_DBUS_PROXY (self), "SearchItems",
|
||||
_gsecret_util_variant_for_attributes (attributes),
|
||||
G_DBUS_CALL_FLAGS_NONE, -1, cancellable, error);
|
||||
|
||||
if (response != NULL) {
|
||||
if (unlocked || locked) {
|
||||
if (!unlocked)
|
||||
unlocked = &dummy;
|
||||
else if (!locked)
|
||||
locked = &dummy;
|
||||
g_variant_get (response, "(^ao^ao)", unlocked, locked);
|
||||
}
|
||||
|
||||
g_variant_unref (response);
|
||||
}
|
||||
|
||||
g_strfreev (dummy);
|
||||
|
||||
return response != NULL;
|
||||
}
|
||||
|
@ -108,26 +108,28 @@ gboolean gsecret_service_search_sync (GSecretService *se
|
||||
GList **unlocked,
|
||||
GList **locked,
|
||||
GError **error);
|
||||
#endif
|
||||
|
||||
void gsecret_service_search_for_paths (GSecretService *self,
|
||||
void gsecret_service_search_paths (GSecretService *self,
|
||||
GHashTable *attributes,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
|
||||
gboolean gsecret_service_search_for_paths_finish (GSecretService *self,
|
||||
gboolean gsecret_service_search_paths_finish (GSecretService *self,
|
||||
GAsyncResult *result,
|
||||
gchar ***unlocked,
|
||||
gchar ***locked,
|
||||
GError **error);
|
||||
|
||||
gboolean gsecret_service_search_for_paths_sync (GSecretService *self,
|
||||
gboolean gsecret_service_search_paths_sync (GSecretService *self,
|
||||
GHashTable *attributes,
|
||||
GCancellable *cancellable,
|
||||
gchar ***unlocked,
|
||||
gchar ***locked,
|
||||
GError **error);
|
||||
|
||||
#if 0
|
||||
void gsecret_service_lock (GSecretService *self,
|
||||
GList *objects,
|
||||
GCancellable *cancellable,
|
||||
|
176
library/org.freedesktop.Secrets.xml
Normal file
176
library/org.freedesktop.Secrets.xml
Normal file
@ -0,0 +1,176 @@
|
||||
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
|
||||
<node name="/org/freedesktop/Secrets">
|
||||
|
||||
<interface name="org.freedesktop.Secret.Service">
|
||||
<property name="Collections" type="ao" access="read" />
|
||||
|
||||
<method name="OpenSession">
|
||||
<arg name="algorithm" type="s" direction="in"/>
|
||||
<arg name="input" type="v" direction="in"/>
|
||||
<arg name="output" type="v" direction="out"/>
|
||||
<arg name="result" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="CreateCollection">
|
||||
<arg name="properties" type="a{sv}" direction="in"/>
|
||||
<arg name="alias" type="s" direction="in"/>
|
||||
<arg name="collection" type="o" direction="out"/>
|
||||
<arg name="prompt" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="SearchItems">
|
||||
<arg name="attributes" type="a{ss}" direction="in"/>
|
||||
<arg name="unlocked" type="ao" direction="out"/>
|
||||
<arg name="locked" type="ao" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="Unlock">
|
||||
<arg name="objects" type="ao" direction="in"/>
|
||||
<arg name="unlocked" type="ao" direction="out"/>
|
||||
<arg name="prompt" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="Lock">
|
||||
<arg name="objects" type="ao" direction="in"/>
|
||||
<arg name="locked" type="ao" direction="out"/>
|
||||
<arg name="Prompt" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="GetSecrets">
|
||||
<arg name="items" type="ao" direction="in"/>
|
||||
<arg name="session" type="o" direction="in"/>
|
||||
<arg name="secrets" type="a{o(oayays)}" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="ReadAlias">
|
||||
<arg name="name" type='s' direction='in'/>
|
||||
<arg name="collection" type='o' direction='out'/>
|
||||
</method>
|
||||
|
||||
<method name="SetAlias">
|
||||
<arg name="name" type='s' direction='in'/>
|
||||
<arg name="collection" type='o' direction='in'/>
|
||||
</method>
|
||||
|
||||
<signal name="CollectionCreated">
|
||||
<arg name="collection" type="o"/>
|
||||
</signal>
|
||||
|
||||
<signal name="CollectionDeleted">
|
||||
<arg name="collection" type="o"/>
|
||||
</signal>
|
||||
|
||||
<signal name="CollectionChanged">
|
||||
<arg name="collection" type="o"/>
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
|
||||
<node name="/org/freedesktop/Secrets/collection/xxxx">
|
||||
|
||||
<interface name="org.freedesktop.Secret.Collection">
|
||||
|
||||
<property name="Items" type="ao" access="read"/>
|
||||
<property name="Label" type="s" access="readwrite"/>
|
||||
<property name="Locked" type="b" access="read"/>
|
||||
<property name="Created" type="t" access="read"/>
|
||||
<property name="Modified" type="t" access="read"/>
|
||||
|
||||
<method name="Delete">
|
||||
<arg name="prompt" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="SearchItems">
|
||||
<arg name="attributes" type="a{ss}" direction="in"/>
|
||||
<arg name="results" type="ao" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="CreateItem">
|
||||
<arg name="properties" type="a{sv}" direction="in"/>
|
||||
<arg name="secret" type="(oayays)" direction="in"/>
|
||||
<arg name="replace" type="b" direction="in"/>
|
||||
<arg name="item" type="o" direction="out"/>
|
||||
<arg name="prompt" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<signal name="ItemCreated">
|
||||
<arg name="item" type="o"/>
|
||||
</signal>
|
||||
|
||||
<signal name="ItemDeleted">
|
||||
<arg name="item" type="o"/>
|
||||
</signal>
|
||||
|
||||
<signal name="ItemChanged">
|
||||
<arg name="item" type="o"/>
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
|
||||
<node name="/org/freedesktop/Secret/collection/xxxx/iiii">
|
||||
|
||||
<interface name="org.freedesktop.Secret.Item">
|
||||
|
||||
<property name="Locked" type="b" access="read"/>
|
||||
|
||||
<property name="Attributes" type="a{ss}" access="readwrite"/>
|
||||
|
||||
<property name="Label" type="s" access="readwrite"/>
|
||||
|
||||
<property name="Created" type="t" access="read"/>
|
||||
|
||||
<property name="Modified" type="t" access="read"/>
|
||||
|
||||
<method name="Delete">
|
||||
<arg name="Prompt" type="o" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="GetSecret">
|
||||
<arg name="session" type="o" direction="in"/>
|
||||
<arg name="secret" type="(oayays)" direction="out"/>
|
||||
</method>
|
||||
|
||||
<method name="SetSecret">
|
||||
<arg name="secret" type="(oayays)" direction="in"/>
|
||||
</method>
|
||||
|
||||
</interface>
|
||||
|
||||
</node>
|
||||
|
||||
</node>
|
||||
|
||||
<node name="/org/freedesktop/Secret/session/ssss">
|
||||
|
||||
<interface name="org.freedesktop.Secret.Session">
|
||||
|
||||
<method name="Close">
|
||||
</method>
|
||||
|
||||
</interface>
|
||||
|
||||
</node>
|
||||
|
||||
<node name="/org/freedesktop/Secret/prompts/pppp">
|
||||
|
||||
<interface name="org.freedesktop.Secret.Prompt">
|
||||
|
||||
<method name="Prompt">
|
||||
<arg name="window-id" type="s" direction="in"/>
|
||||
</method>
|
||||
|
||||
<method name="Dismiss">
|
||||
</method>
|
||||
|
||||
<signal name="Completed">
|
||||
<arg name="dismissed" type="b"/>
|
||||
<arg name="result" type="v"/>
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
|
||||
</node>
|
||||
|
||||
</node>
|
@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2011-09-25 22:56+0200\n"
|
||||
"POT-Creation-Date: 2011-11-05 20:58+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@ -22,8 +22,8 @@ msgstr ""
|
||||
msgid "Received invalid secret from the secret storage"
|
||||
msgstr ""
|
||||
|
||||
#: ../library/gsecret-service.c:343 ../library/gsecret-service.c:383
|
||||
#: ../library/gsecret-service.c:543
|
||||
#: ../library/gsecret-service.c:344 ../library/gsecret-service.c:384
|
||||
#: ../library/gsecret-service.c:544
|
||||
#, c-format
|
||||
msgid "Couldn't communicate with the secret storage"
|
||||
msgstr ""
|
||||
|
Loading…
Reference in New Issue
Block a user