e2ee-api: Some more changes to the documentation

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
Maxime “pep” Buquet 2019-07-02 00:07:34 +02:00
parent a8bf37eb61
commit 8211f3d6f1
Signed by: pep
GPG key ID: DEDA74AEECA9D0F2
2 changed files with 7 additions and 10 deletions

View file

@ -8,11 +8,8 @@ E2EEPlugin
.. autoclass:: E2EEPlugin .. autoclass:: E2EEPlugin
:members: :members: decrypt, encrypt, encryption_name, encryption_short_name, eme_ns, replace_body_with_eme, stanza_encryption, tag_whitelist
Builds on top of :py:class:`~BasePlugin` and requires the developer to
implement two methods, `decrypt` and `encrypt`, as well as the
`encryption_name` and `eme_ns` attribute.
Please refer to :py:class:`~BasePlugin` for more information on how to Please refer to :py:class:`~BasePlugin` for more information on how to
write plugins. write plugins.

View file

@ -56,10 +56,10 @@ class E2EEPlugin(BasePlugin):
""" """
#: Specifies that the encryption mechanism does more than encrypting #: Specifies that the encryption mechanism does more than encrypting
#: <body/>. #: `<body/>`.
stanza_encryption = False stanza_encryption = False
#: Whitelist applied to messages when `stanza_encryption` is False. #: Whitelist applied to messages when `stanza_encryption` is `False`.
tag_whitelist = list(map(lambda x: '{%s}%s' % (x[0], x[1]), [ tag_whitelist = list(map(lambda x: '{%s}%s' % (x[0], x[1]), [
(JCLIENT_NS, 'body'), (JCLIENT_NS, 'body'),
(EME_NS, EME_TAG), (EME_NS, EME_TAG),
@ -71,9 +71,9 @@ class E2EEPlugin(BasePlugin):
])) ]))
#: Replaces body with `eme <https://xmpp.org/extensions/xep-0380.html>`_ #: Replaces body with `eme <https://xmpp.org/extensions/xep-0380.html>`_
#: if set. Should be suitable for most plugins except those using <body/> #: if set. Should be suitable for most plugins except those using
#: directly as their encryption container, like OTR, or the example base64 #: `<body/>` directly as their encryption container, like OTR, or the
#: plugin in poezio. #: example base64 plugin in poezio.
replace_body_with_eme = True replace_body_with_eme = True
#: Encryption name, used in command descriptions, and logs. At least one #: Encryption name, used in command descriptions, and logs. At least one
@ -85,7 +85,7 @@ class E2EEPlugin(BasePlugin):
#: `encryption_short_name` must be set. #: `encryption_short_name` must be set.
encryption_short_name = None # type: Optional[str] encryption_short_name = None # type: Optional[str]
#: Required. #: Required. <https://xmpp.org/extensions/xep-0380.html>_.
eme_ns = None # type: Optional[str] eme_ns = None # type: Optional[str]
# Static map, to be able to limit to one encryption mechanism per tab at a # Static map, to be able to limit to one encryption mechanism per tab at a