---
type:
- TestCase
status: draft
name: Actor Objects must have properties inbox and outbox
description: |
  This rule checks whether a given Actor Object has the properties inbox and outbox.
uuid: acaacb5f-8f7e-4f28-8d81-c7955070a767
attributedTo:
- https://bengo.is

"@context":
- TestCase:
    "@id": http://www.w3.org/ns/earl#:TestCase
  type:
    "@type": "@id"

respec:
  config:
    editors:
    - name: bengo
      url: "https://bengo.is"
      w3cid: 49026
    latestVersion: https://socialweb.coop/activitypub/test-cases/actor-objects-must-have-inbox-outbox-properties/

---

# Actor Objects Must Have Properties inbox and outbox

## Background

[ActivityPub][activitypub] [§4.1 Actor Objects](https://www.w3.org/TR/activitypub/#actor-objects):
> Actor objects MUST have... the following properties: inbox... outbox...

## About this Test

This 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].

* Actor Objects must have inbox property [cc3f730a-37a9-4af9-948f-7c8a0b7f6c41](https://socialweb.coop/activitypub/behaviors/cc3f730a-37a9-4af9-948f-7c8a0b7f6c41/)
* Actor Objects must have outbox property [b8647b47-defb-483c-b468-8602d1124169](https://socialweb.coop/activitypub/behaviors/b8647b47-defb-483c-b468-8602d1124169/)

### Identifier

The identifier of this test is `urn:uuid:acaacb5f-8f7e-4f28-8d81-c7955070a767`.

## 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* directly 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 applies to Actor *Objects*, but *not* all Actor Object are addressable by an HTTPS URL.
The URI that addresses an Actor Object is not the same as the Actor Object.
A 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.

## Inputs

This test requires the following [inputs](https://www.w3.org/TR/act-rules-format/#input):

* `actor` - the actor object that should be tested
    * type: binary data
    * constraints
        * will be interpreted as JSON. If not parseable as JSON, the test result MUST be `inapplicable`.

## 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:
            * [ActivityPub 4.3 Actors](https://www.w3.org/TR/activitystreams-core/#actors):
              > The Activity Vocabulary provides the normative definition of five specific types of Actors: Application | Group | Organization | Person | Service.

[activitypub]: https://www.w3.org/TR/activitypub/

### 2. No property value expectations

This test does not assert any expectations about the *values* of these required properties. The requirement being tested only requires that they are present.

For test cases about the values of these properties, see:

* [inbox-must-be-an-orderedcollection](https://socialweb.coop/activitypub/test-cases/inbox-must-be-an-orderedcollection/)
* [outbox-must-be-an-orderedcollection](https://socialweb.coop/activitypub/test-cases/outbox-must-be-an-orderedcollection/)

## Test Cases

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

### simple valid actor

inputs

* `actor`

  ```json
    {
      "type": "Person",
      "inbox": "https://bengo.is/inbox",
      "outbox": "https://bengo.is/outbox"
    }
    ```

test targets

* `inbox`: present
    * outcome: `passed`
* `outbox`: present
    * outcome: `passed`

### missing inbox

inputs

* `actor`

  ```json
    {
      "type": "Person",
      "outbox": "https://bengo.is/outbox"
    }
    ```

test targets

* `inbox`: not present
    * outcome: `failed`
* `outbox`: present
    * outcome: `passed`

### missing outbox

inputs

* `actor`

  ```json
    {
      "type": "Person",
      "inbox": "https://bengo.is/inbox",
    }
    ```

test targets

* `inbox`: present
    * outcome: `passed`
* `outbox`: not present
    * outcome: `failed`

### actor type, but no inbox nor outbox

inputs

* `actor`

  ```json
    {
      "type": "Person"
    }
    ```

test targets

* `inbox`: not present
    * outcome: `failed`
* `outbox`: not present
    * outcome: `failed`

### not json

inputs

* `actor`

  ```text
  abc
  ```

test targets

* `inbox`: not present
    * outcome: `inapplicable`
* `outbox`: not present
    * outcome: `inapplicable`

### json with no properties

inputs

* `actor`

    ```json
    {}
    ```

test targets

* `inbox`: not present
    * outcome: `inapplicable`
        * because it is not an Actor Object
* `outbox`: not present
    * outcome: `inapplicable`
        * because it is not an Actor Object

### actor with no other properties

inputs

* `actor`

  ```json
  {
    "type": "Person"
  }
  ```

test targets

* `inbox`: not present
    * outcome: `failed`
        * rationale: the object is an Actor, but is missing the required property
* `outbox`: not present
    * outcome: `failed`
        * rationale: the object is an Actor, but is missing the required property

### object with `inbox` but no `type`

inputs

* `actor`

  ```json
  {
    "inbox": "https://bengo.is/inbox"
  }
  ```

test targets

* `inbox`: present
    * outcome: `inapplicable`
        * because it is not an Actor Object. There is no `type` property indicating this is an Actor Object.
* `outbox`: not present
    * outcome: `inapplicable`
        * because it is not an Actor Object. There is no `type` property indicating this is an Actor Object.

## 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:

* `inapplicable`: No part of the test subject matches the applicability
* `passed`: A test target meets all expectations
* `failed`: A test target does not meet all expectations

## Requirements Mapping

* [ActivityPub requirement cc3f730a-37a9-4af9-948f-7c8a0b7f6c41](https://socialweb.coop/activitypub/behaviors/cc3f730a-37a9-4af9-948f-7c8a0b7f6c41/) - actor objects must have an inbox property
    * Required for Conformance to [ActivityPub][activitypub]
    * Outcome Mapping
        * when test target `inbox` has outcome `passed`, requirement is satisfied
        * when test target `inbox` has outcome `failed`, requirement is not satisfied
        * when test target `inbox` has outcome `inapplicable`, further testing is needed to determine requirement satisfaction

* [ActivityPub requirement b8647b47-defb-483c-b468-8602d1124169](https://socialweb.coop/activitypub/behaviors/b8647b47-defb-483c-b468-8602d1124169/) - actor objects must have an outbox property
    * Required for Conformance to [ActivityPub][activitypub]
    * Outcome Mapping for test target `outbox`
        * when test target `outbox` has outcome `passed`, requirement is satisfied
        * when test target `outbox` has outcome `failed`, requirement is not satisfied
        * when test target `outbox` has outcome inapplicable, further testing is needed to determine requirement satisfaction

## Change Log

* 2023-11-03T03:41:20.725Z - first draft
* 2023-12-29T20:48:45.838Z - update test cases with consistent formatting, headings, and fix some mistakes

## Issues List
