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

Make sure we advertise registration as disabled when MSC3861 is enabled #17661

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Sep 4, 2024

This has been a problem with Element Web, as it will proble /register with an empty body, which gave this error:

curl -d '{}' -HContent-Type:application/json /_matrix/client/v3/register

{"errcode": "M_UNKNOWN",
 "error": "Invalid username"}

And Element Web would choke on it. This changes that so we reply instead:

{"errcode": "M_FORBIDDEN",
 "error": "Registration has been disabled. Only m.login.application_service registrations are allowed."}

Also adds a test for this.

See element-hq/element-web#27993

@sandhose sandhose requested a review from a team as a code owner September 4, 2024 09:41
Copy link
Member

@anoadragon453 anoadragon453 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code change looks fine. Could you point to where in the MSCs it says this endpoint should return an errcode of M_FORBIDDEN?

Comment on lines +640 to +644
self.expect_forbidden(
"POST",
"/_matrix/client/v3/register",
{"username": "alice", "password": "hunter2"},
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a test that checks that this endpoint still returns a 200 when an AS attempts to register a user?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants