Commit graph libervia-backend/sat/plugins
Author SHA1 Message Date
Goffi
cb2144bdf4 core (xmpp), component file sharing, plugin XEP-0363: enabled_features + HTTP Upload:
add a mechanism to explicitely enable some features in components, and use it to enable
HTTP Upload only if it's explicitely enabled.
2023-03-23 15:38:07 +01:00
Goffi
6a5de4440e plugin XEP-0277: handle "related" and "enclosure" links:
those links are used for attachments, "enclosure" for files, "related" when it's other
kind of data, such as an external website (in this case the `external` key is set in the
attchment).
2023-03-23 15:32:10 +01:00
Goffi
f11243bcee plugin XEP-0277: ensure that max-items is set to max when creating a node 2023-03-20 12:01:13 +01:00
Goffi
182fef1134 component AP gateway: add mention to direct messages:
when a direct (not public) message is sent to AP peer, a mention should be present
otherwise the peer won't receive a notification in most AP implementation (notably
Mastodon).
2023-03-20 11:47:13 +01:00
Goffi
7787676e4e component AP gateway (http): fix missing pformat module in verbose mode 2023-03-18 23:11:28 +01:00
Goffi
23514e8b37 component AP gateway (http): add verbose log when signature verification fails on POST request 2023-03-18 20:12:38 +01:00
Goffi
8e09c143e7 component AP gateway (http): handle properly NotFound error:
When an `exceptions.NotFound` is received, log a warning message and return the
appropriate HTTP code instead of raising the default `exceptions.InternalError`.
2023-03-18 16:53:21 +01:00
Goffi
614ccc3a6f component AP gateway: fix bad use of parseAPURL return data:
`parent_item_id` was not retrieved correctly, probably due to a missed update after code
change.
2023-03-18 16:20:30 +01:00
Goffi
f8387a7291 plugin AP gateway: fix exception on HEAD requests 2023-03-18 15:01:55 +01:00
Goffi
b6b2189433 plugin XEP-0277: when publisher is not found, check ancestor in both client and component namespaces 2023-03-16 16:43:47 +01:00
Goffi
3994b8d40a component AP gateway (http/outbox): return data when no RSM is available 2023-03-16 15:56:11 +01:00
Goffi
3f6ef10bac plugin XEP-0465: log a warning and return empty list/dict when forbidden error is received:
this error probably means that the service doesn't support PPS.
2023-03-16 12:33:33 +01:00
Goffi
199f18366c plugin XEP-0384: skip MessageReceived trigger when in a component:
OMEMO is not used in components so far, but the trigger is trying to request OMEMO PEP
nodes, which causes an error with virtual pubsub service of AP component.
2023-03-16 12:31:24 +01:00
Goffi
619fcca7da plugin XEP-0060: fix namespace on node subscriptions request 2023-03-16 12:29:34 +01:00
Goffi
4454753049 component AP gateway: reset stream position after getting payload:
the stream position needs to be reset, as the body may be read again to compute signature
hash.
2023-03-16 12:28:52 +01:00
Goffi
00894ec73f plugin XEP-0384: run profileConnected workflow in background:
XEP-0384 connection workflow can be very long when connecting after a while (due to
OLDMEMO migration notably), which can lead to bad UX.

It is not necessary to `await` it as `encrypt` and `decrypt` already wait for the plugin
to be initialized correctly, so the workflow is now run in background.
2023-03-10 17:22:45 +01:00
Goffi
2f954ccbf7 plugin XEP-0313: don't wait for MAM to be retrieved in connection workflow:
MAM retrieval can be long, and can be done after connection, message just need to be
sorted when being inserted (i.e. frontends must do insort).
To avoid blocking connection for too long and result in bad UX and timeout risk, one2one
MAM message are not retrieved in background.
2023-03-10 17:22:45 +01:00
Goffi
1008801fe7 plugin XEP-0045: dot not wait for MAM retrieval to be completed:
in `_join_MAM`, `room.fully_joined` is called before retrieving the MAM archive, as the
process can be very long, and is not necessary to have the room working (message can be
received after being in the room, and added out of order). This avoid blocking the `join`
workflow for an extended time.

