diff sat_frontends/bridge/dbus_bridge.py @ 2733:e347e32aa07f

core (memory/encryption): new encryptionNamespaceGet and encryptionTrustUIGet methods: - encryptionNamespaceGet retrieves algorithm namespace from its short name - encryptionTrustUIGet retrieves trust mangement XMLUI from encryption plugin - new markAsUntrusted internal helper method, to add untrusted flag to message data
author Goffi <goffi@goffi.org>
date Wed, 02 Jan 2019 18:22:30 +0100
parents 4e130cc9bfc0
children da59ff099b32
line wrap: on
line diff
--- a/sat_frontends/bridge/dbus_bridge.py	Thu Dec 27 11:40:04 2018 +0100
+++ b/sat_frontends/bridge/dbus_bridge.py	Wed Jan 02 18:22:30 2019 +0100
@@ -245,6 +245,20 @@
             error_handler = lambda err:errback(dbus_to_bridge_exception(err))
         return self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)
 
+    def encryptionNamespaceGet(self, arg_0, callback=None, errback=None):
+        if callback is None:
+            error_handler = None
+        else:
+            if errback is None:
+                errback = log.error
+            error_handler = lambda err:errback(dbus_to_bridge_exception(err))
+        kwargs={}
+        if callback is not None:
+            kwargs['timeout'] = const_TIMEOUT
+            kwargs['reply_handler'] = callback
+            kwargs['error_handler'] = error_handler
+        return unicode(self.db_core_iface.encryptionNamespaceGet(arg_0, **kwargs))
+
     def encryptionPluginsGet(self, callback=None, errback=None):
         if callback is None:
             error_handler = None
@@ -259,6 +273,15 @@
             kwargs['error_handler'] = error_handler
         return self.db_core_iface.encryptionPluginsGet(**kwargs)
 
+    def encryptionTrustUIGet(self, namespace, arg_1, profile_key, callback=None, errback=None):
+        if callback is None:
+            error_handler = None
+        else:
+            if errback is None:
+                errback = log.error
+            error_handler = lambda err:errback(dbus_to_bridge_exception(err))
+        return unicode(self.db_core_iface.encryptionTrustUIGet(namespace, arg_1, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler))
+
     def getConfig(self, section, name, callback=None, errback=None):
         if callback is None:
             error_handler = None
@@ -532,7 +555,7 @@
             kwargs['error_handler'] = error_handler
         return unicode(self.db_core_iface.messageEncryptionGet(to_jid, profile_key, **kwargs))
 
-    def messageEncryptionStart(self, to_jid, encryption_ns='', replace=False, profile_key="@NONE@", callback=None, errback=None):
+    def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None):
         if callback is None:
             error_handler = None
         else:
@@ -544,7 +567,7 @@
             kwargs['timeout'] = const_TIMEOUT
             kwargs['reply_handler'] = callback
             kwargs['error_handler'] = error_handler
-        return self.db_core_iface.messageEncryptionStart(to_jid, encryption_ns, replace, profile_key, **kwargs)
+        return self.db_core_iface.messageEncryptionStart(to_jid, namespace, replace, profile_key, **kwargs)
 
     def messageEncryptionStop(self, to_jid, profile_key, callback=None, errback=None):
         if callback is None: