Commit graph

14252 commits

Author SHA1 Message Date
Andrew Morgan
ad4e2ed2ca Add changelog 2019-06-06 16:38:28 +01:00
Andrew Morgan
5d6e3a2c83 Remove debug logging and make diff nicer 2019-06-06 16:38:18 +01:00
Andrew Morgan
22e4dfa7f0 lint 2019-06-06 16:14:15 +01:00
Andrew Morgan
96f43fe81d Fix typo and logic issue 2019-06-06 16:12:57 +01:00
Andrew Morgan
78a8992661 We don't support msisdn, geddit? 2019-06-06 16:07:21 +01:00
Andrew Morgan
2796afc188 Fix checkers, remove debug logging 2019-06-06 16:03:10 +01:00
Andrew Morgan
9e743c7069 Make servlet clearer 2019-06-06 15:56:06 +01:00
Andrew Morgan
3b0a477db3 Fix bugs with database 2019-06-06 15:53:40 +01:00
Andrew Morgan
25af3f96c6 Fix clientip bug 2019-06-06 15:22:22 +01:00
Andrew Morgan
1460f14c66 lint 2019-06-06 15:16:14 +01:00
Andrew Morgan
6d7890401b Merge branch 'anoa/feature_hs_password_resets' into anoa/hs_password_reset 2019-06-06 15:15:50 +01:00
Andrew Morgan
1fd217c7cb update endpoint 2019-06-06 15:11:16 +01:00
Andrew Morgan
8dba4bab44
Send password reset from HS: Sending the email (#5345)
* Ability to send password reset emails

This changes the default behaviour of Synapse to send password reset
emails itself rather than through an identity server. The reasoning
behind the change is to prevent a malicious identity server from
being able to initiate a password reset attempt and then answering
it, successfully resetting their password, all without the user's
knowledge. This also aides in decentralisation by putting less
trust on the identity server itself, which traditionally is quite
centralised.

If users wish to continue with the old behaviour of proxying
password reset requests through the user's configured identity
server, they can do so by setting
email.enable_password_reset_from_is to True in Synapse's config.

Users should be able that with that option disabled (the default),
password resets will now no longer work unless email sending has
been enabled and set up correctly.

* Fix validation token lifetime email_ prefix

* Add changelog

* Update manifest to include txt/html template files

* Update db

* mark jinja2 and bleach as required dependencies

* Add email settings to default unit test config

* Update unit test template dir

* gen sample config

* Add html5lib as a required dep

* Modify check for smtp settings to be kinder to CI

* silly linting rules

* Correct html5lib dep version number

* one more time

* Change template_dir to originate from synapse root dir

* Revert "Modify check for smtp settings to be kinder to CI"

This reverts commit 6d2d3c9fd3.

* Move templates. New option to disable password resets

* Update templates and make password reset option work

* Change jinja2 and bleach back to opt deps

* Update email condition requirement

* Only import jinja2/bleach if we need it

* Update sample config

* Revert manifest changes for new res directory

* Remove public_baseurl from unittest config

* infer ability to reset password from email config

* Address review comments

* regen sample config

* test for ci

* Remove CI test

* fix bug?

* Run bg update on the master process
2019-06-06 15:04:47 +01:00
Andrew Morgan
fa2794405d Merge branch 'anoa/hs_password_reset_sending_email' into anoa/hs_password_reset 2019-06-06 14:56:14 +01:00
Andrew Morgan
828cdbbcd8 Run bg update on the master process 2019-06-06 14:54:59 +01:00
Andrew Morgan
f7395bbd0a Move endpoint to _synapse 2019-06-06 14:52:00 +01:00
Andrew Morgan
1a796cbd38 Merge branch 'anoa/hs_password_reset_sending_email' into anoa/hs_password_reset 2019-06-06 14:38:08 +01:00
Andrew Morgan
7168dee695 fix bug? 2019-06-06 14:36:13 +01:00
Andrew Morgan
92090d32d4 Remove CI test 2019-06-06 14:27:41 +01:00
Andrew Morgan
cd4f4a2ab4 test for ci 2019-06-06 14:23:43 +01:00
Andrew Morgan
a37a2f13cf regen sample config 2019-06-06 14:17:56 +01:00
Andrew Morgan
3478213392 Address review comments 2019-06-06 14:16:24 +01:00
Andrew Morgan
9d5f75f3d8 regen sample config 2019-06-06 11:14:45 +01:00
Andrew Morgan
ddc219578b fix merge issue 2019-06-06 11:10:09 +01:00
Andrew Morgan
1dcf4eb344 Merge branch 'anoa/hs_password_reset_sending_email' into anoa/hs_password_reset 2019-06-06 11:08:20 +01:00
Andrew Morgan
d8d198fbd3 Add changelog 2019-06-06 10:09:15 +01:00
Andrew Morgan
ec781af214 Reimplementation of /submitToken on the homeserver side. Only used by password resets
This PR creates an endpoint GET/POST /_matrix/identity/api/v1/validate/email/submitToken
which mirrors the same endpoint on the identity server used for submitting tokens
used for validating 3PID addresses.

When the token is submitted, it is checked along with the client_secret and session_id in
the db and if it matches and isn't expired, we mark the session as validated. Then, when
the user attempts to change their password, we check if the session is valid, and if so
allow it. We also delete the session at this point, as as far as I can tell there's no
further use for it.
2019-06-06 10:04:28 +01:00
Andrew Morgan
6efb301e05 infer ability to reset password from email config 2019-06-05 18:08:23 +01:00
Andrew Morgan
12ed769fbf Remove public_baseurl from unittest config 2019-06-05 17:41:24 +01:00
Andrew Morgan
78ca92a9b2 Revert manifest changes for new res directory 2019-06-05 17:38:46 +01:00
Andrew Morgan
6a9588cc60 Update sample config 2019-06-05 17:37:50 +01:00
Andrew Morgan
efa1a56552 Only import jinja2/bleach if we need it 2019-06-05 17:27:52 +01:00
Andrew Morgan
a4c0907b84 Update email condition requirement 2019-06-05 17:15:14 +01:00
Andrew Morgan
f522cde541 Change jinja2 and bleach back to opt deps 2019-06-05 17:11:04 +01:00
Andrew Morgan
79bc66883f Update templates and make password reset option work 2019-06-05 16:53:28 +01:00
Andrew Morgan
70b161decc Move templates. New option to disable password resets 2019-06-05 16:36:02 +01:00
Andrew Morgan
4c406f5afc Revert "Modify check for smtp settings to be kinder to CI"
This reverts commit 6d2d3c9fd3.
2019-06-05 15:13:23 +01:00
Andrew Morgan
c9573ca069 Change template_dir to originate from synapse root dir 2019-06-05 15:13:03 +01:00
Andrew Morgan
91eac880a1 one more time 2019-06-05 14:56:46 +01:00
Andrew Morgan
fe0af298ff Correct html5lib dep version number 2019-06-05 14:33:13 +01:00
Andrew Morgan
639471582c silly linting rules 2019-06-05 14:11:25 +01:00
Andrew Morgan
6d2d3c9fd3 Modify check for smtp settings to be kinder to CI 2019-06-05 13:56:42 +01:00
Andrew Morgan
177f02459a Add html5lib as a required dep 2019-06-05 13:46:21 +01:00
Andrew Morgan
752dbeea70 Merge branch 'anoa/feature_hs_password_resets' into anoa/hs_password_reset_sending_email 2019-06-05 13:37:56 +01:00
Andrew Morgan
a862f2adc4 gen sample config 2019-06-05 13:36:56 +01:00
Andrew Morgan
a0e2a103a6 Update unit test template dir 2019-06-05 13:33:37 +01:00
Andrew Morgan
24f31dfb59
Send password reset from HS: database stuff (#5308)
Database component of new behaviour of sending password reset emails from Synapse instead of Sydent.

Allows one to store threepid validation sessions along with password reset token attempts and retrieve them again.
2019-06-05 13:29:39 +01:00
Andrew Morgan
62e1ec098c Add email settings to default unit test config 2019-06-05 13:17:20 +01:00
Andrew Morgan
354d749ae1 mark jinja2 and bleach as required dependencies 2019-06-05 13:02:46 +01:00
Andrew Morgan
309943f2ef Update db 2019-06-05 12:55:51 +01:00