Skip to content

Commit bedb727

Browse files
committed
Fixes #571
1 parent a473ed1 commit bedb727

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

server/src/main/java/invite/provision/scim/GroupURN.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@ private GroupURN() {
1111
}
1212

1313
public static String sanitizeRoleShortName(String shortName) {
14-
return Normalizer.normalize(shortName, Normalizer.Form.NFKD)
14+
String normalizedShortName = Normalizer.normalize(shortName, Normalizer.Form.NFKD)
1515
.trim()
1616
.replaceAll(" +", " ")
1717
.replaceAll(" ", "_")
18-
.replaceAll("[^A-Za-z0-9_.]", "")
18+
.replaceAll("[^A-Za-z0-9_./]", "")
1919
.replaceAll("_+", "_")
2020
.toLowerCase();
21+
return normalizedShortName.endsWith("_") ? normalizedShortName.substring(0, normalizedShortName.length() - 1) : normalizedShortName;
2122
}
2223

2324
public static String urnFromRole(String groupUrnPrefix, Role role) {

0 commit comments

Comments
 (0)