Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update deprecated URLs /_matrix/client/*/admin #984

Merged
merged 1 commit into from
Nov 20, 2020
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions tests/10apidoc/01register.pl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ sub matrix_register_user
});
}

shared_secret_tests( "/r0/admin/register", \&matrix_admin_register_user_via_secret);
shared_secret_tests( "/_synapse/admin/v1/register", \&matrix_admin_register_user_via_secret);

sub matrix_admin_register_user_via_secret
{
Expand All @@ -269,8 +269,8 @@ sub matrix_admin_register_user_via_secret
croak "Require UID for matrix_register_user_via_secret";

$http->do_request_json(
method => "GET",
uri => "/r0/admin/register",
method => "GET",
full_uri => "/_synapse/admin/v1/register",
)->then( sub{
my ( $nonce ) = @_;

Expand All @@ -280,8 +280,8 @@ sub matrix_admin_register_user_via_secret
);

return $http->do_request_json(
method => "POST",
uri => "/r0/admin/register",
method => "POST",
full_uri => "/_synapse/admin/v1/register",

content => {
nonce => $nonce->{nonce},
Expand Down
34 changes: 17 additions & 17 deletions tests/48admin.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ sub await_purge_complete {
$prev_trial ? delay( $delay *= 1.5 ) : Future->done
)->then( sub {
do_request_json_for( $admin_user,
method => "GET",
uri => "/r0/admin/purge_history_status/$purge_id",
method => "GET",
full_uri => "/_synapse/admin/v1/purge_history_status/$purge_id",
)
})->then( sub {
my ($body) = @_;
Expand Down Expand Up @@ -95,15 +95,15 @@ sub await_purge_complete {
await_message_in_room( $user, $room_id, $last_event_id ),
})->then( sub {
do_request_json_for( $user,
method => "POST",
uri => "/r0/admin/purge_history/$room_id/${ \uri_escape( $last_event_id ) }",
content => {}
method => "POST",
full_uri => "/_synapse/admin/v1/purge_history/$room_id/${ \uri_escape( $last_event_id ) }",
content => {}
)->main::expect_http_403; # Must be server admin
})->then( sub {
do_request_json_for( $admin,
method => "POST",
uri => "/r0/admin/purge_history/$room_id/${ \uri_escape( $last_event_id ) }",
content => {}
method => "POST",
full_uri => "/_synapse/admin/v1/purge_history/$room_id/${ \uri_escape( $last_event_id ) }",
content => {}
)
})->then( sub {
my ( $body ) = @_;
Expand Down Expand Up @@ -184,9 +184,9 @@ sub await_purge_complete {
await_message_in_room( $user, $room_id, $last_event_id ),
})->then( sub {
do_request_json_for( $admin,
method => "POST",
uri => "/r0/admin/purge_history/$room_id",
content => {
method => "POST",
full_uri => "/_synapse/admin/v1/purge_history/$room_id",
content => {
purge_up_to_ts => int($last_event_ts * 1000),
},
)
Expand Down Expand Up @@ -287,9 +287,9 @@ sub await_purge_complete {
)
})->then( sub {
do_request_json_for( $admin,
method => "POST",
uri => "/r0/admin/purge_history/$room_id/${ \uri_escape( $last_event_id ) }",
content => {}
method => "POST",
full_uri => "/_synapse/admin/v1/purge_history/$room_id/${ \uri_escape( $last_event_id ) }",
content => {}
)
})->then( sub {
my ( $body ) = @_;
Expand Down Expand Up @@ -381,9 +381,9 @@ sub await_purge_complete {
matrix_join_room( $remote_user, $room_id );
})->then( sub {
do_request_json_for( $admin,
method => "POST",
uri => "/r0/admin/shutdown_room/$room_id",
content => { "new_room_user_id" => $dummy_user->user_id },
method => "POST",
full_uri => "/_synapse/admin/v1/shutdown_room/$room_id",
content => { "new_room_user_id" => $dummy_user->user_id },
);
})->SyTest::pass_on_done( "Shutdown room returned success" )
->then( sub {
Expand Down
6 changes: 3 additions & 3 deletions tests/51media/48admin-quarantine.pl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
);
})->then( sub {
do_request_json_for( $admin,
method => "POST",
uri => "/r0/admin/quarantine_media/$room_id",
content => {},
method => "POST",
full_uri => "/_synapse/admin/v1/quarantine_media/$room_id",
content => {},
);
})->SyTest::pass_on_done( "Quarantine returns success" )
->then( sub {
Expand Down