Mercurial > libervia-backend
diff 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 |
line wrap: on
line diff
--- a/sat/plugins/plugin_comp_ap_gateway/constants.py Fri May 13 18:50:33 2022 +0200 +++ b/sat/plugins/plugin_comp_ap_gateway/constants.py Fri May 13 19:12:33 2022 +0200 @@ -24,15 +24,18 @@ TYPE_INBOX = "inbox" TYPE_SHARED_INBOX = "shared_inbox" TYPE_OUTBOX = "outbox" +TYPE_FOLLOWERS = "followers" +TYPE_FOLLOWING = "following" TYPE_ITEM = "item" MEDIA_TYPE_AP = "application/activity+json" +NS_AP_PUBLIC = "https://www.w3.org/ns/activitystreams#Public" # mapping from AP metadata to microblog data AP_MB_MAP = { "content": "content_xhtml", } AP_REQUEST_TYPES = { - "GET": {"actor", "outbox"}, + "GET": {TYPE_ACTOR, TYPE_OUTBOX, TYPE_FOLLOWERS, TYPE_FOLLOWING}, "POST": {"inbox"}, } # headers to check for signature