From 7ae9689d511752b42350e2142498620b488a880b Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Fri, 16 Apr 2021 08:02:28 +0200 Subject: [PATCH 01/11] Add cache volume for quicker tests --- dendrite-template.sh | 19 +++++++++++++++++++ docker/build-dendrite.amd64.sh | 9 +++++++++ docker/build-dendrite.arm64.sh | 9 +++++++++ docker/dendrite.Dockerfile | 5 ++++- 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 dendrite-template.sh create mode 100644 docker/build-dendrite.amd64.sh create mode 100644 docker/build-dendrite.arm64.sh diff --git a/dendrite-template.sh b/dendrite-template.sh new file mode 100644 index 000000000..540271c58 --- /dev/null +++ b/dendrite-template.sh @@ -0,0 +1,19 @@ +# Respective volumes: +# 1. cloned https://github.com/matrix-org/sytest repo location +# 2. cloned https://github.com/matrix-org/dendrite repo locatopn +# 3. directory for tests logs +# 4. used not to download packages each time +# 5. build cache, speeds up binaries build +# Envs: +# for env configuration, refer to https://github.com/matrix-org/dendrite/blob/master/docs/sytest.md +# Args: +# choosing test to run as last argument + +docker run --rm \ +-v "/Users/piotrkozimor/repos/sytest:/sytest" \ +-v "/Users/piotrkozimor/repos/dendrite:/src" \ +-v "/Users/piotrkozimor/logs:/logs" \ +-v "/Users/piotrkozimor/go/:/gopath" \ +-v "/Users/piotrkozimor/go-build/:/go-build" \ +-e "POSTGRES=1" -e "DENDRITE_TRACE_HTTP=1" \ +matrixdotorg/sytest-dendrite:latest tests/11register.pl \ No newline at end of file diff --git a/docker/build-dendrite.amd64.sh b/docker/build-dendrite.amd64.sh new file mode 100644 index 000000000..60de23fcd --- /dev/null +++ b/docker/build-dendrite.amd64.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +set -ex + +cd $(dirname $0) + +docker build --pull ../ -f base.Dockerfile --build-arg BASE_IMAGE=debian:buster -t matrixdotorg/sytest:buster + +docker build ../ -f dendrite.Dockerfile --build-arg SYTEST_IMAGE_TAG=buster -t matrixdotorg/sytest-dendrite:go113 -t matrixdotorg/sytest-dendrite:latest diff --git a/docker/build-dendrite.arm64.sh b/docker/build-dendrite.arm64.sh new file mode 100644 index 000000000..8cd3ee194 --- /dev/null +++ b/docker/build-dendrite.arm64.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +set -ex + +cd $(dirname $0) + +docker build --pull ../ -f base.Dockerfile --build-arg BASE_IMAGE=debian:buster -t matrixdotorg/sytest:buster + +docker build ../ -f dendrite.Dockerfile --build-arg SYTEST_IMAGE_TAG=buster --build-arg ARCH=arm64 -t matrixdotorg/sytest-dendrite:go113 -t matrixdotorg/sytest-dendrite:latest diff --git a/docker/dendrite.Dockerfile b/docker/dendrite.Dockerfile index 411492330..38ef1ea24 100644 --- a/docker/dendrite.Dockerfile +++ b/docker/dendrite.Dockerfile @@ -2,14 +2,17 @@ ARG SYTEST_IMAGE_TAG=buster FROM matrixdotorg/sytest:${SYTEST_IMAGE_TAG} ARG GO_VERSION=1.13.7 -ENV GO_DOWNLOAD https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz +ARG ARCH=amd64 +ENV GO_DOWNLOAD https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz RUN mkdir -p /goroot /gopath +RUN mkdir /go-build RUN wget -q $GO_DOWNLOAD -O go.tar.gz RUN tar xf go.tar.gz -C /goroot --strip-components=1 ENV GOROOT=/goroot ENV GOPATH=/gopath ENV PATH="/goroot/bin:${PATH}" +ENV GOCACHE=/go-build # This is where we expect Dendrite to be binded to from the host RUN mkdir -p /src From f7756c3ea7924f65513bc0331ee7c35a85e16ad9 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Fri, 16 Apr 2021 08:03:17 +0200 Subject: [PATCH 02/11] Test register using an email address via identity server --- README.dendrite.md | 4 + lib/SyTest/Homeserver/Dendrite.pm | 13 +++ lib/SyTest/Identity/Server.pm | 12 +++ tests/11register.pl | 128 +++++++++++++++++++++++++++++- 4 files changed, 155 insertions(+), 2 deletions(-) create mode 100644 README.dendrite.md diff --git a/README.dendrite.md b/README.dendrite.md new file mode 100644 index 000000000..cdc7727dc --- /dev/null +++ b/README.dendrite.md @@ -0,0 +1,4 @@ +1. Navigate to docker folder and run build-dendrite.{arch}.sh depending on your architecture. +2. Navigate back and edit dendrite-template.sh file. +3. Run script. +4. Investigate logs directory (mounted as 3rd volume) and script output. diff --git a/lib/SyTest/Homeserver/Dendrite.pm b/lib/SyTest/Homeserver/Dendrite.pm index 9e22083d8..068048bfd 100644 --- a/lib/SyTest/Homeserver/Dendrite.pm +++ b/lib/SyTest/Homeserver/Dendrite.pm @@ -130,6 +130,19 @@ sub _get_config }, client_api => { + registration => { + flows => [ + { + stages => [ + "m.login.email.identity", + ] + }, + { + stages => [ + "m.login.dummy" + ] + }] + }, database => { connection_string => ( ! defined $ENV{'POSTGRES'} || $ENV{'POSTGRES'} == '0') ? diff --git a/lib/SyTest/Identity/Server.pm b/lib/SyTest/Identity/Server.pm index 15ed74fe1..3ddf243a2 100644 --- a/lib/SyTest/Identity/Server.pm +++ b/lib/SyTest/Identity/Server.pm @@ -573,6 +573,18 @@ sub on_bind $req->respond_json( \%resp ); } +sub validate_email +{ + my $self = shift; + my ( $address, $client_secret ) = @_; + my $sid = "session_${\ $self->{sid}++ }"; + $self->{validated}{$sid} = { + medium => "email", + address => $address, + }; + return $sid; +} + =head2 on_unbind $server->on_unbind( $req ); diff --git a/tests/11register.pl b/tests/11register.pl index 3463ba84e..ec9af6557 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -69,6 +69,56 @@ sub validate_email { } push our @EXPORT, qw( validate_email ); + +=head2 validate_email_on_id_server + + validate_email_on_id_server( + $http, $address, + id_server => $id_server, + path => "/r0/account/3pid/email/requestToken", + )->then( sub { + my ( $sid, $client_secret ) = @_; + }); + +Runs through a `.../requestToken` flow specified by $path for verifying that an email address +belongs to the user. Doesn't add the address to the account. + +Returns the session id and client secret which can then be used for binding the address. + +=cut + +sub validate_email_on_id_server { + my ( $http, $address, %params ) = @_; + + my $client_secret = gen_client_secret(); + my $sid; + + return Future->needs_all( + await_id_validation_email( $params{id_server}, $address), + + $http->do_request_json( + method => "POST", + uri => $params{path}, + content => { + client_secret => $client_secret, + email => $address, + send_attempt => 1, + id_server => $params{id_server}->name, + id_access_token => $params{id_server}->get_access_token(), + }, + )->then( sub { + my ( $resp ) = @_; + log_if_fail "requestToken response", $resp; + + $sid = $resp->{sid}; + Future->done; + }), + )->then( sub { + Future->done( $sid, $client_secret ); + }); +} +push our @EXPORT, qw( validate_email_on_id_server ); + =head2 validate_msisdn validate_msisdn( @@ -157,7 +207,7 @@ sub await_id_validation_email { my ( $id_server, $address ) = @_; $id_server->await_request( - path=>"/_matrix/identity/api/v1/validate/email/requestToken", + path=>"/_matrix/identity/v2/validate/email/requestToken", )->then( sub { my ( $req ) = @_; my $body = $req->body_from_json; @@ -679,7 +729,7 @@ sub add_email_for_user { auth => { type => "m.login.email.identity", session => $body->{session}, - threepid_creds => { + threepid_creds => { sid => $sid_email, client_secret => $client_secret, }, @@ -698,3 +748,77 @@ sub add_email_for_user { }); }; +test "Can register using an email address via identity server", + requires => [ $main::API_CLIENTS[0], localpart_fixture(), id_server_fixture() ], + + do => sub { + my ( $http, $localpart, $id_server ) = @_; + + my $email_address = 'testemail@example.com'; + + $http->do_request_json( + method => "POST", + uri => "/r0/register", + + content => { + username => $localpart, + password => "noobers3kr1t", + device_id => "xyzzy", + }, + )->main::expect_http_401->then( sub { + my ( $response ) = @_; + + my $body = decode_json $response->content; + + assert_json_keys( $body, qw( session flows )); + + log_if_fail "No single m.login.email.identity stage registration flow found", $body; + + # Check that one of the flows' stages contains an "m.login.email.identity" stage + my $has_flow; + foreach my $idx ( 0 .. $#{ $body->{flows} } ) { + my $flow = $body->{flows}[$idx]; + my $stages = $flow->{stages} || []; + + $has_flow++ if + @$stages == 1 && $stages->[0] eq "m.login.email.identity"; + } + + assert_eq( $has_flow, 1, "hasFlow" ); + + validate_email_on_id_server( + $http, + $email_address, + id_server => $id_server, + path => "/r0/register/email/requestToken", + )->then( sub { + my ( $sid_email, $client_secret ) = @_; + + # attempt to register with the 3pid + $http->do_request_json( + method => "POST", + uri => "/r0/register", + content => { + auth => { + type => "m.login.email.identity", + session => $body->{session}, + threepidCreds => { + sid => $sid_email, + client_secret => $client_secret, + id_server => $id_server->name, + id_access_token => "foobar", + }, + }, + username => $localpart, + password => "noobers3kr1t", + device_id => "xyzzy", + }, + ) + }) + })->then( sub { + my ( $body ) = @_; + + assert_json_keys( $body, qw( user_id home_server ) ); + Future->done( 1 ); + }); + }; From 0b47dd8a748a93229289df8b08761b5fc53d87d4 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Tue, 20 Apr 2021 08:38:48 +0200 Subject: [PATCH 03/11] Use validate_identity subroutine for email confirmation --- lib/SyTest/Identity/Server.pm | 13 +------------ tests/11register.pl | 4 ++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lib/SyTest/Identity/Server.pm b/lib/SyTest/Identity/Server.pm index 3ddf243a2..8ff3904fc 100644 --- a/lib/SyTest/Identity/Server.pm +++ b/lib/SyTest/Identity/Server.pm @@ -260,7 +260,7 @@ sub validate_identity { my $self = shift; my ( $medium, $address, $client_secret ) = @_; - + my $sid = "session_${\ $self->{sid}++ }"; $self->{validated}{$sid} = { @@ -573,17 +573,6 @@ sub on_bind $req->respond_json( \%resp ); } -sub validate_email -{ - my $self = shift; - my ( $address, $client_secret ) = @_; - my $sid = "session_${\ $self->{sid}++ }"; - $self->{validated}{$sid} = { - medium => "email", - address => $address, - }; - return $sid; -} =head2 on_unbind diff --git a/tests/11register.pl b/tests/11register.pl index ec9af6557..4081d3041 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -214,7 +214,7 @@ sub await_id_validation_email { log_if_fail "ID server email /requestToken request", $body; assert_eq( $body->{email}, $address ); - my $sid = $id_server->validate_email( $address, $body->{client_secret} ); + my $sid = $id_server->validate_identity("email", $address, $body->{client_secret} ); $req->respond_json({ sid => $sid, }); @@ -817,7 +817,7 @@ sub add_email_for_user { }) })->then( sub { my ( $body ) = @_; - + assert_json_keys( $body, qw( user_id home_server ) ); Future->done( 1 ); }); From fc45e81aef9de030e2d23b03ea99873af6a0912c Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Wed, 21 Apr 2021 12:48:04 +0200 Subject: [PATCH 04/11] Switch to v1 api for mocking requestsToken --- tests/11register.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/11register.pl b/tests/11register.pl index 4081d3041..c4b7127e9 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -207,7 +207,7 @@ sub await_id_validation_email { my ( $id_server, $address ) = @_; $id_server->await_request( - path=>"/_matrix/identity/v2/validate/email/requestToken", + path=>"/_matrix/identity/api/v1/validate/email/requestToken", )->then( sub { my ( $req ) = @_; my $body = $req->body_from_json; @@ -756,6 +756,9 @@ sub add_email_for_user { my $email_address = 'testemail@example.com'; + + # print "\n\n$BIND_HOST\n\n\n"; + # print "\n\n${id_server->name}\n\n\n"; $http->do_request_json( method => "POST", uri => "/r0/register", @@ -817,7 +820,7 @@ sub add_email_for_user { }) })->then( sub { my ( $body ) = @_; - + assert_json_keys( $body, qw( user_id home_server ) ); Future->done( 1 ); }); From 77b022c4ebaaf44834062f54ac87195702a2c4a0 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Wed, 21 Apr 2021 12:49:07 +0200 Subject: [PATCH 05/11] Identity mock server listen on port 34586 --- lib/SyTest/Homeserver/Dendrite.pm | 5 ++++- run-tests.pl | 1 + tests/07id-server.pl | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/SyTest/Homeserver/Dendrite.pm b/lib/SyTest/Homeserver/Dendrite.pm index 068048bfd..b61ae3569 100644 --- a/lib/SyTest/Homeserver/Dendrite.pm +++ b/lib/SyTest/Homeserver/Dendrite.pm @@ -100,7 +100,9 @@ sub _get_config global => { server_name => $self->server_name, private_key => $self->{paths}{matrix_key}, - + trusted_third_party_id_servers => [ + "localhost:34586", + ], kafka => { use_naffka => $JSON::true, naffka_database => { @@ -130,6 +132,7 @@ sub _get_config }, client_api => { + custom_ca_path => "/sytest/keys/tls-selfsigned.crt", registration => { flows => [ { diff --git a/run-tests.pl b/run-tests.pl index 92c7e34e3..561e2d12e 100755 --- a/run-tests.pl +++ b/run-tests.pl @@ -54,6 +54,7 @@ binmode(STDOUT, ":utf8"); our $BIND_HOST = "localhost"; +our $ID_SERVER_PORT = 34586; # a unique ID for this test run. It is used in some tests to create user IDs # and the like. diff --git a/tests/07id-server.pl b/tests/07id-server.pl index 66b684840..b4d1cdaf2 100644 --- a/tests/07id-server.pl +++ b/tests/07id-server.pl @@ -17,8 +17,8 @@ sub id_server_fixture $loop->add( $id_server ); $id_server->listen( - host => $BIND_HOST, - service => "", + host => "$BIND_HOST", + service => $ID_SERVER_PORT, extensions => [qw( SSL )], # Synapse currently only talks IPv4 family => "inet", From 25ea2bf879b116ebe6dba4996f4bedfa56205023 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Wed, 21 Apr 2021 13:07:19 +0200 Subject: [PATCH 06/11] Cleanup dev scripts --- README.dendrite.md | 4 ---- dendrite-template.sh | 19 ------------------- docker/build-dendrite.amd64.sh | 9 --------- docker/build-dendrite.arm64.sh | 9 --------- docker/dendrite.Dockerfile | 5 +---- 5 files changed, 1 insertion(+), 45 deletions(-) delete mode 100644 README.dendrite.md delete mode 100644 dendrite-template.sh delete mode 100644 docker/build-dendrite.amd64.sh delete mode 100644 docker/build-dendrite.arm64.sh diff --git a/README.dendrite.md b/README.dendrite.md deleted file mode 100644 index cdc7727dc..000000000 --- a/README.dendrite.md +++ /dev/null @@ -1,4 +0,0 @@ -1. Navigate to docker folder and run build-dendrite.{arch}.sh depending on your architecture. -2. Navigate back and edit dendrite-template.sh file. -3. Run script. -4. Investigate logs directory (mounted as 3rd volume) and script output. diff --git a/dendrite-template.sh b/dendrite-template.sh deleted file mode 100644 index 540271c58..000000000 --- a/dendrite-template.sh +++ /dev/null @@ -1,19 +0,0 @@ -# Respective volumes: -# 1. cloned https://github.com/matrix-org/sytest repo location -# 2. cloned https://github.com/matrix-org/dendrite repo locatopn -# 3. directory for tests logs -# 4. used not to download packages each time -# 5. build cache, speeds up binaries build -# Envs: -# for env configuration, refer to https://github.com/matrix-org/dendrite/blob/master/docs/sytest.md -# Args: -# choosing test to run as last argument - -docker run --rm \ --v "/Users/piotrkozimor/repos/sytest:/sytest" \ --v "/Users/piotrkozimor/repos/dendrite:/src" \ --v "/Users/piotrkozimor/logs:/logs" \ --v "/Users/piotrkozimor/go/:/gopath" \ --v "/Users/piotrkozimor/go-build/:/go-build" \ --e "POSTGRES=1" -e "DENDRITE_TRACE_HTTP=1" \ -matrixdotorg/sytest-dendrite:latest tests/11register.pl \ No newline at end of file diff --git a/docker/build-dendrite.amd64.sh b/docker/build-dendrite.amd64.sh deleted file mode 100644 index 60de23fcd..000000000 --- a/docker/build-dendrite.amd64.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/env bash - -set -ex - -cd $(dirname $0) - -docker build --pull ../ -f base.Dockerfile --build-arg BASE_IMAGE=debian:buster -t matrixdotorg/sytest:buster - -docker build ../ -f dendrite.Dockerfile --build-arg SYTEST_IMAGE_TAG=buster -t matrixdotorg/sytest-dendrite:go113 -t matrixdotorg/sytest-dendrite:latest diff --git a/docker/build-dendrite.arm64.sh b/docker/build-dendrite.arm64.sh deleted file mode 100644 index 8cd3ee194..000000000 --- a/docker/build-dendrite.arm64.sh +++ /dev/null @@ -1,9 +0,0 @@ -#! /usr/bin/env bash - -set -ex - -cd $(dirname $0) - -docker build --pull ../ -f base.Dockerfile --build-arg BASE_IMAGE=debian:buster -t matrixdotorg/sytest:buster - -docker build ../ -f dendrite.Dockerfile --build-arg SYTEST_IMAGE_TAG=buster --build-arg ARCH=arm64 -t matrixdotorg/sytest-dendrite:go113 -t matrixdotorg/sytest-dendrite:latest diff --git a/docker/dendrite.Dockerfile b/docker/dendrite.Dockerfile index 38ef1ea24..411492330 100644 --- a/docker/dendrite.Dockerfile +++ b/docker/dendrite.Dockerfile @@ -2,17 +2,14 @@ ARG SYTEST_IMAGE_TAG=buster FROM matrixdotorg/sytest:${SYTEST_IMAGE_TAG} ARG GO_VERSION=1.13.7 -ARG ARCH=amd64 -ENV GO_DOWNLOAD https://dl.google.com/go/go${GO_VERSION}.linux-${ARCH}.tar.gz +ENV GO_DOWNLOAD https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz RUN mkdir -p /goroot /gopath -RUN mkdir /go-build RUN wget -q $GO_DOWNLOAD -O go.tar.gz RUN tar xf go.tar.gz -C /goroot --strip-components=1 ENV GOROOT=/goroot ENV GOPATH=/gopath ENV PATH="/goroot/bin:${PATH}" -ENV GOCACHE=/go-build # This is where we expect Dendrite to be binded to from the host RUN mkdir -p /src From 6820e1aac5256d657d9cc9aae83d8b6054326a99 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Wed, 21 Apr 2021 16:00:54 +0200 Subject: [PATCH 07/11] Document new subroutine --- lib/SyTest/Identity/Server.pm | 3 +-- tests/11register.pl | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/SyTest/Identity/Server.pm b/lib/SyTest/Identity/Server.pm index 8ff3904fc..15ed74fe1 100644 --- a/lib/SyTest/Identity/Server.pm +++ b/lib/SyTest/Identity/Server.pm @@ -260,7 +260,7 @@ sub validate_identity { my $self = shift; my ( $medium, $address, $client_secret ) = @_; - + my $sid = "session_${\ $self->{sid}++ }"; $self->{validated}{$sid} = { @@ -573,7 +573,6 @@ sub on_bind $req->respond_json( \%resp ); } - =head2 on_unbind $server->on_unbind( $req ); diff --git a/tests/11register.pl b/tests/11register.pl index c4b7127e9..f9f7d1eb9 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -81,7 +81,8 @@ =head2 validate_email_on_id_server }); Runs through a `.../requestToken` flow specified by $path for verifying that an email address -belongs to the user. Doesn't add the address to the account. +belongs to the user. Doesn't add the address to the account. It does not submit token as +validate_email does, but expects that mock identity server will validate email immediately. Returns the session id and client secret which can then be used for binding the address. From 12e7e790295e5b3bf671a7fceba4ac7176a024f4 Mon Sep 17 00:00:00 2001 From: Piotr Kozimor Date: Thu, 22 Apr 2021 07:43:11 +0200 Subject: [PATCH 08/11] Fix typo --- tests/11register.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/11register.pl b/tests/11register.pl index f9f7d1eb9..2bbc4f70c 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -730,7 +730,7 @@ sub add_email_for_user { auth => { type => "m.login.email.identity", session => $body->{session}, - threepid_creds => { + threepid_creds => { sid => $sid_email, client_secret => $client_secret, }, From cc93a055b99deca95d0a59f4c081798b466a72c8 Mon Sep 17 00:00:00 2001 From: PiotrKozimor <37144818+PiotrKozimor@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:43:13 +0200 Subject: [PATCH 09/11] Remove commented debug prints Co-authored-by: Erik Johnston --- tests/11register.pl | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/11register.pl b/tests/11register.pl index 2bbc4f70c..f8ec25144 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -757,9 +757,6 @@ sub add_email_for_user { my $email_address = 'testemail@example.com'; - - # print "\n\n$BIND_HOST\n\n\n"; - # print "\n\n${id_server->name}\n\n\n"; $http->do_request_json( method => "POST", uri => "/r0/register", From 4ce35602d6dcd01a9e25cd2b26e6944b4996240c Mon Sep 17 00:00:00 2001 From: PiotrKozimor <37144818+PiotrKozimor@users.noreply.github.com> Date: Mon, 26 Apr 2021 16:43:53 +0200 Subject: [PATCH 10/11] More descriptive fail information Co-authored-by: Erik Johnston --- tests/11register.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/11register.pl b/tests/11register.pl index f8ec25144..74c68842d 100644 --- a/tests/11register.pl +++ b/tests/11register.pl @@ -773,7 +773,7 @@ sub add_email_for_user { assert_json_keys( $body, qw( session flows )); - log_if_fail "No single m.login.email.identity stage registration flow found", $body; + log_if_fail "First /register body", $body; # Check that one of the flows' stages contains an "m.login.email.identity" stage my $has_flow; From a139b7136821e4582c18212e7040e1c94320b735 Mon Sep 17 00:00:00 2001 From: PiotrKozimor <37144818+PiotrKozimor@users.noreply.github.com> Date: Wed, 5 May 2021 11:49:51 +0200 Subject: [PATCH 11/11] Change indentation of dendrite configuration hash Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> --- lib/SyTest/Homeserver/Dendrite.pm | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/SyTest/Homeserver/Dendrite.pm b/lib/SyTest/Homeserver/Dendrite.pm index b61ae3569..499a54e0d 100644 --- a/lib/SyTest/Homeserver/Dendrite.pm +++ b/lib/SyTest/Homeserver/Dendrite.pm @@ -135,16 +135,9 @@ sub _get_config custom_ca_path => "/sytest/keys/tls-selfsigned.crt", registration => { flows => [ - { - stages => [ - "m.login.email.identity", - ] - }, - { - stages => [ - "m.login.dummy" - ] - }] + { stages => [ "m.login.email.identity" ]}, + { stages => [ "m.login.dummy" ]}, + ], }, database => { connection_string =>