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

v2_alpha /register fixes for Application Services #210

Merged
merged 2 commits into from Jul 29, 2015

Conversation

kegsay
Copy link
Member

@kegsay kegsay commented Jul 29, 2015

Application services currently do not work with v2_alpha /register endpoints as the logic to determine if they can register was wrong. In addition, v2_alpha forced ASes to specify a password for their virtual clients, when it should be possible to register without a password.

This PR fixes these issues and tidies up the synapse/rest/client/v2_alpha/register.py in general. This tidying up mainly involved re-shuffling the on_POST logic to fork off to shared secret/AS logic ASAP so the bulk of the method remains purely for "normal" user logic. Previously, we were branching all over the method depending on is_application_server or is_using_shared_secret. I've also taken the liberty of adding some unit tests for this file.

I've also done the following manual tests:

  • Make sure ASes can register.
  • Make sure ASes can register if enable_registration: false
  • Make sure normal users cannot register if enable_registration: false
  • Make sure normal users can register (no captcha, no email)
  • Make sure normal users can register (with captcha, no email)
  • Make sure normal users can register (no captcha, with email)
  • Make sure normal users can register (with captcha, with email)

V2 Registration forced everyone (including ASes) to create a password for a
user, when ASes should be able to omit passwords. Also unbreak AS registration
in general which checked too early if the given username was claimed by an AS;
it was checked before knowing if the AS was the one doing the registration! Add
unit tests for AS reg, user reg and disabled_registration flag.
Namely this means using registration_handler.appservice_register.
@dbkr
Copy link
Member

dbkr commented Jul 29, 2015

LGTM

dbkr added a commit that referenced this pull request Jul 29, 2015
v2_alpha /register fixes for Application Services
@dbkr dbkr merged commit 2c96305 into develop Jul 29, 2015
@erikjohnston erikjohnston deleted the reg-v2a-password-skip branch September 10, 2015 09:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants