Page the outbox and serve individual posts (phase 3, step 7)
CI / validate-monitoring (push) Successful in 8s
CI / federation-interop (push) Successful in 1m1s
CI / lint (push) Successful in 1m10s
CI / test (push) Successful in 2m47s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
CI / validate-monitoring (push) Successful in 8s
CI / federation-interop (push) Successful in 1m1s
CI / lint (push) Successful in 1m10s
CI / test (push) Successful in 2m47s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / notify (push) Successful in 5s
GET /users/<u>/outbox is now a real OrderedCollection pointing at paged OrderedCollectionPages of 20 Creates, newest first - public and unlisted posts only, since it's unauthenticated. Adds publishing.outbox_page() for the query and publishing.find_by_note_id() to look a post up by its Note's id (the two ActivityPub ids a post has - the wrapping Create's and the embedded Note's - were already generated independently in publish(); finding by the Note's id reuses the existing JSONB-path query pattern already established by activities.undo_block(), rather than adding a new column just for this lookup). GET /users/<u>/posts/<uuid> serves that Note for public and unlisted posts; followers-only and deleted posts 404 (they reach followers by delivery instead); a browser without an ActivityPub Accept is redirected to the UI post page unconditionally, before any lookup, matching actor()'s existing reasoning that a 404-vs-302 difference must never be usable to probe which posts exist. Documents both endpoints in federation/openapi.py and regenerates docs/openapi.json (test_every_api_route_is_documented already enforces this on every new federation route, so it can't wait for the docs step at the end of the phase). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
This commit is contained in:
1 parent
6fd028d108
commit
d4f3607eef
6 files changed
+308
-11
No files matched your search
+77
-2
@@ -2543,11 +2543,11 @@
|
||||
"ActivityPub"
|
||||
],
|
||||
"summary": "Outbox",
|
||||
"description": "The user's published activities.",
|
||||
"description": "The user's public and unlisted posts (followers-only posts are never listed here, since this endpoint isn't authenticated). Without `page`, an OrderedCollection pointing at the first page; with it, an OrderedCollectionPage of up to 20 `Create`s, newest first.",
|
||||
"operationId": "federation_outbox",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OrderedCollection",
|
||||
"description": "OrderedCollection or OrderedCollectionPage",
|
||||
"content": {
|
||||
"application/activity+json": {
|
||||
"schema": {
|
||||
@@ -2568,6 +2568,15 @@
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "page",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"schema": {
|
||||
"type": "integer",
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -2583,6 +2592,72 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"/users/{username}/posts/{post_uuid}": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"ActivityPub"
|
||||
],
|
||||
"summary": "Post",
|
||||
"description": "One public or unlisted post's `Note`, when asked for ActivityPub JSON; browsers are redirected to the web UI's post page. Followers-only and deleted posts answer 404 here (they're delivered directly to followers instead).",
|
||||
"operationId": "federation_post_note",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Note",
|
||||
"content": {
|
||||
"application/activity+json": {
|
||||
"schema": {
|
||||
"type": "object"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"302": {
|
||||
"description": "Redirect to the post page (non-ActivityPub Accept)"
|
||||
},
|
||||
"404": {
|
||||
"description": "Not found, not listed, or deleted"
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "username",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "post_uuid",
|
||||
"in": "path",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"in": "path",
|
||||
"name": "username",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"in": "path",
|
||||
"name": "post_uuid",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
"minLength": 1
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"/users/{username}/followers": {
|
||||
"get": {
|
||||
"tags": [
|
||||
|
||||
Reference in new issue
Block a user