Usernames can't start with numbers

This commit is contained in:
Moxie Marlinspike
2019-10-28 12:51:19 -07:00
parent 523134f24b
commit 2b987e6e93
2 changed files with 13 additions and 1 deletions

View File

@@ -864,6 +864,18 @@ public class AccountControllerTest {
assertThat(response.getStatus()).isEqualTo(400);
}
@Test
public void testSetInvalidPrefixUsername() {
Response response =
resources.getJerseyTest()
.target("/v1/accounts/username/0n00bkiller")
.request()
.header("Authorization", AuthHelper.getAuthHeader(AuthHelper.VALID_NUMBER, AuthHelper.VALID_PASSWORD))
.put(Entity.text(""));
assertThat(response.getStatus()).isEqualTo(400);
}
@Test
public void testSetUsernameBadAuth() {
Response response =