Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
2732:e55f871fa9db | 2733:e347e32aa07f |
---|---|
243 if errback is None: | 243 if errback is None: |
244 errback = log.error | 244 errback = log.error |
245 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | 245 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
246 return self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) | 246 return self.db_core_iface.disconnect(profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler) |
247 | 247 |
248 def encryptionNamespaceGet(self, arg_0, callback=None, errback=None): | |
249 if callback is None: | |
250 error_handler = None | |
251 else: | |
252 if errback is None: | |
253 errback = log.error | |
254 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | |
255 kwargs={} | |
256 if callback is not None: | |
257 kwargs['timeout'] = const_TIMEOUT | |
258 kwargs['reply_handler'] = callback | |
259 kwargs['error_handler'] = error_handler | |
260 return unicode(self.db_core_iface.encryptionNamespaceGet(arg_0, **kwargs)) | |
261 | |
248 def encryptionPluginsGet(self, callback=None, errback=None): | 262 def encryptionPluginsGet(self, callback=None, errback=None): |
249 if callback is None: | 263 if callback is None: |
250 error_handler = None | 264 error_handler = None |
251 else: | 265 else: |
252 if errback is None: | 266 if errback is None: |
257 kwargs['timeout'] = const_TIMEOUT | 271 kwargs['timeout'] = const_TIMEOUT |
258 kwargs['reply_handler'] = callback | 272 kwargs['reply_handler'] = callback |
259 kwargs['error_handler'] = error_handler | 273 kwargs['error_handler'] = error_handler |
260 return self.db_core_iface.encryptionPluginsGet(**kwargs) | 274 return self.db_core_iface.encryptionPluginsGet(**kwargs) |
261 | 275 |
276 def encryptionTrustUIGet(self, namespace, arg_1, profile_key, callback=None, errback=None): | |
277 if callback is None: | |
278 error_handler = None | |
279 else: | |
280 if errback is None: | |
281 errback = log.error | |
282 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | |
283 return unicode(self.db_core_iface.encryptionTrustUIGet(namespace, arg_1, profile_key, timeout=const_TIMEOUT, reply_handler=callback, error_handler=error_handler)) | |
284 | |
262 def getConfig(self, section, name, callback=None, errback=None): | 285 def getConfig(self, section, name, callback=None, errback=None): |
263 if callback is None: | 286 if callback is None: |
264 error_handler = None | 287 error_handler = None |
265 else: | 288 else: |
266 if errback is None: | 289 if errback is None: |
530 kwargs['timeout'] = const_TIMEOUT | 553 kwargs['timeout'] = const_TIMEOUT |
531 kwargs['reply_handler'] = callback | 554 kwargs['reply_handler'] = callback |
532 kwargs['error_handler'] = error_handler | 555 kwargs['error_handler'] = error_handler |
533 return unicode(self.db_core_iface.messageEncryptionGet(to_jid, profile_key, **kwargs)) | 556 return unicode(self.db_core_iface.messageEncryptionGet(to_jid, profile_key, **kwargs)) |
534 | 557 |
535 def messageEncryptionStart(self, to_jid, encryption_ns='', replace=False, profile_key="@NONE@", callback=None, errback=None): | 558 def messageEncryptionStart(self, to_jid, namespace='', replace=False, profile_key="@NONE@", callback=None, errback=None): |
536 if callback is None: | 559 if callback is None: |
537 error_handler = None | 560 error_handler = None |
538 else: | 561 else: |
539 if errback is None: | 562 if errback is None: |
540 errback = log.error | 563 errback = log.error |
541 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) | 564 error_handler = lambda err:errback(dbus_to_bridge_exception(err)) |
542 kwargs={} | 565 kwargs={} |
543 if callback is not None: | 566 if callback is not None: |
544 kwargs['timeout'] = const_TIMEOUT | 567 kwargs['timeout'] = const_TIMEOUT |
545 kwargs['reply_handler'] = callback | 568 kwargs['reply_handler'] = callback |
546 kwargs['error_handler'] = error_handler | 569 kwargs['error_handler'] = error_handler |
547 return self.db_core_iface.messageEncryptionStart(to_jid, encryption_ns, replace, profile_key, **kwargs) | 570 return self.db_core_iface.messageEncryptionStart(to_jid, namespace, replace, profile_key, **kwargs) |
548 | 571 |
549 def messageEncryptionStop(self, to_jid, profile_key, callback=None, errback=None): | 572 def messageEncryptionStop(self, to_jid, profile_key, callback=None, errback=None): |
550 if callback is None: | 573 if callback is None: |
551 error_handler = None | 574 error_handler = None |
552 else: | 575 else: |