DevHeads.net

Introducing a plugin loading approach inside of the KWallet convenience API

Hello,

After quite a while of being busy with some other, "real world", tasks,
I managed to finish the plugin loading logic inside the KWallet API.
:-)

** The context **
Be able to switch from KWallet to KSecretsService, which is an
implementation of the freedesktop.org secret service [1]
This is quite a complex task to do, as existing applications must not be
affected.

In order to do that, it was proposed [2] to introduce a plugin loading
approach inside the KWallet logic.

** The news **
First of all, I created a branch named "ksecretsservice" in kdelibs. All
the preparatory work was (and will) be done inside that branch. I also
merged the master branch into that branch from time time so today it's
in sync with it.

The Wallet logic was modified:
- load a default plugin when first called,
- all the Wallet API calls now delegate to the loaded plugin, excepting
the following methods:
* LocalWallet,
* NetworkWallet,
* PasswordFolder,
* FormDataFolder.
- some extra, internal, methods were added to the API to let the plugin
trigger wallet signals [3]:
* emitWalletOpened()
* emitWalletClosed()
* emitFolderUpdated(const QString&)
* emitFolderListUpdated()
* emitFolderRemoved(const QString&)
- a new KDE service type was defined "KWallet/Plugin" via
kdeui/util/kwallet-plugin.desktop
* this is the type that the future wallet plugins should declare
- new header was added : kdeui/util/kwalletplugin.h
* this holds a base class named WalletPlugin that all wallet
plugins must implement

kdelibs/kwalletdefaultplugin was introduced :
- it gets the original org.kde.KWallet.xml file from kdeui/util,
- it gets the original code from kdeui/util/kwallet.cpp,
- as it's name suggests, it's loaded by default when applications access
KWallet API.

I'm currently using this setup on my computer without problems.
KWalletManager functions as usual, and the network manager plasmoid is
continuing to load my wifi password, to only mention these applications.

I also did a full rebuild of my KDE setup (94 kdesrc-build components),
holding my kdelibs version, to ensure no issues were introduced into
kwallet.h

** Next moves **
Any thoughts about this?

The current ksecretsservice branch should now be merged with kdelibs
master in order to bring in the plugin logic. I marked the commit that
should be merged to master with the tag "plugin.ready".
How should that be done? What would be the next steps to accomplish
that? Who can help with that?

Cheers,

[1] <a href="http://standards.freedesktop.org/secret-service/" title="http://standards.freedesktop.org/secret-service/">http://standards.freedesktop.org/secret-service/</a>
[2] <a href="http://mail.kde.org/pipermail/kde-utils-devel/2011-November/000705.html" title="http://mail.kde.org/pipermail/kde-utils-devel/2011-November/000705.html">http://mail.kde.org/pipermail/kde-utils-devel/2011-November/000705.html</a>
[3] This is the only way I managed to do that. Connecting signals did
not work as some forum threads suggest.

Comments

Re: Introducing a plugin loading approach inside of the KWallet

By Alex Fiestas at 01/14/2013 - 12:07

Is this Frameworks5 material only? Or could be backported to kdelibs master?

I know that kdelibs master is frozen, but I remember that we talked months ago
to do an exception, but I don't remember if we decided to do it or not.

Thanks!

Re: Introducing a plugin loading approach inside of the KWallet

By Valentin Rusu at 02/08/2013 - 18:36

Sorry for the late reply. I only see this message now.

On Monday 14 January 2013 17:07:50 Alex Fiestas wrote:
Well, it was decided to look to the future, and to bring this to KF5.
Currently there are no plans to put this new feature in KDE4.x

Re: Introducing a plugin loading approach inside of the KWallet

By Albert Astals Cid at 10/29/2012 - 14:07

Have not read anything since i'm ultra busy, so please disregard my message if
it is off topic

Can we please please plase be sure this time it works? Don't want to repeat
the fiasco we had with ksecretservice that was introduced in 4.8 and then
removed in 4.9 since it wasn't really working.

Cheers,
Albert

El Diumenge, 28 d'octubre de 2012, a les 19:42:29, Valentin Rusu va escriure:

Re: Introducing a plugin loading approach inside of the KWallet

By Valentin Rusu at 10/29/2012 - 16:21

On 10/29/2012 07:07 PM, Albert Astals Cid wrote:
This step is the first one, as decided at the time when we backed-up -
see the link [2] below.
It only takes the existing kwallet code in put it into a plugin.
I'm currently running with this setup with no issues, on my system.

Cheers,

Re: Introducing a plugin loading approach inside of the KWallet

By Thiago Macieira at 10/28/2012 - 15:43

On domingo, 28 de outubro de 2012 19.42.29, Valentin Rusu wrote:
Yes: why do you need plugins?

From the description, you could do both with simple classes inside the
library.

Unless you need to link to the secret services library, if there's one.

Re: Introducing a plugin loading approach inside of the KWallet

By Valentin Rusu at 10/28/2012 - 17:28

On 10/28/2012 08:43 PM, Thiago Macieira wrote: