mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-29 17:51:56 -06:00
Allow = in user identifiers (#1590)
While I was breaking through all the TDD bureaucracy to finally push this fix, it turned out that it already got fixed in #1578. Still I push the rest of the changes (basically, everything except of actually fixing the bug ;)). `=` is crucial for matrix-bifrost which turns XMPP @'s into =40. Signed-off-by: Bohdan Horbeshko <bodqhrohro@gmail.com>
This commit is contained in:
parent
e65a3443a4
commit
1cf9f20d2f
|
@ -209,7 +209,7 @@ func validateUsername(username string) *util.JSONResponse {
|
||||||
} else if !validUsernameRegex.MatchString(username) {
|
} else if !validUsernameRegex.MatchString(username) {
|
||||||
return &util.JSONResponse{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.InvalidUsername("Username can only contain characters a-z, 0-9, or '_-./'"),
|
JSON: jsonerror.InvalidUsername("Username can only contain characters a-z, 0-9, or '_-./='"),
|
||||||
}
|
}
|
||||||
} else if username[0] == '_' { // Regex checks its not a zero length string
|
} else if username[0] == '_' { // Regex checks its not a zero length string
|
||||||
return &util.JSONResponse{
|
return &util.JSONResponse{
|
||||||
|
@ -230,7 +230,7 @@ func validateApplicationServiceUsername(username string) *util.JSONResponse {
|
||||||
} else if !validUsernameRegex.MatchString(username) {
|
} else if !validUsernameRegex.MatchString(username) {
|
||||||
return &util.JSONResponse{
|
return &util.JSONResponse{
|
||||||
Code: http.StatusBadRequest,
|
Code: http.StatusBadRequest,
|
||||||
JSON: jsonerror.InvalidUsername("Username can only contain characters a-z, 0-9, or '_-./'"),
|
JSON: jsonerror.InvalidUsername("Username can only contain characters a-z, 0-9, or '_-./='"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
|
|
@ -16,6 +16,13 @@ POST /register rejects registration of usernames with '£'
|
||||||
POST /register rejects registration of usernames with 'é'
|
POST /register rejects registration of usernames with 'é'
|
||||||
POST /register rejects registration of usernames with '\n'
|
POST /register rejects registration of usernames with '\n'
|
||||||
POST /register rejects registration of usernames with '''
|
POST /register rejects registration of usernames with '''
|
||||||
|
POST /register allows registration of usernames with 'q'
|
||||||
|
POST /register allows registration of usernames with '3'
|
||||||
|
POST /register allows registration of usernames with '.'
|
||||||
|
POST /register allows registration of usernames with '_'
|
||||||
|
POST /register allows registration of usernames with '='
|
||||||
|
POST /register allows registration of usernames with '-'
|
||||||
|
POST /register allows registration of usernames with '/'
|
||||||
GET /login yields a set of flows
|
GET /login yields a set of flows
|
||||||
POST /login can log in as a user
|
POST /login can log in as a user
|
||||||
POST /login returns the same device_id as that in the request
|
POST /login returns the same device_id as that in the request
|
||||||
|
|
Loading…
Reference in a new issue