Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent responses on inbox methods #38

Open
fauno opened this issue Feb 5, 2024 · 4 comments
Open

Inconsistent responses on inbox methods #38

fauno opened this issue Feb 5, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@fauno
Copy link
Collaborator

fauno commented Feb 5, 2024

While working on the Inbox client I've noticed this:

Method Path Status code Content Type Response
GET /v1/:actor/inbox 403 text/plain "Not allowed"
GET /v1/:actor/inbox 200 application/json; charset=utf-8 APOrderedCollection
POST /v1/:actor/inbox 400 application/json; charset=utf-8 {"statusCode"=>400, "error"=>"Unauthorized", "message"=>"Must specify 'actor' URL in activity" }
POST /v1/:actor/inbox 403 application/json; charset=utf-8 {"statusCode"=>403, "error"=>"Forbidden", "message"=>"Submitted activity must be from signed actor [...]"}
POST /v1/:actor/inbox 200 text/plain 1 { "message": "ok" }
DELETE /v1/:actor/inbox/:id 403 text/plain "Not allowed"
DELETE /v1/:actor/inbox/:id 200 text/plain "ok"
POST /v1/:actor/inbox/:id 403 text/plain "Not allowed"
POST /v1/:actor/inbox/:id 200 text/plain "ok"

https://www.w3.org/TR/activitypub/ doesn't say much about status codes, I see Mastodon just replies 202 Accepted2 for every case with an empty response while receiving an activity.

Could we make all errors return a JSON object and AP content type? I'd change the three status codes for remote instances to 202, which doesn't make any promise about the request, just in case someone expects it to be exactly this number.

Footnotes

  1. I'll need time to produce all errors, so I read inbox.ts instead. The default response type for this request is set to string.

  2. Wikipedia: The request has been accepted for processing, but the processing has not been completed. The request might or might not be eventually acted upon, and may be disallowed when processing occurs.

@fauno fauno added the enhancement New feature or request label Feb 5, 2024
@fauno fauno moved this from Needs triage to Feedback Required in Distributed Press Organizing Feb 5, 2024
@sutty-coop sutty-coop added question Further information is requested and removed enhancement New feature or request labels Feb 6, 2024
@sutty-coop
Copy link
Collaborator

Is this question for @RangerMauve or for @akhileshthite ?

@fauno
Copy link
Collaborator Author

fauno commented Feb 27, 2024

Is this question for @RangerMauve or for @akhileshthite ?

unsure! any of both i guess

@RangerMauve
Copy link
Contributor

Personally I think I'd prefer the text/plain responses instead of the json one.

@sutty-coop sutty-coop moved this from Feedback Required to Backlog in Distributed Press Organizing Mar 6, 2024
@fauno
Copy link
Collaborator Author

fauno commented Mar 14, 2024

I got an [object object] while working with the allowlist :D

@fauno fauno added enhancement New feature or request and removed question Further information is requested labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

3 participants