forked from matrix-org/synapse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request matrix-org#7315 from matrix-org/babolivier…
- Loading branch information
1 parent
b451640
commit b99ae06
Showing
7 changed files
with
3 additions
and
121 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,22 +178,6 @@ def test_no_valid_token(self): | |
# Assert we can't log in with the new password | ||
self.attempt_wrong_password_login("kermit", new_password) | ||
|
||
@unittest.override_config({"request_token_inhibit_3pid_errors": True}) | ||
def test_password_reset_bad_email_inhibit_error(self): | ||
"""Test that triggering a password reset with an email address that isn't bound | ||
to an account doesn't leak the lack of binding for that address if configured | ||
that way. | ||
""" | ||
self.register_user("kermit", "monkey") | ||
self.login("kermit", "monkey") | ||
|
||
email = "[email protected]" | ||
|
||
client_secret = "foobar" | ||
session_id = self._request_token(email, client_secret) | ||
|
||
self.assertIsNotNone(session_id) | ||
|
||
def _request_token(self, email, client_secret): | ||
request, channel = self.make_request( | ||
"POST", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,11 +33,7 @@ | |
|
||
class RegisterRestServletTestCase(unittest.HomeserverTestCase): | ||
|
||
servlets = [ | ||
login.register_servlets, | ||
register.register_servlets, | ||
synapse.rest.admin.register_servlets, | ||
] | ||
servlets = [register.register_servlets] | ||
url = b"/_matrix/client/r0/register" | ||
|
||
def default_config(self, name="test"): | ||
|
@@ -264,47 +260,6 @@ def test_advertised_flows_no_msisdn_email_required(self): | |
[["m.login.email.identity"]], (f["stages"] for f in flows) | ||
) | ||
|
||
@unittest.override_config( | ||
{ | ||
"request_token_inhibit_3pid_errors": True, | ||
"public_baseurl": "https://test_server", | ||
"email": { | ||
"smtp_host": "mail_server", | ||
"smtp_port": 2525, | ||
"notif_from": "sender@host", | ||
}, | ||
} | ||
) | ||
def test_request_token_existing_email_inhibit_error(self): | ||
"""Test that requesting a token via this endpoint doesn't leak existing | ||
associations if configured that way. | ||
""" | ||
user_id = self.register_user("kermit", "monkey") | ||
self.login("kermit", "monkey") | ||
|
||
email = "[email protected]" | ||
|
||
# Add a threepid | ||
self.get_success( | ||
self.hs.get_datastore().user_add_threepid( | ||
user_id=user_id, | ||
medium="email", | ||
address=email, | ||
validated_at=0, | ||
added_at=0, | ||
) | ||
) | ||
|
||
request, channel = self.make_request( | ||
"POST", | ||
b"register/email/requestToken", | ||
{"client_secret": "foobar", "email": email, "send_attempt": 1}, | ||
) | ||
self.render(request) | ||
self.assertEquals(200, channel.code, channel.result) | ||
|
||
self.assertIsNotNone(channel.json_body.get("sid")) | ||
|
||
|
||
class AccountValidityTestCase(unittest.HomeserverTestCase): | ||
|
||
|