comparison sat/bridge/dbus_bridge.py @ 2658:4e130cc9bfc0

core (memore/encryption): new methods and checks: Following methods are now available though bridge: - messageEncryptionStop - messageEncryptionGet: retrieve encryption data for a message session - encryptionPluginsGet: retrieve all registered encryption plugin Following methods are available for internal use: - getPlugins: retrieve registerd plugins - getNSFromName: retrieve namespace from plugin name - getBridgeData: serialise session data (to be used with bridge) - markAsEncrypted: mark message data as encrypted (to be set by encryption plugin in MessageReceived trigger) Behaviours improvments: - start and stop send messageEncryptionStarted and messageEncryptionStopped signals, and a message feedback - new "replace" arguments in start allows to replace a plugin if one is already running (instead of raising a ConflictError) - plugins declare themselves as "directed" (i.e. working with only one device at a time) or not. This is checked while dealing with jids, an exception is raised when a full jid is received for a non directed encryption. - use of new data_format (de)serialise
author Goffi <goffi@goffi.org>
date Sat, 11 Aug 2018 18:24:55 +0200
parents b8600f8130ac
children e347e32aa07f
comparison
equal deleted inserted replaced
2657:9190874a8ac5 2658:4e130cc9bfc0
270 async_callbacks=('callback', 'errback')) 270 async_callbacks=('callback', 'errback'))
271 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None): 271 def disconnect(self, profile_key="@DEFAULT@", callback=None, errback=None):
272 return self._callback("disconnect", unicode(profile_key), callback=callback, errback=errback) 272 return self._callback("disconnect", unicode(profile_key), callback=callback, errback=errback)
273 273
274 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 274 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
275 in_signature='', out_signature='aa{ss}',
276 async_callbacks=None)
277 def encryptionPluginsGet(self, ):
278 return self._callback("encryptionPluginsGet", )
279
280 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
275 in_signature='ss', out_signature='s', 281 in_signature='ss', out_signature='s',
276 async_callbacks=None) 282 async_callbacks=None)
277 def getConfig(self, section, name): 283 def getConfig(self, section, name):
278 return self._callback("getConfig", unicode(section), unicode(name)) 284 return self._callback("getConfig", unicode(section), unicode(name))
279 285
396 async_callbacks=None) 402 async_callbacks=None)
397 def menusGet(self, language, security_limit): 403 def menusGet(self, language, security_limit):
398 return self._callback("menusGet", unicode(language), security_limit) 404 return self._callback("menusGet", unicode(language), security_limit)
399 405
400 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 406 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
401 in_signature='sss', out_signature='', 407 in_signature='ss', out_signature='s',
402 async_callbacks=None) 408 async_callbacks=None)
403 def messageEncryptionStart(self, to_jid, encryption_ns='', profile_key="@NONE@"): 409 def messageEncryptionGet(self, to_jid, profile_key):
404 return self._callback("messageEncryptionStart", unicode(to_jid), unicode(encryption_ns), unicode(profile_key)) 410 return self._callback("messageEncryptionGet", unicode(to_jid), unicode(profile_key))
411
412 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
413 in_signature='ssbs', out_signature='',
414 async_callbacks=None)
415 def messageEncryptionStart(self, to_jid, encryption_ns='', replace=False, profile_key="@NONE@"):
416 return self._callback("messageEncryptionStart", unicode(to_jid), unicode(encryption_ns), replace, unicode(profile_key))
417
418 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
419 in_signature='ss', out_signature='',
420 async_callbacks=None)
421 def messageEncryptionStop(self, to_jid, profile_key):
422 return self._callback("messageEncryptionStop", unicode(to_jid), unicode(profile_key))
405 423
406 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, 424 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
407 in_signature='sa{ss}a{ss}sa{ss}s', out_signature='', 425 in_signature='sa{ss}a{ss}sa{ss}s', out_signature='',
408 async_callbacks=('callback', 'errback')) 426 async_callbacks=('callback', 'errback'))
409 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None): 427 def messageSend(self, to_jid, message, subject={}, mess_type="auto", extra={}, profile_key="@NONE@", callback=None, errback=None):