PluginProbe
ActivityPub / 2.1.0
ActivityPub v2.1.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
activitypub / includes / activity / class-actor.php

class-actor.php in ActivityPub 2.1.0, at includes/activity/class-actor.php

175 lines 4.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Inspired by the PHP ActivityPub Library by @Landrok
4 *
5 * @link https://github.com/landrok/activitypub
6 */
7
8 namespace Activitypub\Activity;
9
10 /**
11 * \Activitypub\Activity\Actor is an implementation of
12 * one an Activity Streams Actor.
13 *
14 * Represents an individual actor.
15 *
16 * @see https://www.w3.org/TR/activitystreams-vocabulary/#actor-types
17 */
18 class Actor extends Base_Object {
19 // Reduced context for actors. TODO: still unused.
20 const JSON_LD_CONTEXT = array(
21 'https://www.w3.org/ns/activitystreams',
22 'https://w3id.org/security/v1',
23 'https://purl.archive.org/socialweb/webfinger',
24 array(
25 'schema' => 'http://schema.org#',
26 'toot' => 'http://joinmastodon.org/ns#',
27 'webfinger' => 'https://webfinger.net/#',
28 'lemmy' => 'https://join-lemmy.org/ns#',
29 'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
30 'PropertyValue' => 'schema:PropertyValue',
31 'value' => 'schema:value',
32 'Hashtag' => 'as:Hashtag',
33 'featured' => array(
34 '@id' => 'toot:featured',
35 '@type' => '@id',
36 ),
37 'featuredTags' => array(
38 '@id' => 'toot:featuredTags',
39 '@type' => '@id',
40 ),
41 'moderators' => array(
42 '@id' => 'lemmy:moderators',
43 '@type' => '@id',
44 ),
45 'postingRestrictedToMods' => 'lemmy:postingRestrictedToMods',
46 'discoverable' => 'toot:discoverable',
47 'indexable' => 'toot:indexable',
48 'resource' => 'webfinger:resource',
49 ),
50 );
51
52 /**
53 * @var string
54 */
55 protected $type = 'Person';
56
57 /**
58 * A reference to an ActivityStreams OrderedCollection comprised of
59 * all the messages received by the actor.
60 *
61 * @see https://www.w3.org/TR/activitypub/#inbox
62 *
63 * @var string
64 * | null
65 */
66 protected $inbox;
67
68 /**
69 * A reference to an ActivityStreams OrderedCollection comprised of
70 * all the messages produced by the actor.
71 *
72 * @see https://www.w3.org/TR/activitypub/#outbox
73 *
74 * @var string
75 * | null
76 */
77 protected $outbox;
78
79 /**
80 * A link to an ActivityStreams collection of the actors that this
81 * actor is following.
82 *
83 * @see https://www.w3.org/TR/activitypub/#following
84 *
85 * @var string
86 */
87 protected $following;
88
89 /**
90 * A link to an ActivityStreams collection of the actors that
91 * follow this actor.
92 *
93 * @see https://www.w3.org/TR/activitypub/#followers
94 *
95 * @var string
96 */
97 protected $followers;
98
99 /**
100 * A link to an ActivityStreams collection of objects this actor has
101 * liked.
102 *
103 * @see https://www.w3.org/TR/activitypub/#liked
104 *
105 * @var string
106 */
107 protected $liked;
108
109 /**
110 * A list of supplementary Collections which may be of interest.
111 *
112 * @see https://www.w3.org/TR/activitypub/#streams-property
113 *
114 * @var array
115 */
116 protected $streams = array();
117
118 /**
119 * A short username which may be used to refer to the actor, with no
120 * uniqueness guarantees.
121 *
122 * @see https://www.w3.org/TR/activitypub/#preferredUsername
123 *
124 * @var string|null
125 */
126 protected $preferred_username;
127
128 /**
129 * A JSON object which maps additional typically server/domain-wide
130 * endpoints which may be useful either for this actor or someone
131 * referencing this actor. This mapping may be nested inside the
132 * actor document as the value or may be a link to a JSON-LD
133 * document with these properties.
134 *
135 * @see https://www.w3.org/TR/activitypub/#endpoints
136 *
137 * @var string|array|null
138 */
139 protected $endpoints;
140
141 /**
142 * It's not part of the ActivityPub protocol but it's a quite common
143 * practice to handle an actor public key with a publicKey array:
144 * [
145 * 'id' => 'https://my-example.com/actor#main-key'
146 * 'owner' => 'https://my-example.com/actor',
147 * 'publicKeyPem' => '-----BEGIN PUBLIC KEY-----
148 * MIIBI [...]
149 * DQIDAQAB
150 * -----END PUBLIC KEY-----'
151 * ]
152 *
153 * @see https://www.w3.org/wiki/SocialCG/ActivityPub/Authentication_Authorization#Signing_requests_using_HTTP_Signatures
154 *
155 * @var string|array|null
156 */
157 protected $public_key;
158
159 /**
160 * It's not part of the ActivityPub protocol but it's a quite common
161 * practice to lock an account. If anabled, new followers will not be
162 * automatically accepted, but will instead require you to manually
163 * approve them.
164 *
165 * WordPress does only support 'false' at the moment.
166 *
167 * @see https://docs.joinmastodon.org/spec/activitypub/#as
168 *
169 * @context as:manuallyApprovesFollowers
170 *
171 * @var boolean
172 */
173 protected $manually_approves_followers = false;
174 }
175