Commit graph libervia-backend/sat/plugins
Author SHA1 Message Date
Goffi
f4fa679e9c comp file sharing: handle admins in quotas 2022-05-15 14:15:24 +02:00
Goffi
0114769fa4 comp AP gateway: publish, (un)subscribe/(un)follow, public subscription/following/followers:
this patch implements those major features:

- `publish` is implemented on virtual pubsub service, thus XMPP entities can now publish
  to AP using this service
- replies to XMPP items are managed
- `inReplyTo` is filled when converting XMPP items to AP objects
- `follow` and `unfollow` (actually an `undo` activity) are implemented and mapped to
  XMPP's (un)subscribe. On subscription, AP actor's `outbox` collection is converted to
  XMPP and put in cache. Subscriptions are always public.
- `following` and `followers` collections are mapped to XMPP's Public Pubsub Subscription
  (which should be XEP-0465, but the XEP is not yet published at the time of commit), in
  both directions.
- new helper methods to check if an URL is local and to get JID from actor ID

doc will follow to explain behaviour

rel 365
2022-05-13 19:12:33 +02:00
Goffi
436bb119e8 plugin XEP-0277: be sure to have service set in item2mbdata and node when provided
rel 365
2022-05-13 18:50:33 +02:00
Goffi
6a0ca28f45 plugin XEP-0277: bridge method mbIsCommentNode + methods renaming 2022-05-13 18:48:41 +02:00
Goffi
36eb09e53e plugin XEP-0277: fix await trigger incorrectly used on a sync trigger 2022-05-13 18:46:51 +02:00
Goffi
ab2f9661d1 plugin pubsub cache: new resync argument to force resynchronisation in synchronize 2022-05-13 18:44:54 +02:00
Goffi
4e441258b3 plugin pubsub cache: more resilient node caching:
- cache only latest 20 items when disco infos are hidden and thus we can't discover
  feature/RSM implementation
- better handling of args when calling `storage.getItems`

rel 365
2022-05-13 18:43:42 +02:00
Goffi
d20e609a5c plugins XEP-0060, XEP-0376, XEP-0465, CLI: PAM + PSS implementation:
- update psSubscriptionsGet to use serialised return value
- implement XEP-0376 Pubsub Account Management
- implement XEP-0465 Public Pubsub Subscriptions
- CLI `pubsub` commands updated accordingly, and added `--public` flags to `subscribe`,
  `Subscriptions` and `node Subscriptions get`

⚠ `XEP-0465` is speculative, the XEP has been accepted by council but not published yet.
As is should be the next one, and current latest one is `XEP-0464`, `XEP-0465` has been
anticipated.

rel 365
2022-05-13 18:38:05 +02:00
Goffi
feee36791b plugin XEP-0060: use serialised options in psSubscribe + triggers update 2022-05-13 18:29:42 +02:00
Goffi
24a1355686 plugin XEP-0060: better filtering when looking for default pubsub service 2022-05-13 18:22:06 +02:00
Goffi
8a2154ccca comp AP gateway: signature checking, caching and threads management:
- HTTP signature is checked for incoming messages
- AP actor can now be followed using pubsub subscription. When following is accepted, the
  node is cached
- replies to posts are put in cached pubsub comment nodes, with a `comments_max_depth`
  option to limit the number of comment nodes for a root message (documentation will come
  to explain this).

ticket 364
2022-03-22 17:00:42 +01:00
Goffi
5ca925996d comp AP: helper methods to get AP objects:
rel 364
2022-03-22 17:00:42 +01:00
Goffi
16664ab939 comp AP gateway: regular expression to parse Signature header:
rel 364
2022-03-22 17:00:42 +01:00
Goffi
7588951bd9 plugin XEP-0277: methods to check is a node is a comments node and to get its parent
rel 364
2022-03-22 17:00:42 +01:00
Goffi
0112d503ff plugin XEP-0059, cache: allow those plugins to work in component mode
rel 364
2022-03-22 17:00:42 +01:00
Goffi
81513eb7d8 plugin XEP-0060: specify sender using client.jid in subscribe:
this is necessary to do a subscription with a component managing a virtual JID (i.e. not
the JID of the component itself, but the one linked to a account, see
`SatXMPPComponent.getVirtualClient`).

