Commit graph

3,817 commits

Author SHA1 Message Date
Goffi
fe11bc9a2b plugin identity: make the plugin compatible with component + description:
the plugin can now be used with components.

the new `description` field is now available.

rel 368
2022-06-29 11:49:03 +02:00
Goffi
35be6b741f plugin identity, XEP-0054: move avatar resizing and caching method to identity plugin:
resizing and caching is now done in identity plugin, to prepare for the implementation of
other XEP to handle avatars.

rel 368
2022-06-29 11:47:48 +02:00
Goffi
11d003b8c1 plugin XEP-0060: type hints 2022-06-29 11:36:31 +02:00
Goffi
ead62068ce core (memory/sqla_config): set a timeout for SQLite:
with default timeout, we may have database lock errors from time to time. To avoid this, a
timeout of 30s is now set.
2022-06-29 10:17:33 +02:00
Goffi
a2c409a4a2 core (memory/sqla): session_add must have a default value in delete 2022-06-29 10:16:03 +02:00
Goffi
07109f0354 core (types): add is_component to SatXMPPEntity 2022-06-29 10:14:14 +02:00
Goffi
66dc184866 plugin XEP-0191: fix wrong name and description 2022-06-17 18:25:55 +02:00
Goffi
f9eb48d72d doc (components): AP item retraction + blocking:
fix 367
2022-06-17 15:50:34 +02:00
Goffi
57c945dc9f tests (unit/ap gateway): message/item retractation tests:
this patch adds 4 tests to check pubsub <=> AP item retractation and message <=> AP item
retractation.

rel 367
2022-06-17 15:50:34 +02:00
Goffi
847780b473 tests (unit/ap gateway): fix onMessage call following change in the component:
the component now uses the normal message workflow, thus the tests had to be updated

rel 367
2022-06-17 15:50:34 +02:00
Goffi
c02dcf3d94 component AP gateway typing + remove unused activity arg from newAPDeleteItem
rel 367
2022-06-17 15:50:34 +02:00
Goffi
daccd1de5d doc (cli/message): retract command 2022-06-17 15:50:15 +02:00
Goffi
a44acbc1bb cli (message/retract): message retractation command:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
bfd9168449 component AP gateway: AP delete activity => message retract:
handle retractation of messages. As it is not possible to know from the AP item alone if
we need to to a message retractation (XEP-0424) or a pubsub retractation (XEP-0060), we
now cache sent message, and decide which method to use according to how the item is cached
(i.e. in message history or in pubsub cache).

rel 367
2022-06-17 14:15:23 +02:00
Goffi
8869b1b05d component AP gateway: message retractation => AP deletion
Convert XEP-0424 message retractation request to suitable AP delete activity.

The message workflow and its triggers are now used instead of a direct observer, as it is
now possible to do so with component, and this let other plugin to parse and eventually
update metadata.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
7d3e66dc28 component AP gateway: set POST default response code to 202 (accepted) 2022-06-17 14:15:23 +02:00
Goffi
bcdd1356bb plugin XEP-424: Message Retractation implementation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
46132a523e plugin XEP-0428: Fallback Indication implementation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
f21f5255b0 plugin XEP-0422: Message Fastening implementation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
0bd68d0e62 core (memory/sqla): generic get + session_add in delete:
new generic `get` allow to retrieve an ORM object with given column and value, and
optionally join load attributes.

In `delete`, it is now possible to specify instances to add to session, this allow, to
update them in the same transaction. It is also now possible to specify a list of object
to delete them all in the same transaction.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
bb3e7ffa9b core (memory/sqla), plugin XEP-0359: always add origin-id, and store:
`origin-id` is now always added to messages, and it is stored to database in the new
column instead of `extra` when present.
2022-06-17 14:15:23 +02:00
Goffi
53ca566a9d core (memory/mapping): add origin_id column to History + constraints update:
- `origin_id` is added as a column instead of being just in extra, as it an important data
to filter on.
- Add some constraints.
- Add `serialise` method to Message and Subject.
2022-06-17 14:15:23 +02:00
Goffi
3ccd4280ac core (xmpp): adapt message workflow to components:
message workflow were not used for components so far. This patch activate it, normalise
namespace to the client one to simplify parsing, and use SatXMPPComponent.sendHistory and
SatXMPPComponent.receiveHistory to indicate if a component should store sent and received
message in database (they both default to False).

OTR plugin is deactivated for components.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
441ae82fcb core (constants): type hints 2022-06-17 14:15:23 +02:00
Goffi
408dc04ee6 component AP gateway: convert Delete AP activities to corresponding Pubsub retract:
when a `Delete` actity is received, the item is removed from cache, and the corresponding
item `retract` is sent to local XMPP subscribers.

rel 367
2022-06-17 14:15:23 +02:00
Goffi
4e0c1fe7bf comp AP gateway: convert pubsub item retractation to AP Delete activity:
when an item `retract` is received from a node from which an AP actor is subscribed, a
corresponding `Delete` activity is created and sent to AP followers.

