From 6c060458136d35c86ea8a358edf1a6d031e95521 Mon Sep 17 00:00:00 2001 From: Chitoku Date: Sun, 19 Nov 2023 04:46:16 +0900 Subject: [PATCH] Implement missing properties in Actor objects (#2460) * Implement missing properties in Actor objects See: https://www.w3.org/TR/activitypub/#actor-objects * Fix a bug where inbox/outbox always returned incorect values --- api/src/Service/ActivityPubService.php | 2 ++ api/tests/Case/Action/ActivityPubActorActionTest.php | 4 ++++ api/tests/Case/Service/ActivityPubServiceTest.php | 2 ++ 3 files changed, 8 insertions(+) diff --git a/api/src/Service/ActivityPubService.php b/api/src/Service/ActivityPubService.php index 939d0844e..e76bbbe9f 100644 --- a/api/src/Service/ActivityPubService.php +++ b/api/src/Service/ActivityPubService.php @@ -25,6 +25,8 @@ public function actor(): array ], 'id' => $this->id, 'type' => 'Application', + 'inbox' => $this->id . '/inbox', + 'outbox' => $this->id . '/outbox', 'preferredUsername' => $this->preferredUsername, 'publicKey' => [ 'id' => $this->id . '#main-key', diff --git a/api/tests/Case/Action/ActivityPubActorActionTest.php b/api/tests/Case/Action/ActivityPubActorActionTest.php index 526ff2900..b085ed098 100644 --- a/api/tests/Case/Action/ActivityPubActorActionTest.php +++ b/api/tests/Case/Action/ActivityPubActorActionTest.php @@ -33,6 +33,8 @@ public function testActor(): void ], 'id' => 'https://example.com/actor', 'type' => 'Application', + 'inbox' => 'https://example.com/actor/inbox', + 'outbox' => 'https://example.com/actor/outbox', 'preferredUsername' => 'example.com', 'publicKey' => [ 'id' => 'https://example.com/actor#main-key', @@ -55,6 +57,8 @@ public function testActor(): void ], 'id' => 'https://example.com/actor', 'type' => 'Application', + 'inbox' => 'https://example.com/actor/inbox', + 'outbox' => 'https://example.com/actor/outbox', 'preferredUsername' => 'example.com', 'publicKey' => [ 'id' => 'https://example.com/actor#main-key', diff --git a/api/tests/Case/Service/ActivityPubServiceTest.php b/api/tests/Case/Service/ActivityPubServiceTest.php index 66c6793dc..c289cbac6 100644 --- a/api/tests/Case/Service/ActivityPubServiceTest.php +++ b/api/tests/Case/Service/ActivityPubServiceTest.php @@ -32,6 +32,8 @@ public function testActor(): void ], 'id' => 'https://example.com/actor', 'type' => 'Application', + 'inbox' => 'https://example.com/actor/inbox', + 'outbox' => 'https://example.com/actor/outbox', 'preferredUsername' => 'example.com', 'publicKey' => [ 'id' => 'https://example.com/actor#main-key',