matrix-org / matrix-org/matrix-spec
Identity service submitToken endpoints don't describe how errors work
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 330
- Forks
- 150
- Avg merge
- 2h 21m
- Merged PRs (30d)
- 3
Description
Link to problem area: https://matrix.org/docs/spec/identity_service/r0.3.0#post-matrix-identity-v2-validate-email-submittoken
Issue
Can https://matrix.org/docs/spec/identity_service/r0.3.0#post-matrix-identity-v2-validate-email-submittoken return success in any case, where the return code is not 200?
I.e. the check for success is just to ensure, you didn't get a different page because of some weird routing or so?
empirically it is meant to return a 200 error code with a standard error object: https://github.com/matrix-org/sydent/blob/443a4b26fa6ffe76a05b8fc6ca035536ffe332b2/sydent/http/servlets/emailservlet.py#L176-L199
unless it's an invalid
client_secret
$ curl -vs -X POST -H "Authorization: Bearer redacted" -H "Content-Type: application/json" --data '{"client_secret":"redacted","sid":"unknown","token":"wrong"}' https://vector.im/_matrix/identity/v2/validate/email/submitToken
{"success": false, "errcode": "M_INVALID_PARAM", "error": "The token doesn't match"}
..snip..
< HTTP/2 200
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Matrix identity service specification section for POST /_matrix/identity/v2/validate/email/submitToken, then compare its documented behavior with sydent/http/servlets/emailservlet.py around lines 176-199. Document whether invalid parameters return HTTP 200 with the standard error object and clarify the exception for an invalid client_secret.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- json
- Domain
- api, documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100