comparison doc/components.rst @ 3810:29380ef68dbe

doc (components): AP item retraction + blocking: fix 367
author Goffi <goffi@goffi.org>
date Fri, 17 Jun 2022 15:50:34 +0200
parents 24f70a29e382
children 23b53ac87e0f
comparison
equal deleted inserted replaced
3809:04b57c0b2278 3810:29380ef68dbe
255 **example** 255 **example**
256 256
257 If Louise wants to talk to Pierre which is on the ``example.net`` AP server, she can use 257 If Louise wants to talk to Pierre which is on the ``example.net`` AP server, she can use
258 her XMPP AP gateway which is at ``ap.example.org``. Pierre AP's actor identifier is 258 her XMPP AP gateway which is at ``ap.example.org``. Pierre AP's actor identifier is
259 ``pierre@example.net``, Louise can access it via the JID 259 ``pierre@example.net``, Louise can access it via the JID
260 ``pierre\40example.net@ap.example.org``. 260 ``pierre\40example.net@ap.example.org`` (we call it *virtual JID* of the AP actor).
261 261
262 Of course, this is a bit cumbersome to do by hand, it is expected that XMPP clients will 262 Of course, this is a bit cumbersome to do by hand, it is expected that XMPP clients will
263 do the (un)escaping automatically for end-user, in a way that Louise could enter 263 do the (un)escaping automatically for end-user, in a way that Louise could enter
264 ``pierre@example.net`` directly, with an indicator to show that this is an ActivityPub 264 ``pierre@example.net`` directly, with an indicator to show that this is an ActivityPub
265 actor identifier rather than an XMPP JID. 265 actor identifier rather than an XMPP JID.
468 468
469 Because AP doesn't send any event when *following* or *followers* collections are 469 Because AP doesn't send any event when *following* or *followers* collections are
470 modified, those collections can't be cached, and thus the translation to public pubsub 470 modified, those collections can't be cached, and thus the translation to public pubsub
471 subscriptions is done as best as possible given the constraints. 471 subscriptions is done as best as possible given the constraints.
472 472
473 .. _ap-message_delivery:
474
473 Messages Delivery 475 Messages Delivery
474 ~~~~~~~~~~~~~~~~~ 476 ~~~~~~~~~~~~~~~~~
475 477
476 The gateway can convert AP publications to either XMPP pubsub items (using `XEP-0277 478 The gateway can convert AP publications to either XMPP pubsub items (using `XEP-0277
477 (Microblogging over XMPP)`_ when suitable) or to XMPP messages (`<message>` stanzas, i.e. 479 (Microblogging over XMPP)`_ when suitable) or to XMPP messages (`<message>` stanzas, i.e.
519 521
520 .. _XEP-0277 (Microblogging over XMPP): https://xmpp.org/extensions/xep-0277.html 522 .. _XEP-0277 (Microblogging over XMPP): https://xmpp.org/extensions/xep-0277.html
521 .. _*public* collection: https://www.w3.org/TR/activitypub/#public-addressing 523 .. _*public* collection: https://www.w3.org/TR/activitypub/#public-addressing
522 .. _end-to-end encryption: https://en.wikipedia.org/wiki/End-to-end_encryption 524 .. _end-to-end encryption: https://en.wikipedia.org/wiki/End-to-end_encryption
523 525
526 Message/Item Retraction
527 ~~~~~~~~~~~~~~~~~~~~~~~
528
529 If you retract a pubsub item (e.g. a blog post), that is followed by ActivityPub actors,
530 a suitable `Delete` activity will be emitted. In other words, the ActivityPub servers will
531 be notified of the retraction.
532
533 Similarly if an AP actor is deleting an item, a suitable `XEP-0060 retraction event`_ will
534 be sent to subscribers.
535
536 In the case of direct messages (see :ref:`ap-message_delivery`), `XEP-0424 (Message
537 Retraction)`_ is used in both reception (AP ``Delete`` activity is converted to XEP-0424
538 and vice versa).
539
540 All of this should be transparent to users as long as their clients support the mentioned
541 XEPs.
542
543 .. note::
544
545 When retracting a message/item, a retraction request (or equivalent AP "Delete"
546 activity) is sent, so the other end clients **may** delete the item.
547
548 However, there is no way to be sure that the item will be actually deleted: once
549 something is sent on the network, any recipient can see it, copy it, share it, etc.
550 There is no way to forbid that, and this is true for software, decentralized or not
551 (and not only ActivityPub or XMPP).
552
553 Be sure to understand that before sending anything sensitive.
554
555 .. note::
556
557 When deleting an item on ActivityPub, the item is often replaced by a "tombstone", and
558 it's not possible to send a new item with the same ID. Some software (it's at least the
559 case with Mastodon), will silently reject the item, and thus people won't see it.
560
561 This is a different behaviour from XMPP where you can publish a pubsub item, retract
562 it, and publish a new item with the same ID.
563
564 Thus if you retract an item, be sure to publish any new one with new and unique ID,
565 otherwise the item may not appear to ActivityPub users (and as the item may be rejected
566 silently, you may not be notified).
567
568 However this should not be a problem in the vast majority of cases, as most XMPP client
569 implementing pubsub or pubsub service will generate automatically unique IDs for new
570 items.
571
572 .. _XEP-0060 retraction event: https://xmpp.org/extensions/xep-0060.html#publisher-delete
573 .. _XEP-0424 (Message Retraction): https://xmpp.org/extensions/xep-0424.html
574
575 Blocking an User
576 ~~~~~~~~~~~~~~~~
577
578 You can block AP actors using :ref:`its virtual JID <ap-actor-from-xmpp>` in the same way
579 as for any XMPP entity, by using `XEP-0191 (Blocking Command)`_.
580
581 This is done at the XMPP server level and your server must support it. From client side,
582 many clients support it, and you can use Libervia CLI to do it from command-line (see
583 :ref:`libervia-cli_blocking`).
584
585 .. _XEP-0191 (Blocking Command): https://xmpp.org/extensions/xep-0191.html
586
524 Using the Component (for developers) 587 Using the Component (for developers)
525 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 588 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
526 589
527 Publication of AP items can be tested using the following method (with can be accessed 590 Publication of AP items can be tested using the following method (with can be accessed
528 through the ``APSend`` bridge method, client is then replaced by the ``profile`` name, as 591 through the ``APSend`` bridge method, client is then replaced by the ``profile`` name, as