moonshot-ui needs to support libsecret1

Bug #1806262 reported by Sam Hartman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Moonshot ID Selector
New
High
Unassigned
moonshot-ui (Debian)
Fix Released
Unknown

Bug Description

Debian and Ubuntu are removing libgnome-keyring in favor of the freedesktop.org secret service.
For most OSes, libgnome-keyring has actually been proxying to the secret service for a while now (although Centos6 may be old enough that is not the case).

The APIs are similar, but significantly different.

I've written a patch which I've checked in on the libsecret branch of the moonshot-ui repository to add this support.
I'd appreciate review of that patch before releasing in Debian.

The patch significantly refactors the keyring store code.

* All the code that is independent of how we get to the linux keyring is factored into an abstract base class KeyringStoreBase (src/moonshot-keyring-store-base.vala). In any given build we'll only have one implementation of this class, but separation of concerns made it significantly easier to design the code and factor out common elements.

* The serialization and deserialization code was inline with the load and store functions. Those functions were overly complex and would be hard to reuse in a future-proof manner. Refactored the deserialization and serialization code into the abstract base class. Seting with both libsecret and gnome-keyring suggests that I seem to have not accidentally changed the serialization format.

* Create moonshot-keyring-store-secret|gnome.vala that both implement KeyringStore. At most one of these will be selected by configure.ac logic.

* Enable keyring if either LIBSECRET_KEYRING or GNOME_KEYRING are defined.

Again, this is available on the libsecret gitlab branch for review. I'd like to check this into Debian within a week or so to get in time for the buster freeze starting in January.

Changed in moonshot-ui (Debian):
status: Unknown → New
Revision history for this message
Alejandro Perez (alejandro-perez-mendez) wrote : Re: [Bug 1806262] [NEW] moonshot-ui needs to support libsecret1

> Debian and Ubuntu are removing libgnome-keyring in favor of the freedesktop.org secret service.
> For most OSes, libgnome-keyring has actually been proxying to the secret service for a while now (although Centos6 may be old enough that is not the case).

Indeed, in CentOS6 there is not libsecret available.

>
> The APIs are similar, but significantly different.

Yes.

>
> I've written a patch which I've checked in on the libsecret branch of the moonshot-ui repository to add this support.
> I'd appreciate review of that patch before releasing in Debian.
>
> The patch significantly refactors the keyring store code.
>
> * All the code that is independent of how we get to the linux keyring is
> factored into an abstract base class KeyringStoreBase (src/moonshot-
> keyring-store-base.vala). In any given build we'll only have one
> implementation of this class, but separation of concerns made it
> significantly easier to design the code and factor out common elements.
>
> * The serialization and deserialization code was inline with the load
> and store functions. Those functions were overly complex and would be
> hard to reuse in a future-proof manner. Refactored the deserialization
> and serialization code into the abstract base class. Seting with both
> libsecret and gnome-keyring suggests that I seem to have not
> accidentally changed the serialization format.
>
> * Create moonshot-keyring-store-secret|gnome.vala that both implement
> KeyringStore. At most one of these will be selected by configure.ac
> logic.
>
> * Enable keyring if either LIBSECRET_KEYRING or GNOME_KEYRING are
> defined.
>
> Again, this is available on the libsecret gitlab branch for review. I'd
> like to check this into Debian within a week or so to get in time for
> the buster freeze starting in January.

I agree with the proposed changes. I'm actually reviewing the code right
now and passing it through the CI.
I will provide feedback and additional commits to fix support for
CentOS6, Ubuntu 14.04 and Alpine that seem to not work out of the box.

Centos 7, Debian 8 and 9 and Ubuntu 16.04 and 18.04 seem ok.

Revision history for this message
Alejandro Perez (alejandro-perez-mendez) wrote :

Hi Sam,

Your code looks good to me. I've found only a couple of minor issues that I detail below:

* The code does not build in CentOS 6 due to a problem with how old vala handles Hash tables. This one is fixed on my branch (see below).
* The code does not build in Ubuntu 14.04 because for some reason it fails to find definitions for "Collections" and "Item". This is not a problem because we can build with GKR for this target.
* The code does not build in Alpine v3.8 because they do not ship the .vapi file for libsecret-1. This also easily fixed as just including it from another distribution in our vapi folder does the trick.

I've pushed a new branch called libsecret_alex including two additional commits on top of yours:
* The first one fixes building in CentOS6 by switching to HashTable.lookup() rather than HashTable[]. It also removes a spurious printf line.
* The second one just make indentation more consistent, by using 4 spaces as for the rest of the code.

Changed in moonshot-ui (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.