Outbox Wraps Object With Create Activity

Description

a test rule that submits an object to an outbox and checks for conformance with requirements for how the outbox server must wrap the object in a Create Activity.

Table of Contents

Identifiers

Use these identifiers to refer to this Test.

URI

urn:uuid:963a2313-788e-4bb7-b6ea-0d8bf7d255ef

slug

This slug is memorable, but it is not guaranteed to be globally unique like a URI.

outbox-wraps-object-with-create-checked-using-get-location

Input

This describes the input that each test run will use to select test targets.

input.outbox

URL of ActivityPub outbox that an object will be sent to

required
true
range
https://www.w3.org/ns/activitystreams#outbox

input.outbox as json
{
  "help": "URL of ActivityPub outbox that an object will be sent to",
  "required": true,
  "rangeIncludes": [
    "https://www.w3.org/ns/activitystreams#outbox"
  ]
}

input.authorization

HTTP Authorization header value that will be sent with ActivityPub requests

required
false
type
xsd:string, https://activitypub-testing.socialweb.coop/ns/HiddenInTestResults
range
https://www.rfc-editor.org/rfc/rfc9110#field.authorization.value

input.authorization as json
{
  "help": "HTTP Authorization header value that will be sent with ActivityPub requests",
  "required": false,
  "type": [
    "xsd:string",
    "https://activitypub-testing.socialweb.coop/ns/HiddenInTestResults"
  ],
  "rangeIncludes": [
    "https://www.rfc-editor.org/rfc/rfc9110#field.authorization.value"
  ]
}

Input as JSON
{
  "outbox": {
    "help": "URL of ActivityPub outbox that an object will be sent to",
    "required": true,
    "rangeIncludes": [
      "https://www.w3.org/ns/activitystreams#outbox"
    ]
  },
  "authorization": {
    "help": "HTTP Authorization header value that will be sent with ActivityPub requests",
    "required": false,
    "type": [
      "xsd:string",
      "https://activitypub-testing.socialweb.coop/ns/HiddenInTestResults"
    ],
    "rangeIncludes": [
      "https://www.rfc-editor.org/rfc/rfc9110#field.authorization.value"
    ]
  }
}

Applicability ?

This test applies to an ActivityPub Server handling POST requests to an ActivityPub Outbox.

Test Targets
* outbox: same value as input.outbox

Expectations ?

* target `outboxPostLocationResponse` http request body must be a JSON string that parses to a JSON Object called `outboxPostResult`
* `outboxPostResult` must have a `type` property whose value is either the string "Create" or an Array containing the string "Create"
* `outboxPostResult` must have a `object` property whose value includes the object from test target `submission` (i.e. the object that was sent to the outbox, and should have been wrapped in a Create).
* `outboxPostResult` must have a `id` property whose value is a URI
* `outboxPostResult.object` must have a `id` property whose value is a URI
* every value linked from  `submission` using the to, bto, cc, bcc, and audience properties must be included in the values for the same property in `outboxPostResult`
* every value linked from  `submission` using the to, bto, cc, bcc, and audience properties must be included in the values for the same property in `outboxPostResult.object`

Test Cases ?

outbox=https://socialweb.coop/outbox

id
urn:uuid:d7c8b377-2850-481b-992f-92ac437a9f3c
input.outbox
https://socialweb.coop/outbox
result.outcome
passed

outbox=https://example.com

id
urn:uuid:dde952d7-b9b0-488f-8b06-61a10ba134d4
input.outbox
https://example.com/
result.outcome
inapplicable

Requirement Mapping

