The inbox is discovered through the inbox property of an actor's profile. The inbox MUST be an OrderedCollection.
This is a Test Case describing a rule to determine whether an ActivityPub object has an inbox property that meets this requirement to 'be an OrderedCollection', meeting requirement 4edf6768-c751-448f-96ac-4ef44cb4291f
The identifier of this test is urn:uuid:5e94d155-ed4a-4d71-b797-d7c387736ecf
.
The subject of this test is any data claiming to conform to the specification of an ActivityPub Actor Object.
This test is not inherently applicable to an ActivityPub Server. An ActivityPub Server serves 0 or more Actor Objects. An ActivityPub Server for a big community might serve hundreds of ActivityPub Actor Objects. An ActivityPub Server for a single human may serve only that person's ActivityPub Actor Object.
This test is not inherently applicable to a URL of an Actor Object. The URL is not the same as the Actor Object. The URL may resolve to different Actor Objects in different contexts.
This test requires the following inputs:
object
- the object whose inbox
property will be tested
time
- amount of time allowed to run test. This is meant to configure the limit for how long this test will wait for network requests.
T0.0021S
dur-time
This test applies to inbox objects linked to from the object
input. Usually an actor will have one inbox, but there may be multiple.
This test does not apply to objects with more than one inbox . If the input object
has an inbox property whose value is an array of length >= 2, outcome is inapplicable
.
(See issue #5102 below to track expanding the applicability)
If object
is not parseable as JSON to a JSON object, outcome is inapplicable
.
If object
is a JSON object, but it does not contain a property named inbox
, outcome is inapplicable
. The rationale is that there is already a test acaacb5f-8f7e-4f28-8d81-c7955070a767
that can be used to determine if input object
has an inbox property at all.
inbox
- the value of the inbox
property in the input object
object
object
object must be JSON for this test's applicability, the value of JSON.parse(actor).inbox
must also be JSONinbox
from inputs
inboxValue
be
inputs.actor.inbox
is a JSON string, inboxValue
is that stringinputs.actor.inbox
is a JSON object, inboxValue
is that objectinputs.actor.inbox
is an Array of length 1, inboxValue
is the item in that arrayinputs.actor.inbox
is an Array of length greater than 1, the test outcome is not applicable
(covered in 'Applicability' above)
inboxObject
be
inboxValue
is a json object, inboxObject
is that objectinboxValue
is a json string, inboxObject
is the result of interpreting that string as an ActivityPub Object Identifier and fetching the corresponding ActivityPub Object (e.g. GET https://...
).inbox
is inboxValue
inbox
is a json objectinbox
has a property named type
type
property must contain "OrderedCollection"
, as determined by
inbox
's type
property is a string, it MUST be "OrderedCollection"
inbox
's type
property is an Array, it MUST contain an entry identical to "OrderedCollection"
Revisiting the background from above, ActivityPub says
The inbox is discovered through the inbox property of an actor's profile. The inbox MUST be an OrderedCollection.
"MUST be an OrderedCollection" is open to some interpretation here.
This test chose to interpret 'be an' to include 'indicate its type as'. The rationale is that it's easy to check and easy to implement.
inputs
object
{
"inbox": {
"id": "http://example.org/blog/",
"type": "OrderedCollection",
"name": "Martin's Blog"
}
}
test targets
inbox
value:
{
"id": "http://example.org/blog/",
"type": "OrderedCollection",
"name": "Martin's Blog"
}
outcome: passed
inputs
object
{
"inbox": null
}
test targets
inbox
value:
null
outcome: failed
inputs
object
{
"inbox": {
"type": ["Person"]
}
}
test targets
inbox
value:
{
"type": ["Person"]
}
outcome: failed
inputs
object
{}
result
inapplicable
inputs
object
\0x123abc_intentionallyNotJson
result
inapplicable
inputs
object
{
"inbox": ["https://example.com", "https://example.com"]
}
test targets
inbox
value:
["https://example.com", "https://example.com"]
outcome: inapplicable
outcome
An outcome is a conclusion that comes from evaluating a test on a test subject. An outcome can be one of the three following types:
inapplicable
: No part of the test subject matches the applicabilitypassed
: A test target meets all expectationsfailed
: A test target does not meet all expectationsinbox
has outcome passed
, requirement is satisfiedinbox
has outcome failed
, requirement is not satisfiedinbox
has outcome inapplicable
, further testing is needed to determine requirement satisfaction