rel 364
2022-03-22 17:00:42 +01:00
Goffi
3801db7835 component AP gateway: split plugin in several files:
constants, HTTP server and Pubsub service have been put in separated files.

rel: 363
2022-01-31 18:35:49 +01:00
Goffi
643d491e80 component AP gateway: JID/node ⟺ AP outbox conversion:
- convert a combination of JID and optional pubsub node to AP actor handle (see
  `getJIDAndNode` for details) and vice versa
- the gateway now provides a Pubsub service
- retrieve pubsub node and convert it to AP collection, AP pagination is converted to RSM
- do the opposite: convert AP collection to pubsub and handle RSM request. Due to
  ActivityStream collection pagination limitations, some RSM request produce inefficient
  requests, but caching should be used most of the time in the future and avoid the
  problem.
- set specific name to HTTP Server
- new `local_only` setting (`True` by default) to indicate if the gateway can request or
  not XMPP Pubsub nodes from other servers
- disco info now specifies important features such as Pubsub RSM, and nodes metadata

ticket 363
2022-01-25 17:54:06 +01:00
Goffi
01a1bf8691 plugin XEP-0060, XEP-0163, XEP-0277, text syntaxes: make those plugins usable with components 2022-01-25 17:26:05 +01:00
Goffi
ab4468a50a plugin XEP-0277: various fixes + async:
- `NS_ATOM` is now set at class level, so it can be accessed by other plugins
- set `author` to `None` when no `name` element is found
- make `data2entry` a corountine
- fix incorrect use of yield in `trigger.point`
2022-01-25 17:22:15 +01:00
Goffi
738ef6ccf4 plugin XEP-0060: None must not be used for getItems's node 2022-01-25 17:16:37 +01:00
Goffi
e94df887d4 component file sharing: set server name at render time 2022-01-25 17:15:00 +01:00
Goffi
0d214783a3 component file sharing: fix incorrect use of returnValue in items async method 2022-01-25 17:13:32 +01:00
Goffi
7216345e31 plugin XEP-0384: fix typo in attribute 2022-01-25 17:06:28 +01:00
Goffi
14d00a9dda merge bookmark @ 2021-11-12 17:21:24 +01:00
Goffi
0008d3478e plugin events: store interest_id in data:
ID of the item in list of interest is needed to correctly modify (and notably retract) an
event.
2021-11-12 17:18:23 +01:00
Goffi
38ec47a4da plugin comp file sharing: don't use Deferred in return value 2021-11-05 18:11:24 +01:00
Goffi
ecc6f96990 plugin email invitations: re-use existing invitation for a given email:
if an invitation is done on an email which has already received an invitation, it is
re-used and no new XMPP account or Libervia profile is created (the name is modified
though).

This is currently done in an inefficient way due to `LazyPersistentBinaryDict` limitations
(all invitations are loaded and checked to find the email). A more efficient check should
be easier to implement with storage changes in 0.9 .
2021-11-05 18:11:18 +01:00
Goffi
d39a80ee5f plugin XEP-0264: replace SIZE_FULL_SCREEN by SIZE_BIG:
`SIZE_FULL_SCREEN` may result in large files, and BoB is currently used to transfer them,
resulting in potentially large stanza. As a result, Libervia profile can be disconnected
from server if stanza max size is reached.

As a temporary workaround, `SIZE_BIG` is now the maximum size used. This should be fixed
in 0.9 with a proper way to transfer large thumbnails (i.e. not BoB).
2021-11-05 18:08:39 +01:00
Goffi
bdbf4596da plugin XEP-0384: fix encryption for user own devices:
our own jid is added automatically by OMEMO library, but during the generation of the
stanza, our list of jids was used to get the keys (and thus our own jid and devices keys
was missing).

