Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add a way to register the lower-case version of a conflicting MXID #15931

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

MadLittleMods
Copy link
Contributor

@MadLittleMods MadLittleMods commented Jul 13, 2023

This isn't meant to merge to main-line and is just a one-off fix so I can register a specific user.


Add a way to register the lower-case version of a conflicting MXID.

Basically, if you have @Foo:matrix.org already registered, this will allow you register @foo:matrix.org

poetry run register_new_matrix_user --inhibit_user_in_use_error 1 -c homeserver.yaml

Fix #11426


inhibit_user_in_use_error is already a homeserver configuration option but only applies to the username availability endpoint. This change makes it possible to configure the option when using the admin API to register a user.

Testing strategy

  1. Add a conflicting user psql --user postgres synapse
    INSERT INTO users
        (name, password_hash, creation_ts, is_guest, admin, shadow_banned, approved)
    VALUES
        ('@test-COLLISION-user:my.synapse.linux.server', 'fake-password-hash', 1689216488, 0, 0, False, True);
  2. poetry run register_new_matrix_user --inhibit_user_in_use_error 1 -c homeserver.yaml
    • Enter test-collision-user and whatever data for the rest
  3. Notice the Success! message

Pull Request Checklist

@MadLittleMods MadLittleMods added the A-Registration Creating an account label Jul 13, 2023
@dklimpel
Copy link
Contributor

@@ -44,10 +44,18 @@ def request_registration(
shared_secret: str,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix it? #11426

@dklimpel I think it would! (didn't know about the issue)

I think the current solution muddies the water a bit with inhibit_user_in_use_error which is a configuration setting normally only for the registration availability endpoint. And using the same name for registration makes the landscape a bit more confusing and complex imo which is why I put a disclaimer that this is just meant as a one-off.

Changing the name of the option is probably all that is needed. Maybe something like allow_conflicting_mxid

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Registration Creating an account
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the Admin API to create a user where the same localpart exists with uppercase letters
2 participants