---
attributedTo:
- https://bengo.is
name: support read only outboxes
uuid:
- 483c8708-15ea-41d8-91bb-3659973aa3b1

---

# support read only outboxes

## Motivation

* seek to resolve the issue filed at Inspired by [outbox-write-untestable-unless-testrunner-can-be-a-client](./outbox-write-untestable-unless-testrunner-can-be-a-client.md)

## Context

Currently I host an Actor at https://bengo.is/actor.json

Here is what it resolves to atm.

```json
{
  "@context": [
    "https://www.w3.org/ns/activitystreams",
    "https://w3id.org/security/v1"
  ],
  "id": "https://bengo.is/",
  "type": "Person",
  "preferredUsername": "bengo",
  "name": "bengo",
  "url": "https://bengo.is/",
  "inbox": "https://mastodon.social/users/bengo/inbox",
  "attachments": [
    {
      "type": "PropertyValue",
      "name": "Website",
      "value": "https://bengo.is"
    }
  ],
  "outbox": "https://bengo.is/activitypub/actors/bengo/outbox.json",
  "alsoKnownAs": [
    "did:web:bengo.is",
    "acct:\"\"@bengo.is"
  ]
}
```

If I run that outbox through one of the tests, the result has outcome `failed` :(

```shell
⚡  activitypub-testing run test --slug=outbox-post-servers-must-return-a-201-created-http-code --input.outbox='https://bengo.is/activitypub/actors/bengo/outbox.json' | jq .
{
  "type": "Assertion",
  "test": {
    "id": "urn:uuid:723afcbb-118d-433e-8ab4-560ffca93582",
    "uuid": "723afcbb-118d-433e-8ab4-560ffca93582",
    "url": "https://socialweb.coop/activitypub/test-cases/outbox-post-servers-must-return-a-201-created-http-code/",
    "slug": "outbox-post-servers-must-return-a-201-created-http-code"
  },
  "input": {
    "outbox": "https://bengo.is/activitypub/actors/bengo/outbox.json"
  },
  "result": {
    "outcome": "failed",
    "info": "outbox POST response status MUST be 201, but got 405",
    "pointer": {
      "request": {
        "url": "https://bengo.is/activitypub/actors/bengo/outbox.json"
      },
      "response": {
        "status": 405,
        "statusText": "Not Allowed",
        "body": "<html>\r\n<head><title>405 Not Allowed</title></head>\r\n<body>\r\n<center><h1>405 Not Allowed</h1></cente"
      }
    }
  },
  "@context": [
    "https://socialweb.coop/ns/testing/context.json",
    "https://www.w3.org/ns/activitystreams"
  ]
}
```

## Expected Behavior

Well, I never even tried to support a writable outbox here. The outbox is generated by a separate process that pre-compiles all of this JSON, and then I have a [file server](https://en.wikipedia.org/wiki/File_server) serving those precompiled files. Yes, this is a bit unusual for a dynamic application protocol, but I've heard that it's an architecture that some one like guidance on how to support, so I'm trying it out! ([socialweb.coop](https://socialweb.coop/) uses a more dynamic http response generation approach)

Since my server is responding with a reasonable status code [`405 Method Not Allowed`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405), it should be pretty clear to the testing client that `POST` is not supported, so it is unreasonable for this test to further expect that the status code should be 201 (which is only required when the outbox write is successful)

## Proposal

The test at [outbox-post-servers-must-return-a-201-created-http-code](../src/activitypub-tests/outbox-post-servers-must-return-a-201-created-http-code/) MUST NOT return 'failed' for outbox POST responses with status code 405.

Instead, that test MUST return an `inapplicable` outcome when the outbox POST response has status code 405.

Add a test case for this to the test case md and js. This may involve a new export from the js module `cannotTellCases` to match the e.g. `passedCases`.
