Repository navigation
MSC4369: M_CAPABILITY_NOT_ENABLED error code for when capability is not enabled on an API endpoint - #4369
MSC4369: M_CAPABILITY_NOT_ENABLED error code for when capability is not enabled on an API endpoint#4369hughns wants to merge 8 commits into
Conversation
…d on an API endpoint
|
|
||
| ## Proposal | ||
|
|
||
| Define a new [other error code] of `M_CAPABILITY_NOT_ENABLED`. |
There was a problem hiding this comment.
Is there any value in having a specific error code for this? Clients should already know which endpoint is behind a capability, so M_FORBIDDEN should work just as well.
Actually I am wondering if instead of returning 403, it wouldn't be simpler to return 404 with M_UNRECOGNIZED, as if the endpoint is unimplemented?
This means that the endpoint doesn't actually have to be implemented by the homeserver if it doesn't support this capability (like POST /_matrix/client/v3/account/password which is useless if the homeserver only supports the OAuth 2.0 API for authentication), rather than forcing the homeserver to support this endpoint, only to return a specific error.
There was a problem hiding this comment.
I agree. I tried to think of it as a clearer way to signal why the call doesn't succeed; but actually, the proposed change to M_CAPABILITY_NOT_ENABLED when m.profile_fields.disallowed has a given profile field is confusing: if something is disallowed then M_FORBIDDEN is a natural return code for it, is it not?
I believe the spec could still do with a recommendation in "Capabilities negotiation" to use 404 M_UNRECOGNIZED or 403 M_FORBIDDEN (and bikeshed elaborate when to use which).
|
@hughns apologies for having this sit on my queue for so long. Is this still something you'd like to pursue? |
I am motivated to resolve this lack of clarity - around what the server should return if the capability is not available but is attempted anyway - in the spec one way or another. I'm not opposed to @zecakeh's comment about re-using existing codes if that feels like a better fit. |
Rendered
I am employed by Element to write this MSC. Hence the use of the
io.elementnamespace in the unstable values.