← Back to team overview

syncany-team team mailing list archive

User interface interaction in plugins

 

Hello again my friends,

I hope you're enjoying your holidays! I for one am on my way to work :-)

One more thing I wanted to update you on: I re-implemented the WebDAV
plugin and it works really well (fast and realiable). One might even say it
works better/faster than the other plugins (expect "local", of course).

The WebDAV plugin works perfectly for HTTP and HTTPS, however, since it
uses HTTP BASIC authentication, it should not be used with HTTP -- which
brings me to my little issue:

The HTTPS connection needs to validate the server certificate, and because
many people (including me) might only have self-signed certificates, there
also has to be a user interaction ("Do you really want to accept this
ceritificate?"). Right now, the plugins are completely "Syncany"-agnostic,
meaning they don't even know the Config object.

To implement a user interaction, however, they (1) must be made aware of
the config (to retrieve a trust store, once the ceritifcate has been
accepted; easy to implement) and (2) they must interact with the user
interface. For the WebDAV plugin, this means returning a true/false value
from the CLI / GUI:

https://github.com/binwiederhier/syncany/blob/ec1908a7fde5ceb8494028f6d7e7f083b8223a1a/syncany-plugins/syncany-plugin-webdav/src/main/java/org/syncany/connection/plugins/webdav/WebdavConnection.java#L83

For other plugins in the future, this might be more complex. Any ideas how
to design/implement this? Event Bus?

Best,
Philipp