Trying to retract an item from a virtual node of the gateway pubsub service now return a
`forbidden` stanza error (those nodes are handled on AP side and thus are not owned by
XMPP entities).

rel 367
2022-06-17 14:15:23 +02:00
Goffi
83a6d475a9 plugin XEP-0060: do not raise an error when not subscribed on unsubscribe:
when an error is received on unsubscribe because user was not subscribed, a warning is
logged, but no exception is raised anymore, as the expected result is reached.
2022-06-17 14:15:23 +02:00
Goffi
5ecca19b71 doc (components): typo/spelling 2022-06-17 14:15:23 +02:00
Goffi
60dcb5d396 doc (cli/blocking): blocking command documentation:
rel 367
2022-06-17 14:15:23 +02:00
Goffi
ab0739c35f cli: new blocking commands:
commands to list blocked entities, block or unblock one or more entities

rel 367
2022-05-27 12:15:04 +02:00
Goffi
5f64ea2bf3 plugin XEP-0191: Blocking Command implementation:
rel 367
2022-05-27 12:12:16 +02:00
Goffi
5191343a40 doc (components): message delivery documentation:
fix 366
2022-05-24 17:57:41 +02:00
Goffi
4c28917466 test (unit/AP gateway): AP direct message ↔ XMPP <message> conversion:
test that AP direct messages are converted to XMPP `<message>` stanzas instead of pubsub
items.
test that XMPP `<message>` stanzas are converted to AP direct messages (i.e. items
addressed solely to the recipient, without *followers* or *public* collections).

rel 366
2022-05-24 17:57:39 +02:00
Goffi
fa81d96d79 comp AP gateway: message conversion:
Convert direct AP items to XMPP `<message>` stanzas, and vice versa.
Documentation will follow soon to explain the behaviour.

rel 366
2022-05-24 17:57:36 +02:00
Goffi
72ec311ef1 tests (unit/ap_gateway): fix tests 2022-05-24 17:49:14 +02:00
Goffi
c8df7104eb core (memory): fileDelete is now async, fix coroutine issue 2022-05-16 14:37:58 +02:00
Goffi
85911b33d4 plugin invitation: use store hint to be sure that the invitation is archived 2022-05-16 14:20:01 +02:00
Goffi
8946b6fb4e tools (common/email): use from_email is specified, always set email_sender_domain 2022-05-16 13:03:53 +02:00
Goffi
d0973d121d core: remove useless method (it's available directly in client) 2022-05-16 13:02:59 +02:00
Goffi
f4fa679e9c comp file sharing: handle admins in quotas 2022-05-15 14:15:24 +02:00
Goffi
c8025a52eb core: method to know if a profile/entity is an admin:
the new `is_admin` SatXMPPEntity property tell if it's an administrator.

Admin JIDs are retrieve on init, so they can be looked after when profle is not available
(notably when a component handle a request and has only a JID available). The new
`memory.isAdminJID` method is then used.
2022-05-15 14:14:52 +02:00
Goffi
9564647b21 doc (installation): sat_media is now libervia-media 2022-05-14 23:00:35 +02:00
Goffi
975cfdcf76 install (setup): fix urwid-satext version 2022-05-14 22:48:35 +02:00
Goffi
f96d703098 doc (installation): fix missing hg clone instructions 2022-05-14 22:35:39 +02:00
Goffi
92cc11b137 install: requirements.txt update 2022-05-14 22:34:13 +02:00
Goffi
a59ddef97c doc (components): update AP gateway documentation:
add documentation for:
    - Publishing an Item
    - Following, Subscribing and Cache
    - Following/Followers Collections and Public Pubsub Subscription

fix 365
2022-05-13 19:34:12 +02:00
Goffi
f66f602df2 doc (cli/pubsub): document new --public flags:
`--public` option is documented for `subscribe`, `subscriptions` and `node subscriptions
get`, with examples. A warning has been added to show explicitely the privacy implication
of using `--public` with `subscribe`.

rel 365
2022-05-13 19:32:06 +02:00
Goffi
4d3f5f1afa tests (unit/ap-gateway): tests for following/followers <=> PPS:
AP following/followers collections to XMPP Public Pubsub Subscriptions conversion is
checked in both directions.

rel 365
2022-05-13 19:29:17 +02:00
Goffi
fca541a2f1 tests (e2e/cli/cache_search): make the test more resilient:
the caching is triggered by `li.blog.get`, but it is done in parallel without blocking the
command, thus there is a possibility that the data is not yet in cache when the following
test is done.

A loop with delay is done, to be sure that cache is filled before doing the assertion.
2022-05-13 19:27:21 +02:00
Goffi
5b85ebfcb7 docker (prosody-e2e): update Prosody's conf:
Due to mod_privilege and PAM implementation in Libervia Pubsub, permissions have been
udpated in `prosody.cfg.lua`, with the new `iq` permission and namespace delegation needed
for PAM.

`"urn:xmpp:delegation:2:bare:disco#info:*"` namespace delegation was also missing.

rel 365
2022-05-13 19:24:38 +02:00