ActivityPub §3.2 Retrieving Objects:
Servers... MUST present the ActivityStreams object representation in response to
application/ld+json; profile="https://www.w3.org/ns/activitystreams"
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.
The identifier of this test is urn:uuid:e7ee491d-88d7-4e67-80c8-f74781bb247c
.
The subject of this test is an ActivityPub Server.
ActivityPub Servers host ActivityPub Objects and are responsible for serving them to clients that request a representation of them.
The Test Subject can be identified by a URI for an ActivityPub Object. The ActivityPub Object can be requested via HTTP, and the ActivityPub Server is the system that is expected to respond to the HTTP request.
This test requires the following inputs:
id
- identifier of an ActivityPub Object hosted at an ActivityPub Server
null
authorization
- proof of authorization to retrieve the object identified by input id
Authorization
will be provided in the HTTP request send by this testAuthorization
headertime
- amount of time allowed to run test. This is meant to configure the limit for how long this test will wait for network requests.
T0.0021S
dur-time
This test applies to a server hosting the ActivityPub Object identified by input id
.
If input id
is not a URI, outcome is inapplicable
.
If input id
URI scheme is not https
or http
, outcome is inapplicable
. (This test may be revised later to handle other URI schemes).
If input time
is not parseable as an RFC3339 dur-time
, outcome is inapplicable
.
response
- the HTTP response that is the result of retrieving the ActivityPub Object identified by input id
.
response
from inputstime
. If the timer reaches zero before this derivation is complete, the whole test outcome is inapplicable
because we weren't able to determine the response
test target within the required time.request
be a new HTTP Request whose URI is input id
request
whose name is Accept
and whose value is application/ld+json; profile="https://www.w3.org/ns/activitystreams"
authorization
was provided, add an http request header to request
whose name is Authorization
and whose value is input authorization
response
test targetresponse
body is parseable as JSONresponse
body parsed JSON is a JSON Objectresponse
body must be an "ActivityStreams object representation"
Though the spec only requires serving the object in response to this Accept
header value, servers seeking to interop widely may also want to serve the same object in response to Accept header values like:
application/ld+json
(but without the profile=
parameter)application/activity+json
application/json
These are test cases for this test itself.
outcome: passed
inputs
id
: https://bengo.is/actor.json
time
: T1M
test targets
response
:
HTTP/2 200
content-type: application/json
content-length: 484
{
"@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"
}
passed
outcome: failed
response
does not meet expectation of containing an ActivityPub Object representation in the response bodyinputs
id
: https://bengo.is/404
time
: T1M
test targets
response
:
HTTP/2 404
content-type: text/html; charset=UTF-8
content-length: 153
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.25.2</center>
</body>
</html>
failed
id
outcome: inapplicable
id
is not a URIinputs
id
: bafybeib5mvfjatmpswc3jnh7ydz4zxe25cm63xp6aafpg3j2awakf63qma
time
: T1M
test targets
response
- undefined
id
does not meet syntax requirementstime
outcome: inapplicable
time
does not meet syntax requirementsinputs
id
: https://bengo.is/actor.json
time
: 5 minutes
test targets
response
- undefined
time
input is malformed regardless of resolved resposne
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 applicabilitypassed
: A test target meets all expectationsfailed
: A test target does not meet all expectationsresponse
has outcome passed
, requirement is satisfiedresponse
has outcome failed
, requirement is not satisfiedresponse
has outcome inapplicable
, further testing is needed to determine requirement satisfactionresponse
test targets HTTP response syntax highlighting separates the HTTP headers from the response body. This is a quirk of the rendering process.