Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions tests/10apidoc/01register.pl
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,37 @@
};
}


foreach my $chr (split '', 'q3._=-/' ) {
test "POST /register allows registration of usernames with '$chr'",
# Note: this test relies on somewhat implementation-specific details,
# in that it assumes that the `username` presented to `/register` maps
# directly onto an MXID. In reality, a server is free to accept or reject
# any `usernames` it wants, provided it maps those it accepts onto
# valid MXIDs.
requires => [ $main::API_CLIENTS[0],
qw( can_register_dummy_flow ) ],

do => sub {
my ( $http ) = @_;

my $reqbody = {
auth => {
type => "m.login.dummy",
},
username => 'chrtestuser'.$chr,
password => "sUp3rs3kr1t",
};

$http->do_request_json(
method => "POST",
uri => "/r0/register",

content => $reqbody,
);
};
}

push our @EXPORT, qw( localpart_fixture );

my $next_anon_uid = 1;
Expand Down