mirror of
https://codeberg.org/fediverse/fep.git
synced 2026-08-09 05:56:10 +00:00
FEP-2277: Add VerificationMethod type (#588)
Reviewed-on: https://codeberg.org/fediverse/fep/pulls/588 Co-authored-by: silverpill <silverpill@firemail.cc> Co-committed-by: silverpill <silverpill@firemail.cc>
This commit is contained in:
@@ -41,12 +41,13 @@ The `Actor` type is also mentioned, but it is not a core type.
|
||||
|
||||
Unfortunately, definitions provided in the specification are not precise. The lack of good definitions and the exclusion of the `Actor` type make standard classification unsuitable for practical purposes. Therefore, applications may need to use a different classification.
|
||||
|
||||
One way to divide objects into distinct classes is to look at their properties and their connections to other objects (indicated by their properties). This approach can be used to define 5 core types:
|
||||
One way to divide objects into distinct classes is to look at their properties and their connections to other objects (indicated by their properties). This approach can be used to define 6 core types:
|
||||
|
||||
- Object
|
||||
- Actor
|
||||
- Activity (includes intransitive activities)
|
||||
- Collection (includes collection pages)
|
||||
- VerificationMethod
|
||||
- Link
|
||||
|
||||
The next section specifies an algorithm that classifies any ActivityPub object as one of these core types by analyzing object's shape. This technique is often referred to as [duck typing][DuckTyping].
|
||||
@@ -56,6 +57,7 @@ The next section specifies an algorithm that classifies any ActivityPub object a
|
||||
The following algorithm can be used to determine the core type of the object:
|
||||
|
||||
1. If object has `href` property, return `Link`.
|
||||
1. If object has `publicKeyPem` or `publicKeyMultibase` property, return `VerificationMethod`.
|
||||
1. If object has `inbox` and `outbox` properties, return `Actor`.
|
||||
1. If object has `actor` property, return `Activity`.
|
||||
1. If object has `items`, `orderedItems`, `totalItems`, `partOf`, `first`, `last`, `next`, `prev` or `current` property, return `Collection`.
|
||||
@@ -66,10 +68,10 @@ Application of this algorithm results in non-overlapping core types. For example
|
||||
The value of `type` property is not taken into consideration.
|
||||
|
||||
>[!WARNING]
|
||||
>ActivityPub standard requires actors to have both `inbox` and `outbox` properties, but in practice `outbox` is not always present. If compatibility with non-conformant implementations is desirable, step #1 can be changed to "If object has `inbox` property, return `Actor`".
|
||||
>ActivityPub standard requires actors to have both `inbox` and `outbox` properties, but in practice `outbox` is not always present. If compatibility with non-conformant implementations is desirable, step #3 can be changed to "If object has `inbox` property, return `Actor`".
|
||||
|
||||
>[!WARNING]
|
||||
>Pleroma [adds an `actor` property to objects that are not activities](https://git.pleroma.social/pleroma/pleroma/-/issues/3269). To make an allowance for that, the step #2 of the algorithm can be changed to "If object has an `actor` property, and doesn't have an `attributedTo` property, return `Activity`".
|
||||
>Pleroma [adds an `actor` property to objects that are not activities](https://git.pleroma.social/pleroma/pleroma/-/issues/3269). To make an allowance for that, the step #4 of the algorithm can be changed to "If object has an `actor` property, and doesn't have an `attributedTo` property, return `Activity`".
|
||||
|
||||
### Multi-typing
|
||||
|
||||
|
||||
Reference in New Issue
Block a user