Support for at-sign (@) in usernames

Our SSO system (Shibboleth, a SAML thing) is a federated system which
uses login names such as kundrat@cesnet.cz for unique identifiers.

Change-Id: Ic2df0f270c178e7a93dde5d0460dd24f10edf321
Bug: Issue 2830
This commit is contained in:
Jan Kundrát
2017-01-20 11:13:52 +01:00
committed by David Pursehouse
parent f1f980d3a8
commit a1be2c7445
2 changed files with 13 additions and 1 deletions

View File

@@ -99,6 +99,18 @@ public class GroupsIT extends AbstractDaemonTest {
assertMembers(g, u1, u2);
}
@Test
public void addMembersWithAtSign() throws Exception {
String g = createGroup("users");
TestAccount u10 = accounts.create("u10", "u10@example.com", "Full Name 10");
TestAccount u11_at = accounts.create("u11@something", "u11@example.com",
"Full Name 11 With At");
TestAccount u11 = accounts.create("u11", "u11.another@example.com",
"Full Name 11 Without At");
gApi.groups().id(g).addMembers(u10.username, u11_at.username);
assertMembers(g, u10, u11_at);
}
@Test
public void includeRemoveGroup() throws Exception {
String p = createGroup("parent");

View File

@@ -60,7 +60,7 @@ public final class Account {
}
public static final String USER_NAME_PATTERN_FIRST = "[a-zA-Z0-9]";
public static final String USER_NAME_PATTERN_REST = "[a-zA-Z0-9._-]";
public static final String USER_NAME_PATTERN_REST = "[a-zA-Z0-9._@-]";
public static final String USER_NAME_PATTERN_LAST = "[a-zA-Z0-9]";
/** Regular expression that {@link #userName} must match. */