Actor Objects Must Have Properties inbox and outbox

Description

This rule checks whether a given Actor Object has the properties inbox and outbox.

Table of Contents

Identifiers

Use these identifiers to refer to this Test.

URI

urn:uuid:acaacb5f-8f7e-4f28-8d81-c7955070a767

slug

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

actor-objects-must-have-inbox-outbox-properties

Input

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

input.actor

the Actor Object to be tested for presence of required properties

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

input.actor as json
{
  "help": "the Actor Object to be tested for presence of required properties",
  "required": true,
  "rangeIncludes": [
    "https://www.w3.org/ns/activitystreams#Actor"
  ]
}

Input as JSON
{
  "actor": {
    "help": "the Actor Object to be tested for presence of required properties",
    "required": true,
    "rangeIncludes": [
      "https://www.w3.org/ns/activitystreams#Actor"
    ]
  }
}

Applicability ?

This test applies directly to the `actor` input.
If `actor` is not an Actor Object, the outcome MUST be `inapplicable`.
* see assumption "How to Determine Whether Input is an Actor Object" below
If `actor` JSON does not have a `type` property, the outcome MUST be `inapplicable`.
### Test Targets
* `inbox` - the inbox property (or lack thereof) in the input `actor` JSON object
* `outbox` - the outbox property (or lack thereof) in the input `actor` JSON object

Expectations ?

1. `actor` JSON has a property whose name is `inbox`.
    * If there is no `inbox` property, the outcome is `failed` for test target `inbox`
2. `actor` JSON has a property whose name is `outbox`
    * If there is no `outbox` property, the outcome is `failed` for test target `outbox`

Assumptions ?

### 1. How to Determine Whether Input is an Actor Object
For the purposes of determining whether the input `actor` is in fact an actor object and whether this test is applicable to that input,
this test assumes that a valid way of determining whether the input is an Actor Object is:
* the input is valid JSON
* the input, once parsed as JSON
    * has a `type` property
    * has a `type` property value that is either a string or array of strings
    * one of those `type` value strings is one of `Application`, `Group`, `Organization`, `Person`, `Service`
        * rationale:

Requirement Mapping