fix 402
2021-10-22 18:46:51 +02:00
Goffi
28b0a91fc7 plugin text syntaxes: remove id attributes and whitelist allowed classes:
for now, the only allowed classes are the one used for code highlighting.

fix 389
2021-10-21 11:55:39 +02:00
Goffi
f52cc88ae2 plugin XEP-0054: fix wrongly used await:
`_checkAvatarHash` was incorrectly awaited. This method is only called once, the code has
been moved directly to `update`.
2021-09-30 10:30:43 +02:00
Goffi
bd47586527 component AP gateway: fix wrong operator when testing HTTP code 2021-09-27 08:29:09 +02:00
Goffi
76c98da073 comp AP Gateway: ActivityPub Component first draft:
this implement the base component, it is for the moment usable only through a developer
API.

rel: 362
2021-09-26 16:41:55 +02:00
Goffi
d7d40a6d50 merge bookmark @ 2021-09-26 16:41:49 +02:00
Goffi
3dd4a1e04f plugin XEP-0277: import SatXMPPEntity from core_types 2021-09-26 16:38:40 +02:00
Goffi
31985ed0fc component (file-sharing): use file-sharing instead of file_sharing:
a dash is used instead of underscore for entry-point and config section., as it is best
practice to use dash on command-line.
2021-09-26 16:35:56 +02:00
Goffi
f40dbe8604 plugin XEP-0384: fix calls outside of main thread:
`callFromThread` is used instead of `callLater` with a 0 delay, as the later is not made
to be called outside of main thread (which was resulting in huge and random delays during
calls).

fix `OmemoStorage._callMainThread` which was returning wrong Deferred due a late lambda
evaluation.
2021-09-08 17:58:48 +02:00
Goffi
d2ae4a124a plugin pubsub cache: implement psCacheSearch
rel 361
2021-09-08 17:58:48 +02:00
Goffi
50d7cb2a51 merge bookmark @ 2021-09-08 11:20:37 +02:00
Goffi
fb310c104c plugin misc file: fix getDestDir returning a Deferred in a coroutine 2021-09-08 11:17:19 +02:00
Goffi
47d258e841 plugin android: use callFromThread instead of callLater:
`callLater` is not made to be called outside of main thread, `callFromThread` is the
method to call in this case.
2021-09-08 11:17:13 +02:00
Goffi
0c3910bafd plugin XEP-0353: fix jingle initiation on disco "Service Unavailable" error:
When requesting disco info on a bare jid which is not in our roster, server may return
"Service Unavailable" (to avoid leaking valid JIDs). In this case, the initiation was
failing, this is now fixed by using empty categories in this case.
2021-09-08 11:16:52 +02:00
Goffi
6bf40afe6a plugin XEP-0353: fix plugin modes 2021-09-08 11:16:48 +02:00
Goffi
dae3308751 plugin XEP-0277: use common.uri to parse comment URIs 2021-09-08 11:14:53 +02:00
Goffi
972e96bf04 plugin text syntaxes: remove side effect on init:
When text syntaxes was initialised, `syntaxes` dict was filled, but it was a class
attribute. As a result, re-initialising it (which may happen for tests, and maybe in the
future dynamically), was not starting with an empty dict, but with an already-filled one,
resulting in conflicts.

This patch fixes it by moving `syntaxes` to an instance attribute.
2021-08-02 21:52:17 +02:00
Goffi
6fa6f7a1f8 plugin pubsub cache: use asDeferred with match_cb 2021-08-02 21:52:17 +02:00
Goffi
e6e77c7770 plugin XEP-0059: don't show warning message when <last> is missing if there is not message 2021-08-02 21:52:17 +02:00
Goffi
52f3532917 merge branch "@" 2021-08-02 21:49:51 +02:00
Goffi
cf5213d4fe plugin XEP-0346: fix deprecated import 2021-08-02 21:47:22 +02:00