Remove custom libsecret VAPI in favour of the system-provided one.
This gives us access to the full libsecret API. * bindings/vapi/libsecret-1.vapi: Deleted. * src/client/application/secret-mediator.vala (Object): Use an internal binding to the missing SCHEMA_COMPAT_NETWORK constant.
This commit is contained in:
parent
895a4cbdd3
commit
157a109e7f
2 changed files with 9 additions and 87 deletions
|
|
@ -1,82 +0,0 @@
|
||||||
/* libsecret-1.vapi generated by vapigen-0.18 and hand-edited to add SCHEMA_COMPAT_NETWORK */
|
|
||||||
|
|
||||||
[CCode (cprefix = "Secret", gir_namespace = "Secret", gir_version = "1", lower_case_cprefix = "secret_")]
|
|
||||||
namespace Secret {
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", cname = "SECRET_SCHEMA_COMPAT_NETWORK")]
|
|
||||||
public Secret.Schema SCHEMA_COMPAT_NETWORK;
|
|
||||||
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "secret_schema_get_type ()")]
|
|
||||||
[Compact]
|
|
||||||
public class Schema {
|
|
||||||
[CCode (array_length = false, array_null_terminated = true)]
|
|
||||||
public weak Secret.SchemaAttribute[] attributes;
|
|
||||||
public Secret.SchemaFlags flags;
|
|
||||||
public weak string name;
|
|
||||||
[CCode (has_construct_function = false)]
|
|
||||||
public Schema (string name, Secret.SchemaFlags flags, ...);
|
|
||||||
[CCode (cname = "secret_schema_newv", has_construct_function = false)]
|
|
||||||
public Schema.newv (string name, Secret.SchemaFlags flags, GLib.HashTable<string,Secret.SchemaAttributeType> attribute_names_and_types);
|
|
||||||
public Secret.Schema @ref ();
|
|
||||||
public void unref ();
|
|
||||||
}
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", copy_function = "g_boxed_copy", free_function = "g_boxed_free", type_id = "secret_schema_attribute_get_type ()")]
|
|
||||||
[Compact]
|
|
||||||
public class SchemaAttribute {
|
|
||||||
public weak string name;
|
|
||||||
public Secret.SchemaAttributeType type;
|
|
||||||
}
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", cprefix = "SECRET_ERROR_", has_type_id = false)]
|
|
||||||
public enum Error {
|
|
||||||
PROTOCOL,
|
|
||||||
IS_LOCKED,
|
|
||||||
NO_SUCH_OBJECT,
|
|
||||||
ALREADY_EXISTS;
|
|
||||||
public static GLib.Quark get_quark ();
|
|
||||||
}
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", cprefix = "SECRET_SCHEMA_ATTRIBUTE_", has_type_id = false)]
|
|
||||||
public enum SchemaAttributeType {
|
|
||||||
STRING,
|
|
||||||
INTEGER,
|
|
||||||
BOOLEAN
|
|
||||||
}
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", cprefix = "SECRET_SCHEMA_", has_type_id = false)]
|
|
||||||
[Flags]
|
|
||||||
public enum SchemaFlags {
|
|
||||||
NONE,
|
|
||||||
DONT_MATCH_NAME
|
|
||||||
}
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", cname = "SECRET_COLLECTION_DEFAULT")]
|
|
||||||
public const string COLLECTION_DEFAULT;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", cname = "SECRET_COLLECTION_SESSION")]
|
|
||||||
public const string COLLECTION_SESSION;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static GLib.HashTable<string,string> attributes_build (Secret.Schema schema, ...);
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static GLib.HashTable<string,string> attributes_buildv (Secret.Schema schema, va_list va);
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static async bool password_clear (Secret.Schema schema, GLib.Cancellable? cancellable, ...) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static bool password_clear_sync (Secret.Schema schema, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", finish_name = "secret_password_clear_finish")]
|
|
||||||
public static async bool password_clearv (Secret.Schema schema, GLib.HashTable<string,string> attributes, GLib.Cancellable? cancellable) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static bool password_clearv_sync (Secret.Schema schema, GLib.HashTable<string,string> attributes, GLib.Cancellable? cancellable = null) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static async string password_lookup (Secret.Schema schema, GLib.Cancellable? cancellable, ...) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static string password_lookup_sync (Secret.Schema schema, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", finish_name = "secret_password_lookup_finish")]
|
|
||||||
public static async string password_lookupv (Secret.Schema schema, GLib.HashTable<string,string> attributes, GLib.Cancellable? cancellable) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static string password_lookupv_sync (Secret.Schema schema, GLib.HashTable<string,string> attributes, GLib.Cancellable? cancellable = null) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static async bool password_store (Secret.Schema schema, string? collection, string label, string password, GLib.Cancellable? cancellable, ...) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static bool password_store_sync (Secret.Schema schema, string? collection, string label, string password, GLib.Cancellable? cancellable = null, ...) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h", finish_name = "secret_password_store_finish")]
|
|
||||||
public static async bool password_storev (Secret.Schema schema, GLib.HashTable<string,string> attributes, string? collection, string label, string password, GLib.Cancellable? cancellable) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static bool password_storev_sync (Secret.Schema schema, GLib.HashTable<string,string> attributes, string? collection, string label, string password, GLib.Cancellable? cancellable = null) throws GLib.Error;
|
|
||||||
[CCode (cheader_filename = "libsecret/secret.h")]
|
|
||||||
public static void password_wipe (string? password);
|
|
||||||
}
|
|
||||||
|
|
@ -23,6 +23,10 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
|
||||||
private GearyApplication instance;
|
private GearyApplication instance;
|
||||||
private Geary.Nonblocking.Mutex dialog_mutex = new Geary.Nonblocking.Mutex();
|
private Geary.Nonblocking.Mutex dialog_mutex = new Geary.Nonblocking.Mutex();
|
||||||
|
|
||||||
|
// See Bug 697681
|
||||||
|
[CCode (cheader_filename = "libsecret/secret.h", cname = "SECRET_SCHEMA_COMPAT_NETWORK")]
|
||||||
|
private Secret.Schema SCHEMA_COMPAT_NETWORK;
|
||||||
|
|
||||||
|
|
||||||
public SecretMediator(GearyApplication instance) {
|
public SecretMediator(GearyApplication instance) {
|
||||||
this.instance = instance;
|
this.instance = instance;
|
||||||
|
|
@ -71,13 +75,13 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
|
||||||
// Remove legacy formats
|
// Remove legacy formats
|
||||||
// <= 0.11
|
// <= 0.11
|
||||||
yield Secret.password_clear(
|
yield Secret.password_clear(
|
||||||
Secret.SCHEMA_COMPAT_NETWORK,
|
SCHEMA_COMPAT_NETWORK,
|
||||||
cancellable,
|
cancellable,
|
||||||
"user", get_legacy_user(service, account.primary_mailbox.address)
|
"user", get_legacy_user(service, account.primary_mailbox.address)
|
||||||
);
|
);
|
||||||
// <= 0.6
|
// <= 0.6
|
||||||
yield Secret.password_clear(
|
yield Secret.password_clear(
|
||||||
Secret.SCHEMA_COMPAT_NETWORK,
|
SCHEMA_COMPAT_NETWORK,
|
||||||
cancellable,
|
cancellable,
|
||||||
"user", get_legacy_user(service, credentials.user)
|
"user", get_legacy_user(service, credentials.user)
|
||||||
);
|
);
|
||||||
|
|
@ -195,7 +199,7 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
|
||||||
throws Error {
|
throws Error {
|
||||||
// <= 0.11
|
// <= 0.11
|
||||||
string? password = yield Secret.password_lookup(
|
string? password = yield Secret.password_lookup(
|
||||||
Secret.SCHEMA_COMPAT_NETWORK,
|
SCHEMA_COMPAT_NETWORK,
|
||||||
cancellable,
|
cancellable,
|
||||||
"user", get_legacy_user(service, account.primary_mailbox.address)
|
"user", get_legacy_user(service, account.primary_mailbox.address)
|
||||||
);
|
);
|
||||||
|
|
@ -205,7 +209,7 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
|
||||||
Geary.Credentials creds = get_credentials(service, account);
|
Geary.Credentials creds = get_credentials(service, account);
|
||||||
string user = get_legacy_user(service, creds.user);
|
string user = get_legacy_user(service, creds.user);
|
||||||
password = yield Secret.password_lookup(
|
password = yield Secret.password_lookup(
|
||||||
Secret.SCHEMA_COMPAT_NETWORK,
|
SCHEMA_COMPAT_NETWORK,
|
||||||
cancellable,
|
cancellable,
|
||||||
"user", user
|
"user", user
|
||||||
);
|
);
|
||||||
|
|
@ -213,7 +217,7 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
|
||||||
// Clear the old password
|
// Clear the old password
|
||||||
if (password != null) {
|
if (password != null) {
|
||||||
yield Secret.password_clear(
|
yield Secret.password_clear(
|
||||||
Secret.SCHEMA_COMPAT_NETWORK,
|
SCHEMA_COMPAT_NETWORK,
|
||||||
cancellable,
|
cancellable,
|
||||||
"user", user
|
"user", user
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue