Remove unused AP C2S endpoints #749
No reviewers
Labels
No labels
approved, awaiting change
bug
configuration
documentation
duplicate
enhancement
extremely low priority
feature request
Fix it yourself
help wanted
invalid
mastodon_api
needs docs
needs tests
not a bug
planned
pleroma_api
privacy
question
static_fe
triage
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: AkkomaGang/akkoma#749
Loading…
Reference in a new issue
No description provided.
Delete branch "who-wants-to-yeet-c2s-i-want-to-yeet-c2s"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
basically removes the
POST
endpoints for AP C2S - keeps theGET
ones because they're sometimes used in S2S and you need it for the specAfaik C2S-exclusive API consists of
POST .../outbox
sorry, seems this can per spec be accessed even without C2S, provided it is filtered by perms (in either caseGET users/:nick/inbox
GET /inbox
, the shared inbox SHOULD be publicly readable regardless of C2S iiuc — but it appears this SHOULD isn’t implemented in the first place?)GET /api/ap/whoami/
to find out one’s own AP id (and from the own actor representation read out additional endpoints)POST /api/ap/upload_media
for uploading media in C2S; since its repsonse doesn’t contain a MastoAPImedia_id
it’s useless for anything but C2S writesNotably,
GET .../outbox
which was purged by the first and restored in the third commit is part of S2S.The third commit
also restoreddidn’t restore the read-only (albeit non-standard)GET /users/:nick/inbox
which afaik is C2S-exclusive, andwhoami
. It’s useless without C2S, but technically at odds with the commit message.With
/api/ap/upload_media
removed, we should laos stop filling out this field in our AP actor representation. Now, i would have said we probably should keep it in ourlitepub-0.1.jsonld
context to not break processing of stored older representations, but turns out it was never added here anyway ^^`A complete removal should probably also drop the
:activitypub_client
pipeline, but if you want to first test the waters here, leaving it for now probably makes sense to make a later revert easier in the unlikely case anyone actually relies on this incomplete C2S implementation (and steps up to take care of the necessary maintenance)[1]: eventhough Pleroma added extensions for C2S, its C2S implementation never implemented all parts required by spec
Correction:
GET /user/inbox
is mentioned in spec regardless of C2S, but must be filtered to account for who’s sending the request.In practice we just return HTTP 403 with either
{"error": "Invalid credentials"}
when accessed with no or well, invalid credentials and"can't read inbox of user1 as user2"
(note the lack of an enclosing JSON object) when trying to read someone else’s inbox.Meaning, in practice it’s currently kinda useless for anything but checking the own home feed.
If we go ahead with a complete C2S removal, it might be safe to (later) just stub it out to always reply with HTTP 403.
gonna run on IHBA to see if it breaks anything, but i think this is mostly finalized for an initial removal of c2s write endpoints to make sure nobody actually uses it
does not break anything, no 404s noted in logs, we good
planned for next release to remove any extra bits and pieces and remove the vestigial home-timeline-reading if this change doesn't upset anyone