Use ExternalId.isValidUsername instead of ExternalId.USER_NAME_PATTERN_REGEX
Since ExternalId.USER_NAME_PATTERN_REGEX is now no longer used by external callers it is made private. Change-Id: Id7a108bf39baffc52273879bbf8973dbbea0ae0c Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
committed by
David Pursehouse
parent
45bf80651a
commit
7a5364662f
@@ -111,7 +111,7 @@ public class CreateAccount implements RestModifyView<TopLevelResource, AccountIn
|
||||
throw new BadRequestException("username must match URL");
|
||||
}
|
||||
|
||||
if (!username.matches(ExternalId.USER_NAME_PATTERN_REGEX)) {
|
||||
if (!ExternalId.isValidUsername(username)) {
|
||||
throw new BadRequestException(
|
||||
"Username '" + username + "' must contain only letters, numbers, _, - or .");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user