An ActivityPub Test

Background

ActivityPub § 5.2 Inbox:

The inbox is discovered through the inbox property of an actor's profile. The inbox MUST be an OrderedCollection.

About this Test

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

Identifier

The identifier of this test is urn:uuid:5e94d155-ed4a-4d71-b797-d7c387736ecf.

Test Subject

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.

Inputs

This test requires the following inputs:

  1. object - the object whose inbox property will be tested

  2. 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.

Applicability

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.

Test Targets

  1. inbox - the value of the inbox property in the input object object

Expectations

  1. inbox is a json object
  2. inbox has a property named type
  3. the values of the inbox's type property must contain "OrderedCollection", as determined by

Assumptions

Interpreting "MUST be an 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.

Test Cases

simple valid inbox

inputs

test targets

inbox is null

inputs

test targets

inbox type array contains only Person

inputs

test targets

object with no properties

inputs

result

object is not JSON

inputs

result

inapplicable because inbox has many values

inputs

test targets

Glossary

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:

Requirements Mapping

Change Log

Issues