Skip to content

Shared secret registration moved to an admin API#453

Merged
hawkowl merged 5 commits intodevelopfrom
hawkowl/register-user-improv
Jul 20, 2018
Merged

Shared secret registration moved to an admin API#453
hawkowl merged 5 commits intodevelopfrom
hawkowl/register-user-improv

Conversation

@hawkowl
Copy link
Copy Markdown
Contributor

@hawkowl hawkowl commented Jun 20, 2018

No description provided.

@hawkowl
Copy link
Copy Markdown
Contributor Author

hawkowl commented Jun 20, 2018

matrixbot: retest this please

@hawkowl hawkowl changed the title Update so only the r0 registration has shared secret tests Shared secret registration moved to an admin API Jul 18, 2018
@hawkowl
Copy link
Copy Markdown
Contributor Author

hawkowl commented Jul 18, 2018

matrixbot: retest this please

Copy link
Copy Markdown
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as a general principle, I'm not sure we should be testing /admin APIs from sytest, because they are by definition synapse-specific, but this looks great.

lgtm other than you failing to intuit leo's whitespace policy.

and congratulations on successfully hacking on sytest.

$http->do_request_json(
method => "GET",
uri => "/r0/admin/register",
)->then(sub{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, the whitespace conventions for sytest are... unusual.

this should have a space inside the parens:

)->then( sub {

my ( $nonce ) = @_;

my $mac = hmac_sha1_hex(
join("\0", $nonce->{nonce}, $uid, $password, $is_admin ? "admin" : "notadmin" ),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs indenting and space inside the parens


$http->do_request_json(
return $http->do_request_json(
method => "POST",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent please

$message =~ s/\r?\n?$//; # because HTTP::Response doesn't do this

return Future->fail( "HTTP Request failed (${\$response->code} $message)",
return Future->fail( "HTTP Request failed (${\$response->code} $message $uri)",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space inside these parens too please

@hawkowl hawkowl merged commit 49403c6 into develop Jul 20, 2018
@hawkowl hawkowl deleted the hawkowl/register-user-improv branch July 20, 2018 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants