An ActivityPub Test

Background

ActivityPub § 5.1 Outbox:

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

About this Test

This is a Test Case describing a rule to determine whether an ActivityPub object has an outbox property that meets this requirement to 'be an OrderedCollection', meeting requirement 3b925cdf-89fe-4f51-b41f-26df23f58e0c

Identifier

The identifier of this test is urn:uuid:4af549f4-3797-4d99-a151-67c3d8feaa46 .

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 outbox 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 outbox objects linked to from the object input. Usually an actor will have one outbox, but there may be multiple.

This test does not apply to objects with more than one outbox . If the input object has an outbox 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 outbox, 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 outbox property at all.

Test Targets

Expectations

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

Assumptions

Interpreting "MUST be an OrderedCollection"

Revisiting the background from above, ActivityPub says

The outbox is discovered through the outbox property of an actor's profile. The outbox 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

object has simple valid outbox

inputs

test targets

object outbox is null

inputs

test targets

object outbox type array contains Person

inputs

test targets

inapplicable because outbox has many values

inputs

test targest

result

object is empty object

inputs

result

object is not JSON

inputs

result

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

Required

Nice to Have