This Test has been derived from these specified requirements.

  • urn:uuid:cc3f730a-37a9-4af9-948f-7c8a0b7f6c41

    content
    actor objects must have an inbox property
    origin
    {
      "source": "https://www.w3.org/TR/activitypub/",
      "section": {
        "id": "https://www.w3.org/TR/activitypub/#actor-objects",
        "branch": [
          4,
          1
        ]
      },
      "selector": {
        "type": "TextQuoteSelector",
        "exact": "Actor objects MUST have, in addition to the properties mandated by 3.1 Object Identifiers, the following properties:\ninbox\n  A reference to an [ActivityStreams] OrderedCollection comprised of all the messages received by the actor; see 5.2 Inbox. \n",
        "prefix": "4.1 Actor objects\n",
        "suffix": "outbox\n  An [ActivityStreams] OrderedCollection comprised of all the messages produced by the actor; see 5.1 Outbox.\n"
      }
    }
    JSON
    {
      "id": "urn:uuid:cc3f730a-37a9-4af9-948f-7c8a0b7f6c41",
      "type": "Behavior",
      "uuid": "cc3f730a-37a9-4af9-948f-7c8a0b7f6c41",
      "content": "actor objects must have an inbox property",
      "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/#actor-objects",
          "branch": [
            4,
            1
          ]
        },
        "selector": {
          "type": "TextQuoteSelector",
          "exact": "Actor objects MUST have, in addition to the properties mandated by 3.1 Object Identifiers, the following properties:\ninbox\n  A reference to an [ActivityStreams] OrderedCollection comprised of all the messages received by the actor; see 5.2 Inbox. \n",
          "prefix": "4.1 Actor objects\n",
          "suffix": "outbox\n  An [ActivityStreams] OrderedCollection comprised of all the messages produced by the actor; see 5.1 Outbox.\n"
        }
      },
      "@context": [
        "https://www.w3.org/ns/activitystreams",
        "https://socialweb.coop/ns/testing/context.json"
      ]
    }
  • urn:uuid:b8647b47-defb-483c-b468-8602d1124169

    content
    actor objects must have an outbox property
    origin
    {
      "source": "https://www.w3.org/TR/activitypub/",
      "section": {
        "id": "https://www.w3.org/TR/activitypub/#actor-objects",
        "branch": [
          4,
          1
        ]
      },
      "selector": {
        "type": "List",
        "items": [
          {
            "type": "TextQuoteSelector",
            "exact": "Actor objects MUST have, in addition to the properties mandated by 3.1 Object Identifiers, the following properties:\n",
            "prefix": "4.1 Actor objects\n",
            "suffix": "inbox\n  A reference to an [ActivityStreams] OrderedCollection comprised of all the messages received by the actor; see 5.2 Inbox.\n"
          },
          {
            "type": "TextQuoteSelector",
            "exact": "outbox\n  An [ActivityStreams] OrderedCollection comprised of all the messages produced by the actor; see 5.1 Outbox.\n",
            "prefix": "received by the actor; see 5.2 Inbox.\n",
            "suffix": "Implementations SHOULD, in addition, provide the following properties:\n"
          }
        ]
      }
    }
    JSON
    {
      "id": "urn:uuid:b8647b47-defb-483c-b468-8602d1124169",
      "type": "Behavior",
      "uuid": "b8647b47-defb-483c-b468-8602d1124169",
      "content": "actor objects must have an outbox property",
      "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/#actor-objects",
          "branch": [
            4,
            1
          ]
        },
        "selector": {
          "type": "List",
          "items": [
            {
              "type": "TextQuoteSelector",
              "exact": "Actor objects MUST have, in addition to the properties mandated by 3.1 Object Identifiers, the following properties:\n",
              "prefix": "4.1 Actor objects\n",
              "suffix": "inbox\n  A reference to an [ActivityStreams] OrderedCollection comprised of all the messages received by the actor; see 5.2 Inbox.\n"
            },
            {
              "type": "TextQuoteSelector",
              "exact": "outbox\n  An [ActivityStreams] OrderedCollection comprised of all the messages produced by the actor; see 5.1 Outbox.\n",
              "prefix": "received by the actor; see 5.2 Inbox.\n",
              "suffix": "Implementations SHOULD, in addition, provide the following properties:\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
{
  "description": "This rule checks whether a given Actor Object has the properties inbox and outbox.",
  "failedCases": [
    {
      "name": "actor without required properties",
      "input": {
        "actor": {
          "type": "Person"
        }
      },
      "result": {
        "outcome": "failed"
      }
    }
  ],
  "inapplicableCases": [
    {
      "name": "null actor",
      "input": {
        "actor": null
      },
      "result": {
        "outcome": "inapplicable"
      }
    },
    {
      "name": "empty object actor",
      "input": {
        "actor": {}
      },
      "result": {
        "outcome": "inapplicable"
      }
    },
    {
      "name": "actor with input actor not json",
      "input": {
        "actor": "2b292jb"
      },
      "result": {
        "outcome": "inapplicable"
      }
    }
  ],
  "input": {
    "actor": {
      "help": "the Actor Object to be tested for presence of required properties",
      "required": true,
      "rangeIncludes": [
        "https://www.w3.org/ns/activitystreams#Actor"
      ]
    }
  },
  "markdown": "---\ntype:\n- TestCase\nstatus: draft\nname: Actor Objects must have properties inbox and outbox\ndescription: |\n  This rule checks whether a given Actor Object has the properties inbox and outbox.\nuuid: acaacb5f-8f7e-4f28-8d81-c7955070a767\nattributedTo:\n- https://bengo.is\n\n\"@context\":\n- TestCase:\n    \"@id\": http://www.w3.org/ns/earl#:TestCase\n  type:\n    \"@type\": \"@id\"\n\nrespec:\n  config:\n    editors:\n    - name: bengo\n      url: \"https://bengo.is\"\n      w3cid: 49026\n    latestVersion: https://socialweb.coop/activitypub/test-cases/actor-objects-must-have-inbox-outbox-properties/\n\n---\n\n# Actor Objects Must Have Properties inbox and outbox\n\n## Background\n\n[ActivityPub][activitypub] [ยง4.1 Actor Objects](https://www.w3.org/TR/activitypub/#actor-objects):\n> Actor objects MUST have... the following properties: inbox... outbox...\n\n## About this Test\n\nThis is a Test Case describing a rule to determine whether an ActivityPub Object is in partial conformance with the following behaviors required by [ActivityPub][activitypub].\n\n* Actor Objects must have inbox property [cc3f730a-37a9-4af9-948f-7c8a0b7f6c41](https://socialweb.coop/activitypub/behaviors/cc3f730a-37a9-4af9-948f-7c8a0b7f6c41/)\n* Actor Objects must have outbox property [b8647b47-defb-483c-b468-8602d1124169](https://socialweb.coop/activitypub/behaviors/b8647b47-defb-483c-b468-8602d1124169/)\n\n### Identifier\n\nThe identifier of this test is `urn:uuid:acaacb5f-8f7e-4f28-8d81-c7955070a767`.\n\n## Test Subject\n\nThe subject of this test is any data claiming to conform to the specification of an ActivityPub Actor Object.\n\nThis test is *not* directly applicable to an ActivityPub Server.\nAn ActivityPub Server serves 0 or more Actor Objects.\nAn ActivityPub Server for a big community might serve hundreds of ActivityPub Actor Objects.\nAn ActivityPub Server for a single human may serve only that person's ActivityPub Actor Object.\n\nThis test applies to Actor *Objects*, but *not* all Actor Object are addressable by an HTTPS URL.\nThe URI that addresses an Actor Object is not the same as the Actor Object.\nA given URL may resolve to different Actor Objects in different contexts, and a given Actor Object may not be universally addressable across context by any one URL.\n\n## Inputs\n\nThis test requires the following [inputs](https://www.w3.org/TR/act-rules-format/#input):\n\n* `actor` - the actor object that should be tested\n    * type: binary data\n    * constraints\n        * will be interpreted as JSON. If not parseable as JSON, the test result MUST be `inapplicable`.\n\n## Applicability\n\nThis test applies directly to the `actor` input.\n\nIf `actor` is not an Actor Object, the outcome MUST be `inapplicable`.\n\n* see assumption \"How to Determine Whether Input is an Actor Object\" below\n\nIf `actor` JSON does not have a `type` property, the outcome MUST be `inapplicable`.\n\n### Test Targets\n\n* `inbox` - the inbox property (or lack thereof) in the input `actor` JSON object\n* `outbox` - the outbox property (or lack thereof) in the input `actor` JSON object\n\n## Expectations\n\n1. `actor` JSON has a property whose name is `inbox`.\n    * If there is no `inbox` property, the outcome is `failed` for test target `inbox`\n\n2. `actor` JSON has a property whose name is `outbox`\n    * If there is no `outbox` property, the outcome is `failed` for test target `outbox`\n\n## Assumptions\n\n### 1. How to Determine Whether Input is an Actor Object\n\nFor the purposes of determining whether the input `actor` is in fact an actor object and whether this test is applicable to that input,\nthis test assumes that a valid way of determining whether the input is an Actor Object is:\n\n* the input is valid JSON\n* the input, once parsed as JSON\n    * has a `type` property\n    * has a `type` property value that is either a string or array of strings\n    * one of those `type` value strings is one of `Application`, `Group`, `Organization`, `Person`, `Service`\n        * rationale:\n            * [ActivityPub 4.3 Actors](https://www.w3.org/TR/activitystreams-core/#actors):\n              > The Activity Vocabulary provides the normative definition of five specific types of Actors: Application | Group | Organization | Person | Service.\n\n[activitypub]: https://www.w3.org/TR/activitypub/\n\n### 2. No property value expectations\n\nThis test does not assert any expectations about the *values* of these required properties. The requirement being tested only requires that they are present.\n\nFor test cases about the values of these properties, see:\n\n* [inbox-must-be-an-orderedcollection](https://socialweb.coop/activitypub/test-cases/inbox-must-be-an-orderedcollection/)\n* [outbox-must-be-an-orderedcollection](https://socialweb.coop/activitypub/test-cases/outbox-must-be-an-orderedcollection/)\n\n## Test Cases\n\nThese are test cases for this test case, and can be used to verify that an implementation of this test case specification will be [consistent](https://www.w3.org/WAI/standards-guidelines/act/implementations/#understanding-act-consistency) with other implementations.\n\n### simple valid actor\n\ninputs\n\n* `actor`\n\n  ```json\n    {\n      \"type\": \"Person\",\n      \"inbox\": \"https://bengo.is/inbox\",\n      \"outbox\": \"https://bengo.is/outbox\"\n    }\n    ```\n\ntest targets\n\n* `inbox`: present\n    * outcome: `passed`\n* `outbox`: present\n    * outcome: `passed`\n\n### missing inbox\n\ninputs\n\n* `actor`\n\n  ```json\n    {\n      \"type\": \"Person\",\n      \"outbox\": \"https://bengo.is/outbox\"\n    }\n    ```\n\ntest targets\n\n* `inbox`: not present\n    * outcome: `failed`\n* `outbox`: present\n    * outcome: `passed`\n\n### missing outbox\n\ninputs\n\n* `actor`\n\n  ```json\n    {\n      \"type\": \"Person\",\n      \"inbox\": \"https://bengo.is/inbox\",\n    }\n    ```\n\ntest targets\n\n* `inbox`: present\n    * outcome: `passed`\n* `outbox`: not present\n    * outcome: `failed`\n\n### actor type, but no inbox nor outbox\n\ninputs\n\n* `actor`\n\n  ```json\n    {\n      \"type\": \"Person\"\n    }\n    ```\n\ntest targets\n\n* `inbox`: not present\n    * outcome: `failed`\n* `outbox`: not present\n    * outcome: `failed`\n\n### not json\n\ninputs\n\n* `actor`\n\n  ```text\n  abc\n  ```\n\ntest targets\n\n* `inbox`: not present\n    * outcome: `inapplicable`\n* `outbox`: not present\n    * outcome: `inapplicable`\n\n### json with no properties\n\ninputs\n\n* `actor`\n\n    ```json\n    {}\n    ```\n\ntest targets\n\n* `inbox`: not present\n    * outcome: `inapplicable`\n        * because it is not an Actor Object\n* `outbox`: not present\n    * outcome: `inapplicable`\n        * because it is not an Actor Object\n\n### actor with no other properties\n\ninputs\n\n* `actor`\n\n  ```json\n  {\n    \"type\": \"Person\"\n  }\n  ```\n\ntest targets\n\n* `inbox`: not present\n    * outcome: `failed`\n        * rationale: the object is an Actor, but is missing the required property\n* `outbox`: not present\n    * outcome: `failed`\n        * rationale: the object is an Actor, but is missing the required property\n\n### object with `inbox` but no `type`\n\ninputs\n\n* `actor`\n\n  ```json\n  {\n    \"inbox\": \"https://bengo.is/inbox\"\n  }\n  ```\n\ntest targets\n\n* `inbox`: present\n    * outcome: `inapplicable`\n        * because it is not an Actor Object. There is no `type` property indicating this is an Actor Object.\n* `outbox`: not present\n    * outcome: `inapplicable`\n        * because it is not an Actor Object. There is no `type` property indicating this is an Actor Object.\n\n## Glossary\n\n### `outcome`\n\nAn outcome is a conclusion that comes from evaluating a test on a test subject.\nAn outcome can be one of the three following types:\n\n* `inapplicable`: No part of the test subject matches the applicability\n* `passed`: A test target meets all expectations\n* `failed`: A test target does not meet all expectations\n\n## Requirements Mapping\n\n* [ActivityPub requirement cc3f730a-37a9-4af9-948f-7c8a0b7f6c41](https://socialweb.coop/activitypub/behaviors/cc3f730a-37a9-4af9-948f-7c8a0b7f6c41/) - actor objects must have an inbox property\n    * Required for Conformance to [ActivityPub][activitypub]\n    * Outcome Mapping\n        * when test target `inbox` has outcome `passed`, requirement is satisfied\n        * when test target `inbox` has outcome `failed`, requirement is not satisfied\n        * when test target `inbox` has outcome `inapplicable`, further testing is needed to determine requirement satisfaction\n\n* [ActivityPub requirement b8647b47-defb-483c-b468-8602d1124169](https://socialweb.coop/activitypub/behaviors/b8647b47-defb-483c-b468-8602d1124169/) - actor objects must have an outbox property\n    * Required for Conformance to [ActivityPub][activitypub]\n    * Outcome Mapping for test target `outbox`\n        * when test target `outbox` has outcome `passed`, requirement is satisfied\n        * when test target `outbox` has outcome `failed`, requirement is not satisfied\n        * when test target `outbox` has outcome inapplicable, further testing is needed to determine requirement satisfaction\n\n## Change Log\n\n* 2023-11-03T03:41:20.725Z - first draft\n* 2023-12-29T20:48:45.838Z - update test cases with consistent formatting, headings, and fix some mistakes\n\n## Issues List\n",
  "applicability": "This test applies directly to the `actor` input.\nIf `actor` is not an Actor Object, the outcome MUST be `inapplicable`.\n* see assumption \"How to Determine Whether Input is an Actor Object\" below\nIf `actor` JSON does not have a `type` property, the outcome MUST be `inapplicable`.\n### Test Targets\n* `inbox` - the inbox property (or lack thereof) in the input `actor` JSON object\n* `outbox` - the outbox property (or lack thereof) in the input `actor` JSON object\n",
  "assumptions": "### 1. How to Determine Whether Input is an Actor Object\nFor the purposes of determining whether the input `actor` is in fact an actor object and whether this test is applicable to that input,\nthis test assumes that a valid way of determining whether the input is an Actor Object is:\n* the input is valid JSON\n* the input, once parsed as JSON\n    * has a `type` property\n    * has a `type` property value that is either a string or array of strings\n    * one of those `type` value strings is one of `Application`, `Group`, `Organization`, `Person`, `Service`\n        * rationale:\n",
  "expectations": "1. `actor` JSON has a property whose name is `inbox`.\n    * If there is no `inbox` property, the outcome is `failed` for test target `inbox`\n2. `actor` JSON has a property whose name is `outbox`\n    * If there is no `outbox` property, the outcome is `failed` for test target `outbox`\n",
  "name": "Actor Objects Must Have Properties inbox and outbox",
  "passedCases": [
    {
      "name": "simple valid actor",
      "input": {
        "actor": {
          "type": "Person",
          "inbox": "https://bengo.is/inbox",
          "outbox": "https://bengo.is/outbox"
        }
      },
      "result": {
        "outcome": "passed"
      }
    }
  ],
  "slug": "actor-objects-must-have-inbox-outbox-properties",
  "uuid": "acaacb5f-8f7e-4f28-8d81-c7955070a767",
  "isPartOf": [
    "https://socialweb.coop/activitypub/test-cases/"
  ],
  "requirementReference": [
    {
      "id": "urn:uuid:cc3f730a-37a9-4af9-948f-7c8a0b7f6c41",
      "url": "https://socialweb.coop/activitypub/behaviors/cc3f730a-37a9-4af9-948f-7c8a0b7f6c41/"
    },
    {
      "id": "urn:uuid:b8647b47-defb-483c-b468-8602d1124169",
      "url": "https://socialweb.coop/activitypub/behaviors/b8647b47-defb-483c-b468-8602d1124169/"
    }
  ]
}