Some renaming and coroutine integrations.
2023-03-10 17:22:41 +01:00
Goffi
6ad9431678 plugin app manager: start doesn't wait anymore for actual app start:
Application may be long to start (e.g. a Docker app may have to download images first,
and even without the downloading, the starting could be long), which may lead to UI
blocking or bridge time out.

To prevent that, `start` is now returning immediately, and 2 new signals are used to
indicate when the application is started, of if something wrong happened.

`start` now returns initial app data, including exposed data without the computed exposed
data. The computed data must be retrieved after the app has been started.
2023-03-04 18:30:47 +01:00
Goffi
187369d1ca component AP gateway (http_server): use log.exception instead of log.error 2023-03-02 12:39:16 +01:00
Goffi
efb13e64b2 component AP gateway: fix missing argument when calling APOutboxPageRequest 2023-02-10 17:37:37 +01:00
Goffi
52f7a2b11f component AP gateway: don't percent-encode @:
Mastodon doesn't like when "@" is percent-encoded (because it doesn't do it, and it checks
that the URL matches the ID without taking care of percent-encoding).
2023-02-10 17:20:02 +01:00
Goffi
895ddd36be plugin XEP-0470: create a default configuration if node config can't be accessed 2022-12-05 11:54:47 +01:00
Goffi
6459ef59bc component AP gateway: fix bad condition 2022-11-25 16:34:09 +01:00
Goffi
9560a23f78 component AP gateway: fix header checking for redirection 2022-11-25 16:14:10 +01:00
Goffi
faf5e43527 component AP gateway: ignore actor delection notifications:
When a `Delete` activity was received and the object was the emitting actor itself, the
signature checking was failing if the actor was unknown (due to the impossibility to
retrieve the actor public key, as it is no more accessible).

To avoid that, those notifications are ignored for now. In the future they should clean
the cache linked to this actor.
2022-11-15 18:15:16 +01:00
Goffi
b30a558f13 component AP gateway: properly close the HTTP connection on checkSignature exception:
if something is going wrong during `checkSignature` (other than signature verification
failing), a `500 Internal Server Error` code is returned, and the connection is properly
closed.
2022-11-15 18:10:33 +01:00
Goffi
4d14a623fc component AP gateway: parse body immediately on POST request:
the body is parsed immediately during a `POST` request: this avoids duplication of code,
and allows to check the body data before continuing (will be used to filter some requests
in a future patch).
2022-11-15 18:07:34 +01:00
Goffi
d6f710bd0b component AP gateway: fix pubsub attachment plugin call following renaming. 2022-11-15 18:03:07 +01:00
Goffi
c8326e24d2 component AP gateway: log at debug level instead of warning when no client is set 2022-11-15 18:02:16 +01:00
Goffi
020da52ddd component AP gateway: HTML redirection:
when a request is done on AP endpoint and `Accept` header is not set to
`application/json`, the request can now be redirected to a configurable URL.
2022-11-11 13:51:20 +01:00
Goffi
1ebe54a024 plugin XEP-0384: log import_error when import is failing 2022-11-10 15:16:43 +01:00
Goffi
e08d8207d6 plugin pte: Pubsub Target Encryption implementation:
This plugin lets encrypt a few items for a specific set of entities.

rel 382
2022-10-31 13:46:51 +01:00
Goffi
5623d2c4ad cli (file/send): add --encrypt argument to request encryption:
rel 378
2022-10-31 04:09:38 +01:00
Goffi
721df3a7ee plugin XEP-0391: implement XEP-0391 (Jingle Encrypted Transports) + XEP-0396 (JET-OMEMO):
rel 378
2022-10-31 04:09:34 +01:00
Syndace
e062c2f0e5 plugin XEP-0384: Implementation of Automatic Trust Management:
- Implementation of Trust Messages (XEP-0434)
- Implementation of Automatic Trust Management (XEP-0450)
- Implementations directly as part of the OMEMO plugin, since omemo:2 is the only protocol supported by ATM at the moment
- Trust system selection updated to allow choice between manual trust with ATM and BTBV
- dev-requirements.txt updated to include additional requirements for the e2e tests