This Test has been derived from these specified requirements.

  • urn:uuid:e6d00349-6d07-4512-9a99-f698d3bc1dba

    content
    The server then MUST attach this object as the object of a Create Activity.
    origin
    {
      "source": "https://www.w3.org/TR/activitypub/",
      "section": {
        "id": "https://www.w3.org/TR/activitypub/#object-without-create",
        "name": "Object creation without a Create Activity",
        "branch": [
          6,
          2,
          1
        ]
      },
      "selector": {
        "type": "TextQuoteSelector",
        "prefix": "The server MUST accept a valid [ActivityStreams] object that isn't a subtype of Activity in the POST request to the outbox.\n",
        "exact": "The server then MUST attach this object as the object of a Create Activity.\n",
        "suffix": "For non-transient objects, the server MUST attach an id to both the wrapping Create and its wrapped Object.\n"
      }
    }
    JSON
    {
      "id": "urn:uuid:e6d00349-6d07-4512-9a99-f698d3bc1dba",
      "uuid": "e6d00349-6d07-4512-9a99-f698d3bc1dba",
      "type": "Behavior",
      "content": "The server then MUST attach this object as the object of a Create Activity.\n",
      "tag": [
        {
          "name": "ActivityPubServer",
          "id": "https://socialweb.coop/tag/ActivityPubServer"
        }
      ],
      "context": [
        "https://www.w3.org/TR/activitypub/",
        {
          "name": "6.2 Create Activity",
          "id": "https://www.w3.org/TR/activitypub/#create-activity-outbox"
        },
        {
          "name": "6.2.1 Object creation without a Create Activity",
          "id": "https://www.w3.org/TR/activitypub/#object-without-create"
        }
      ],
      "origin": {
        "source": "https://www.w3.org/TR/activitypub/",
        "section": {
          "id": "https://www.w3.org/TR/activitypub/#object-without-create",
          "name": "Object creation without a Create Activity",
          "branch": [
            6,
            2,
            1
          ]
        },
        "selector": {
          "type": "TextQuoteSelector",
          "prefix": "The server MUST accept a valid [ActivityStreams] object that isn't a subtype of Activity in the POST request to the outbox.\n",
          "exact": "The server then MUST attach this object as the object of a Create Activity.\n",
          "suffix": "For non-transient objects, the server MUST attach an id to both the wrapping Create and its wrapped Object.\n"
        }
      },
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        "https://socialweb.coop/ns/testing/context.json"
      ]
    }
  • urn:uuid:104e2cde-f072-43af-badd-bf9bd4129151

    content
    For non-transient objects, the server MUST attach an id to both the wrapping Create and its wrapped Object.
    origin
    {
      "source": "https://www.w3.org/TR/activitypub/",
      "section": {
        "id": "https://www.w3.org/TR/activitypub/#object-without-create",
        "name": "Object creation without a Create Activity",
        "branch": [
          6,
          2,
          1
        ]
      },
      "selector": {
        "type": "TextQuoteSelector",
        "prefix": "The server then MUST attach this object as the object of a Create Activity.\n",
        "exact": "For non-transient objects, the server MUST attach an id to both the wrapping Create and its wrapped Object.\n",
        "suffix": "Note\n"
      }
    }
    JSON
    {
      "id": "urn:uuid:104e2cde-f072-43af-badd-bf9bd4129151",
      "uuid": "104e2cde-f072-43af-badd-bf9bd4129151",
      "type": "Behavior",
      "content": "For non-transient objects, the server MUST attach an id to both the wrapping Create and its wrapped Object.\n",
      "tag": [
        {
          "name": "ActivityPubServer",
          "id": "https://socialweb.coop/tag/ActivityPubServer"
        }
      ],
      "context": [
        "https://www.w3.org/TR/activitypub/",
        {
          "name": "6.2 Create Activity",
          "id": "https://www.w3.org/TR/activitypub/#create-activity-outbox"
        },
        {
          "name": "6.2.1 Object creation without a Create Activity",
          "id": "https://www.w3.org/TR/activitypub/#object-without-create"
        }
      ],
      "origin": {
        "source": "https://www.w3.org/TR/activitypub/",
        "section": {
          "id": "https://www.w3.org/TR/activitypub/#object-without-create",
          "name": "Object creation without a Create Activity",
          "branch": [
            6,
            2,
            1
          ]
        },
        "selector": {
          "type": "TextQuoteSelector",
          "prefix": "The server then MUST attach this object as the object of a Create Activity.\n",
          "exact": "For non-transient objects, the server MUST attach an id to both the wrapping Create and its wrapped Object.\n",
          "suffix": "Note\n"
        }
      },
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        "https://socialweb.coop/ns/testing/context.json"
      ]
    }
  • urn:uuid:f3725db1-1e6b-4d20-9cea-a49ef4291e9f

    content
    Any to, bto, cc, bcc, and audience properties specified on the object MUST be copied over to the new Create activity by the server.
    origin
    {
      "source": "https://www.w3.org/TR/activitypub/",
      "section": {
        "id": "https://www.w3.org/TR/activitypub/#object-without-create",
        "name": "Object creation without a Create Activity",
        "branch": [
          6,
          2,
          1
        ]
      },
      "selector": {
        "type": "TextQuoteSelector",
        "prefix": "The Location value returned by the server should be the URL of the new Create activity (rather than the object). \n",
        "exact": "Any to, bto, cc, bcc, and audience properties specified on the object MUST be copied over to the new Create activity by the server.\n",
        "suffix": "Example 15: Object with audience targeting\n"
      }
    }
    JSON
    {
      "id": "urn:uuid:f3725db1-1e6b-4d20-9cea-a49ef4291e9f",
      "uuid": "f3725db1-1e6b-4d20-9cea-a49ef4291e9f",
      "type": "Behavior",
      "content": "Any to, bto, cc, bcc, and audience properties specified on the object MUST be copied over to the new Create activity by the server.\n",
      "context": [
        "https://www.w3.org/TR/activitypub/",
        {
          "name": "6.2 Create Activity",
          "id": "https://www.w3.org/TR/activitypub/#create-activity-outbox"
        },
        {
          "name": "6.2.1 Object creation without a Create Activity",
          "id": "https://www.w3.org/TR/activitypub/#object-without-create"
        }
      ],
      "tag": [
        {
          "name": "ActivityPubServer",
          "id": "https://socialweb.coop/tag/ActivityPubServer"
        }
      ],
      "origin": {
        "source": "https://www.w3.org/TR/activitypub/",
        "section": {
          "id": "https://www.w3.org/TR/activitypub/#object-without-create",
          "name": "Object creation without a Create Activity",
          "branch": [
            6,
            2,
            1
          ]
        },
        "selector": {
          "type": "TextQuoteSelector",
          "prefix": "The Location value returned by the server should be the URL of the new Create activity (rather than the object). \n",
          "exact": "Any to, bto, cc, bcc, and audience properties specified on the object MUST be copied over to the new Create activity by the server.\n",
          "suffix": "Example 15: Object with audience targeting\n"
        }
      },
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        "https://socialweb.coop/ns/testing/context.json"
      ]
    }

