Inconsistent libsecret behavior in password_storev and password_lookupv in flatpak
I'm working on storing credentials for my application. I'm using
"runtime": "org.gnome.Platform",
"runtime-version": "3.38",
"sdk": "org.gnome.Sdk",
with permissions:
"--share=ipc",
"--share=network",
"--filesystem=home",
"--device=dri",
"--socket=fallback-x11",
"--socket=wayland"
With the flathub shared-modules libsecret (0.20.4 at time of writing).
When built and run outside of flatpak, I'm able to store and persist secrets.
On Ubuntu 20.04, calls to Secret.password_lookupv
and Secret.password_storev
never call my callback.
On Fedora 33, I see the password_storev succeed, but on the next launch, the password is not persisted.
I'm not too familiar with debugging the flatpak infrastructure, so if there's any more information I can provide or check, please let me know.
Edit: This is what my calls look like:
thief_secret = new Secret.Schema (
"com.kmwallio.thiefmd.secret", Secret.SchemaFlags.NONE,
"type", Secret.SchemaAttributeType.STRING,
"endpoint", Secret.SchemaAttributeType.STRING,
"alias", Secret.SchemaAttributeType.STRING);
var attributes = new GLib.HashTable<string,string> (str_hash, str_equal);
attributes["type"] = type;
attributes["endpoint"] = endpoint;
attributes["alias"] = alias;
Secret.password_storev.begin (
thief_secret,
attributes,
Secret.COLLECTION_DEFAULT,
"%s:%s".printf(endpoint, alias),
secret,
null, (obj, async_res) =>
{
thief_secret = new Secret.Schema (
"com.kmwallio.thiefmd.secret", Secret.SchemaFlags.NONE,
"type", Secret.SchemaAttributeType.STRING,
"endpoint", Secret.SchemaAttributeType.STRING,
"alias", Secret.SchemaAttributeType.STRING);
var attributes = new GLib.HashTable<string,string> (str_hash, str_equal);
attributes["type"] = type;
attributes["endpoint"] = endpoint;
attributes["alias"] = user;
Secret.password_lookupv.begin (thief_secret, attributes, null, (obj, async_res) => {
Edited by Miles Wallio