Skip to content

Commit

Permalink
Implement missing properties in Actor objects (#2460)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
chitoku-k authored Nov 18, 2023
1 parent df2bae8 commit 6c06045
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/src/Service/ActivityPubService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions api/tests/Case/Action/ActivityPubActorActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions api/tests/Case/Service/ActivityPubServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 6c06045

Please sign in to comment.