comparison sat/plugins/plugin_comp_ap_gateway/constants.py @ 3764:125c7043b277

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
author Goffi <goffi@goffi.org>
date Fri, 13 May 2022 19:12:33 +0200
parents a8c7e5cef0cb
children efc34a89e70b
comparison
equal deleted inserted replaced
3763:b2ade5ecdbab 3764:125c7043b277
22 CONTENT_TYPE_AP = "application/activity+json; charset=utf-8" 22 CONTENT_TYPE_AP = "application/activity+json; charset=utf-8"
23 TYPE_ACTOR = "actor" 23 TYPE_ACTOR = "actor"
24 TYPE_INBOX = "inbox" 24 TYPE_INBOX = "inbox"
25 TYPE_SHARED_INBOX = "shared_inbox" 25 TYPE_SHARED_INBOX = "shared_inbox"
26 TYPE_OUTBOX = "outbox" 26 TYPE_OUTBOX = "outbox"
27 TYPE_FOLLOWERS = "followers"
28 TYPE_FOLLOWING = "following"
27 TYPE_ITEM = "item" 29 TYPE_ITEM = "item"
28 MEDIA_TYPE_AP = "application/activity+json" 30 MEDIA_TYPE_AP = "application/activity+json"
31 NS_AP_PUBLIC = "https://www.w3.org/ns/activitystreams#Public"
29 # mapping from AP metadata to microblog data 32 # mapping from AP metadata to microblog data
30 AP_MB_MAP = { 33 AP_MB_MAP = {
31 "content": "content_xhtml", 34 "content": "content_xhtml",
32 35
33 } 36 }
34 AP_REQUEST_TYPES = { 37 AP_REQUEST_TYPES = {
35 "GET": {"actor", "outbox"}, 38 "GET": {TYPE_ACTOR, TYPE_OUTBOX, TYPE_FOLLOWERS, TYPE_FOLLOWING},
36 "POST": {"inbox"}, 39 "POST": {"inbox"},
37 } 40 }
38 # headers to check for signature 41 # headers to check for signature
39 SIGN_HEADERS = { 42 SIGN_HEADERS = {
40 # headers needed for all HTTP methods 43 # headers needed for all HTTP methods