From f74a6d33fa8107927a7740367497c7ae254e4cb5 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Wed, 10 Mar 2021 20:37:28 -0800 Subject: [PATCH] add synthetic id to outgoing AS2 activities for #12 --- common.py | 1 + tests/test_webmention.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/common.py b/common.py index 7d60dd8..dad7437 100644 --- a/common.py +++ b/common.py @@ -327,6 +327,7 @@ class Handler(handlers.ModernHandler): activity = { '@context': as2.CONTEXT, 'type': 'Create', + 'id': f'{activity["id"]}#bridgy-fed-create', 'object': activity, } diff --git a/tests/test_webmention.py b/tests/test_webmention.py index 411937a..b988a09 100644 --- a/tests/test_webmention.py +++ b/tests/test_webmention.py @@ -158,6 +158,7 @@ class WebmentionTest(testutil.TestCase): self.as2_create = { '@context': 'https://www.w3.org/ns/activitystreams', 'type': 'Create', + 'id': 'http://localhost/r/http://a/reply#bridgy-fed-create', 'object': { '@context': 'https://www.w3.org/ns/activitystreams', 'type': 'Note', @@ -236,6 +237,7 @@ class WebmentionTest(testutil.TestCase): self.create_as2 = { '@context': 'https://www.w3.org/ns/activitystreams', 'type': 'Create', + 'id': 'http://localhost/r/http://orig/post#bridgy-fed-create', 'object': { '@context': 'https://www.w3.org/ns/activitystreams', 'type': 'Note', @@ -259,7 +261,8 @@ class WebmentionTest(testutil.TestCase): foo """, url='http://not/fediverse', content_type=CONTENT_TYPE_HTML) - self.activitypub_gets = [self.reply, self.not_fediverse, self.orig_as2, self.actor] + self.activitypub_gets = [self.reply, self.not_fediverse, self.orig_as2, + self.actor] def verify_salmon(self, mock_post): args, kwargs = mock_post.call_args