matrix-org / matrix-org/matrix-spec

Identity service submitToken endpoints don't describe how errors work

Open
#916 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-Identity-Service clarification
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

https://matrix.to/#/!NasysSDfxKxZBzJJoE:matrix.org/$WLw58DvFB8aWuF3vyWPXIBY3w_lyRtuwM8uk3-DQkJs?via=matrix.org&via=libera.chat&via=envs.net

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.