diff sat/bridge/bridge_constructor/bridge_template.ini @ 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 5060cbeec01e
line wrap: on
line diff
--- a/sat/bridge/bridge_constructor/bridge_template.ini	Sat Aug 11 18:24:55 2018 +0200
+++ b/sat/bridge/bridge_constructor/bridge_template.ini	Sat Aug 11 18:24:55 2018 +0200
@@ -438,14 +438,48 @@
 [messageEncryptionStart]
 type=method
 category=core
-sig_in=sss
+sig_in=ssbs
 sig_out=
 param_1_default=''
-param_2_default="@NONE@"
+param_2_default=False
+param_3_default="@NONE@"
+doc=Start an encryption session
+doc_param_0=to_jid: JID of the recipient (bare jid if it must be encrypted for all devices)
+doc_param_1=encryption_ns: Namespace of the encryption algorithm to use
+doc_param_2=replace: If True and an encryption session already exists, it will be replaced by this one
+    else a ConflictError will be raised
+doc_param_3=%(doc_profile_key)s
+
+[messageEncryptionStop]
+type=method
+category=core
+sig_in=ss
+sig_out=
 doc=Start an encryption session
-doc_param_0=to_jid: JID of the recipient (bare_jid if it must be encoded for all devices)
-doc_param_1=encryption_ns: Namespace of the encryption algorithm to use
-doc_param_2=%(doc_profile_key)s
+doc_param_0=to_jid: JID of the recipient (full jid if encryption must be stopped for one device only)
+doc_param_1=%(doc_profile_key)s
+
+[messageEncryptionGet]
+type=method
+category=core
+sig_in=ss
+sig_out=s
+doc=Retrieve encryption data for a given entity
+doc_param_0=to_jid: bare JID of the recipient
+doc_param_1=%(doc_profile_key)s
+doc_return=[JSON_OBJ] empty string if session is unencrypted, else a json encoded objects.
+    In case of dict, following keys are always present:
+        - name: human readable name of the encryption algorithm
+        - namespace: namespace of the plugin
+    following key can be present if suitable:
+        - directed_devices: list or resource where session is encrypted
+
+[encryptionPluginsGet]
+type=method
+category=core
+sig_in=
+sig_out=aa{ss}
+doc=Retrieve registered plugins for encryption
 
 [setPresence]
 type=method