fix 376
2022-10-28 18:50:06 +02:00
Goffi
0988c73644 plugin pubsub signature: fix attachment setting + default signer:
- attachment setting was crashing when `item_elt` was not specified due to argument typo
- if `signer` is set to None in attachment data, client's bare jid will be used to sign
  the item

rel 381
2022-10-30 01:06:58 +02:00
Goffi
d9f5f4c8f8 plugin pubsub signing: fix gpg_provider instanciation:
the instance was set at the class level while it is client dependant, resulting in the
instance being overwritten on each client connexion.

rel 381
2022-10-30 01:06:35 +02:00
Goffi
f74e555c23 plugin XEP-0373: minor renaming + set gpg_provider in client:
- `sat` and `self.__sat` have been renamed to `host` and `self.host` for consistency with
other plugins.

- `gpg_provider` is set in client while profile is connecting, so the instance is easily
  accessible to plugins depending on XEP-0373

rel 381
2022-10-30 01:06:32 +02:00
Goffi
cc8b5aa554 plugin XEP-0277: signed flag can now be used in extra to use sign the blog post:
rel 381
2022-10-28 18:47:17 +02:00
Goffi
4f13a79f87 plugin pubsub signing: pubsub items signature implementation:
- this is based on a protoXEP, not yet an official XEP: https://github.com/xsf/xeps/pull/1228
- XEP-0470: `set` attachment handler can now be async

rel 381
2022-10-28 18:47:17 +02:00
Goffi
966d3cc6f4 plugin XEP-0373: typos 2022-10-28 18:47:17 +02:00
Goffi
14b115358e plugin OXPS: fix triggers return values:
rel 381
2022-10-28 18:47:17 +02:00
Goffi
836a621a0b plugin XEP-0277: add encryption flag to MB data:
MB data are individually flagged with the new `encryption` key if they were e2ee, the key
contain encryption metadata (for now, just the algorithm used).

rel 380
2022-10-15 20:38:33 +02:00
Goffi
7b9e785c13 plugin OXPS, XEP-0060: indicate which items were e2ee:
the new `encryption` key is added to `getItems` metadata if items were e2ee, it contains a
map from item ID to encryption metadata.

rel  380
2022-10-15 20:38:33 +02:00
Goffi
9f047d311c plugin XEP-0470: fix autocreate in create_attachments_node:
Due to config check, `create_attachments_node` was failing when the target node was not
already existing. However, this is the case when an item is published and `autocreate` is
expected, thus the node is now created if not already existing and new `autocreate`
argument is set.
2022-10-15 20:38:33 +02:00
Goffi
a7f94cf875 plugin XEP-0374, XEP-0384: handle cases where "to" is not set in <message> for feedback_jid 2022-10-15 20:38:33 +02:00
Goffi
224cffde8d plugin XEP-0384: continue workflow and log error in case of issue in self.__prepare_for_profile:
an exception while preparing profile should not stop the message to be propagated
2022-10-15 20:38:33 +02:00
Goffi
39576b806f plugin XEP-0373: download public keys if they are not found in local storage:
public keys were only obtained from PEP notifications, however this wasn't working if the
entity was not in our roster.

Now if no public key is retrieved from local storage, the public key node is requested,
and an error is raised if nothing is found. This allows the use of OX with entities which
are not in roster.

rel 380
2022-10-15 20:38:33 +02:00
Goffi
dbbdcd04bb plugin pubsub cache: avoid race condition by retrying node request:
When retrieving items, there may be a race condition if a node is not found in cache, then
created before `setPubsubNode` is called. This patch handle this case by retrying in case
of UNIQUE constraint violation.
2022-10-15 20:38:33 +02:00