matrix-org / dendrite

Dendrite is a second-generation Matrix homeserver written in Go!
https://matrix-org.github.io/dendrite/
Apache License 2.0
5.67k stars 664 forks source link

Implement registration with a shared secret #1299

Closed kegsay closed 3 years ago

kegsay commented 4 years ago

Sytests:

    × POST /r0/admin/register with shared secret
    × POST /r0/admin/register admin with shared secret
    × POST /r0/admin/register with shared secret downcases capitals
    × POST /r0/admin/register with shared secret disallows symbols
alam0rt commented 3 years ago

I'm going to give this a go

alam0rt commented 3 years ago

Hey, pretty new to Go/the codebase...

In https://github.com/matrix-org/sytest/blob/develop/tests/10apidoc/01register.pl#L290 I can see that sytest is hitting /_synapse/admin/v1/register whereas the test output in your comment shows /r0/admin/register as the path.

Are you able to point me in the right direction?

I am currently looking at https://github.com/matrix-org/dendrite/blob/f0a088b487df860d51c4e534bd59c330076d0cff/clientapi/routing/routing.go and was thinking of implementing the missing features similar to https://github.com/matrix-org/dendrite/blob/35ea55e70bf9d4e9db8fe0e0c741f685dcedf0ec/clientapi/routing/admin_whois.go

Thanks :)

perj commented 3 years ago

I think the sytest output above is from the sytest master branch, if that helps.

tulir commented 3 years ago

@alam0rt the /_matrix/client/r0/admin paths are deprecated, /_synapse/admin/v1 is the correct place for synapse-compatible shared secret registration.

Also note that there is already dendrite-specific shared secret registration implemented way back in #257 (which is probably not used for anything, because it's dendrite-specific)

perj commented 3 years ago

Ah, ok, so this registration method is not anything communicated to the client. Rather it is meant to be used by batch scripts etc. Now this makes much more sense...

alam0rt commented 3 years ago

Cheers. Thanks for clarifying

piyushsingariya commented 3 years ago

@jaywink @perj @Kegsay Is this issue still open or it is fixed?