From 7d84323df4bcd822aac4e97ca16d4a13ad5b23e7 Mon Sep 17 00:00:00 2001 From: Diogo Peralta Cordeiro Date: Sun, 13 Mar 2022 15:53:21 +0000 Subject: [PATCH] [PLUGIN][ActivityPub][Tests] Add some fixtures for GNU social's --- .../gnusocial/activities/create_note.jsonld | 52 ++++++++++++++++++ .../gnusocial/activities/create_page.jsonld | 55 +++++++++++++++++++ .../gnusocial/activities/create_reply.jsonld | 53 ++++++++++++++++++ .../tests/fixtures/gnusocial/context.jsonld | 19 +++++++ .../fixtures/gnusocial/objects/group.jsonld | 42 ++++++++++++++ .../fixtures/gnusocial/objects/note.jsonld | 40 ++++++++++++++ .../fixtures/gnusocial/objects/page.jsonld | 42 ++++++++++++++ .../fixtures/gnusocial/objects/person.jsonld | 42 ++++++++++++++ .../fixtures/gnusocial/objects/reply.jsonld | 41 ++++++++++++++ 9 files changed, 386 insertions(+) create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_note.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_page.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_reply.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/context.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/objects/group.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/objects/note.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/objects/page.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/objects/person.jsonld create mode 100755 plugins/ActivityPub/tests/fixtures/gnusocial/objects/reply.jsonld diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_note.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_note.jsonld new file mode 100755 index 0000000000..3fabae15d9 --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_note.jsonld @@ -0,0 +1,52 @@ +{ + "type": "Create", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/activity/1337", + "published": "2022-03-01T20:58:48+00:00", + "actor": "https://testv3.gnusocial.rocks/actor/42", + "object": { + "type": "Note", + "id": "https://testv3.gnusocial.rocks/object/note/1337", + "published": "2022-03-10T23:07:50+00:00", + "attributedTo": "https://testv3.gnusocial.rocks/actor/42", + "content": "

hello, world.

", + "mediaType": "text/html", + "source": { + "content": "hello, world.", + "mediaType": "text/plain" + }, + "attachment": [], + "tag": [], + "inConversation": "https://testv3.gnusocial.rocks/conversation/1337", + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers" + ] + }, + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers" + ] +} \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_page.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_page.jsonld new file mode 100755 index 0000000000..d3b5a1a455 --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_page.jsonld @@ -0,0 +1,55 @@ +{ + "type": "Create", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/activity/1338", + "published": "2022-03-01T18:19:51+00:00", + "actor": "https://testv3.gnusocial.rocks/actor/42", + "object": { + "type": "Page", + "id": "https://testv3.gnusocial.rocks/object/note/1338", + "published": "2022-03-01T22:44:29+00:00", + "attributedTo": "https://testv3.gnusocial.rocks/actor/42", + "name": "hello, world.", + "content": "

This is an interesting page.

", + "mediaType": "text/html", + "source": { + "content": "This is an interesting page.", + "mediaType": "text/plain" + }, + "attachment": [], + "tag": [], + "inConversation": "https://testv3.gnusocial.rocks/conversation/1338", + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers", + "https://testv3.gnusocial.rocks/actor/21" + ] + }, + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers", + "https://testv3.gnusocial.rocks/actor/21" + ] +} diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_reply.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_reply.jsonld new file mode 100755 index 0000000000..0b4797c8da --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/activities/create_reply.jsonld @@ -0,0 +1,53 @@ +{ + "type": "Create", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/activity/1339", + "published": "2022-03-01T20:58:48+00:00", + "actor": "https://testv3.gnusocial.rocks/actor/42", + "object": { + "type": "Note", + "id": "https://testv3.gnusocial.rocks/object/note/1339", + "published": "2022-03-01T21:00:16+00:00", + "attributedTo": "https://testv3.gnusocial.rocks/actor/42", + "content": "

yay ^^

", + "mediaType": "text/html", + "source": { + "content": "yay ^^", + "mediaType": "text/plain" + }, + "attachment": [], + "tag": [], + "inReplyTo": "https://testv3.gnusocial.rocks/object/note/1338", + "inConversation": "https://testv3.gnusocial.rocks/conversation/1338", + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers" + ] + }, + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers" + ] +} \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/context.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/context.jsonld new file mode 100755 index 0000000000..c7bd291ce6 --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/context.jsonld @@ -0,0 +1,19 @@ +[ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } +] \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/objects/group.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/group.jsonld new file mode 100755 index 0000000000..b63ab36cb7 --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/group.jsonld @@ -0,0 +1,42 @@ +{ + "type": "Group", + "streams": [], + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/actor/21", + "inbox": "https://testv3.gnusocial.rocks/actor/21/inbox.json", + "outbox": "https://testv3.gnusocial.rocks/actor/21/outbox.json", + "following": "https://testv3.gnusocial.rocks/actor/21/subscriptions", + "followers": "https://testv3.gnusocial.rocks/actor/21/subscribers", + "liked": "https://testv3.gnusocial.rocks/actor/21/favourites", + "preferredUsername": "hackers", + "publicKey": { + "id": "https://testv3.gnusocial.rocks/actor/2#public-key", + "owner": "https://testv3.gnusocial.rocks/actor/2", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoZyKL+GyJbTV/ilVBlzz\n8OL/UwNi3KpfV5kQwXU0pPcBbw6y2JOfWnKUT1CfiHG3ntiOFnc+wQfHZk4hRSE8\n9Xe/G5Y215xW+gqx/kjt2GOENqzSzYXdEZ5Qsx6yumZD/yb6VZK9Og0HjX2mpRs9\nbactY76w4BQVntjZ17gSkMhYcyPFZTAIe7QDkeSPk5lkXfTwtaB3YcJSbQ3+s7La\npeEgukQDkrLUIP6cxayKrgUl4fhHdpx1Yk4Bzd/1XkZCjeBca94lP1p2M12amI+Z\nOLSTuLyEiCcku8aN+Ms9plwATmIDaGvKFVk0YVtBHdIJlYXV0yIscab3bqyhsLBK\njwIDAQAB\n-----END PUBLIC KEY-----\n" + }, + "name": "Hackers!", + "published": "2022-02-23T21:54:52+00:00", + "updated": "2022-02-23T21:55:16+00:00", + "url": "https://testv3.gnusocial.rocks/!hackers", + "endpoints": { + "sharedInbox": "https://testv3.gnusocial.rocks/inbox.json" + } +} \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/objects/note.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/note.jsonld new file mode 100755 index 0000000000..7939695143 --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/note.jsonld @@ -0,0 +1,40 @@ +{ + "type": "Note", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/object/note/1337", + "published": "2022-03-10T23:07:50+00:00", + "attributedTo": "https://testv3.gnusocial.rocks/actor/42", + "content": "