Part of

This test is part of the following Test Suites:

JSON

Test Case as JSON
{
  "name": "Outbox Wraps Object With Create Activity",
  "description": "a test rule that submits an object to an outbox and checks for conformance with requirements for how the outbox server must wrap the object in a Create Activity.",
  "slug": "outbox-wraps-object-with-create-checked-using-get-location",
  "input": {
    "outbox": {
      "help": "URL of ActivityPub outbox that an object will be sent to",
      "required": true,
      "rangeIncludes": [
        "https://www.w3.org/ns/activitystreams#outbox"
      ]
    },
    "authorization": {
      "help": "HTTP Authorization header value that will be sent with ActivityPub requests",
      "required": false,
      "type": [
        "xsd:string",
        "https://activitypub-testing.socialweb.coop/ns/HiddenInTestResults"
      ],
      "rangeIncludes": [
        "https://www.rfc-editor.org/rfc/rfc9110#field.authorization.value"
      ]
    }
  },
  "applicability": "\nThis test applies to an ActivityPub Server handling POST requests to an ActivityPub Outbox.\n\nTest Targets\n* outbox: same value as input.outbox\n",
  "inapplicableCases": [],
  "passedCases": [],
  "failedCases": [],
  "uuid": "963a2313-788e-4bb7-b6ea-0d8bf7d255ef",
  "isPartOf": [
    "https://socialweb.coop/activitypub/test-cases/"
  ],
  "requirementReference": [
    {
      "id": "urn:uuid:e6d00349-6d07-4512-9a99-f698d3bc1dba",
      "url": "https://activitypub-testing.socialweb.coop/e6d00349-6d07-4512-9a99-f698d3bc1dba"
    },
    {
      "id": "urn:uuid:104e2cde-f072-43af-badd-bf9bd4129151",
      "url": "https://activitypub-testing.socialweb.coop/104e2cde-f072-43af-badd-bf9bd4129151"
    },
    {
      "id": "urn:uuid:f3725db1-1e6b-4d20-9cea-a49ef4291e9f",
      "url": "https://activitypub-testing.socialweb.coop/f3725db1-1e6b-4d20-9cea-a49ef4291e9f"
    }
  ],
  "testCases": [
    {
      "name": "outbox=https://socialweb.coop/outbox",
      "id": "urn:uuid:d7c8b377-2850-481b-992f-92ac437a9f3c",
      "input": {
        "outbox": "https://socialweb.coop/outbox"
      },
      "result": {
        "outcome": "passed"
      }
    },
    {
      "name": "outbox=https://example.com",
      "id": "urn:uuid:dde952d7-b9b0-488f-8b06-61a10ba134d4",
      "input": {
        "outbox": "https://example.com/"
      },
      "result": {
        "outcome": "inapplicable"
      }
    }
  ],
  "expectations": "\n* target `outboxPostLocationResponse` http request body must be a JSON string that parses to a JSON Object called `outboxPostResult`\n* `outboxPostResult` must have a `type` property whose value is either the string \"Create\" or an Array containing the string \"Create\"\n* `outboxPostResult` must have a `object` property whose value includes the object from test target `submission` (i.e. the object that was sent to the outbox, and should have been wrapped in a Create).\n* `outboxPostResult` must have a `id` property whose value is a URI\n* `outboxPostResult.object` must have a `id` property whose value is a URI\n* every value linked from  `submission` using the to, bto, cc, bcc, and audience properties must be included in the values for the same property in `outboxPostResult`\n* every value linked from  `submission` using the to, bto, cc, bcc, and audience properties must be included in the values for the same property in `outboxPostResult.object`\n"
}