hello, world.

", + "mediaType": "text/html", + "source": { + "content": "hello, world.", + "mediaType": "text/plain" + }, + "attachment": [], + "tag": [], + "inConversation": "https://testv3.gnusocial.rocks/conversation/1337", + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers" + ] +} \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/objects/page.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/page.jsonld new file mode 100755 index 0000000000..39cc9dc77f --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/page.jsonld @@ -0,0 +1,42 @@ +{ + "type": "Page", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/object/note/1338", + "published": "2022-03-01T22:44:29+00:00", + "attributedTo": "https://testv3.gnusocial.rocks/actor/42", + "name": "hello, world.", + "content": "

This is an interesting page.

", + "mediaType": "text/html", + "source": { + "content": "This is an interesting page.", + "mediaType": "text/plain" + }, + "attachment": [], + "tag": [], + "inConversation": "https://testv3.gnusocial.rocks/conversation/1338", + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers", + "https://testv3.gnusocial.rocks/actor/21" + ] +} \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/objects/person.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/person.jsonld new file mode 100755 index 0000000000..0c7c4dcb18 --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/person.jsonld @@ -0,0 +1,42 @@ +{ + "type": "Person", + "streams": [], + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/actor/42", + "inbox": "https://testv3.gnusocial.rocks/actor/42/inbox.json", + "outbox": "https://testv3.gnusocial.rocks/actor/42/outbox.json", + "following": "https://testv3.gnusocial.rocks/actor/42/subscriptions", + "followers": "https://testv3.gnusocial.rocks/actor/42/subscribers", + "liked": "https://testv3.gnusocial.rocks/actor/42/favourites", + "preferredUsername": "diogo", + "publicKey": { + "id": "https://testv3.gnusocial.rocks/actor/42#public-key", + "owner": "https://testv3.gnusocial.rocks/actor/42", + "publicKeyPem": "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArBB+3ldwA2qC1hQTtIho\n9KYhvvMlPdydn8dA6OlyIQ3Jy57ADt2e144jDSY5RQ3esmzWm2QqsI8rAsZsAraO\nl2+855y7Fw35WH4GBc7PJ6MLAEvMk1YWeS/rttXaDzh2i4n/AXkMuxDjS1IBqw2w\nn0qTz2sdGcBJ+mop6AB9Qt2lseBc5IW040jSnfLEDDIaYgoc5m2yRsjGKItOh3BG\njGHDb6JB9FySToSMGIt0/tE5k06wfvAxtkxX5dfGeKtciBpC2MGT169iyMIOM8DN\nFhSl8mowtV1NJQ7nN692USrmNvSJjqe9ugPCDPPvwQ5A6A61Qrgpz5pav/o5Sz69\nzQIDAQAB\n-----END PUBLIC KEY-----\n" + }, + "name": "Diogo Peralta Cordeiro", + "published": "2022-02-23T17:20:30+00:00", + "updated": "2022-02-25T02:12:48+00:00", + "url": "https://testv3.gnusocial.rocks/@diogo", + "endpoints": { + "sharedInbox": "https://testv3.gnusocial.rocks/inbox.json" + } +} \ No newline at end of file diff --git a/plugins/ActivityPub/tests/fixtures/gnusocial/objects/reply.jsonld b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/reply.jsonld new file mode 100755 index 0000000000..3429286daf --- /dev/null +++ b/plugins/ActivityPub/tests/fixtures/gnusocial/objects/reply.jsonld @@ -0,0 +1,41 @@ +{ + "type": "Note", + "@context": [ + "https://www.w3.org/ns/activitystreams", + "https://w3id.org/security/v1", + { + "gs": "https://www.gnu.org/software/social/ns#" + }, + { + "litepub": "http://litepub.social/ns#" + }, + { + "chatMessage": "litepub:chatMessage" + }, + { + "inConversation": { + "@id": "gs:inConversation", + "@type": "@id" + } + } + ], + "id": "https://testv3.gnusocial.rocks/object/note/1339", + "published": "2022-03-01T21:00:16+00:00", + "attributedTo": "https://testv3.gnusocial.rocks/actor/42", + "content": "

yay ^^

", + "mediaType": "text/html", + "source": { + "content": "yay ^^", + "mediaType": "text/plain" + }, + "attachment": [], + "tag": [], + "inReplyTo": "https://testv3.gnusocial.rocks/object/note/1338", + "inConversation": "https://testv3.gnusocial.rocks/conversation/1338", + "to": [ + "https://www.w3.org/ns/activitystreams#Public" + ], + "cc": [ + "https://testv3.gnusocial.rocks/actor/42/subscribers" + ] +} \ No newline at end of file