Skip to content

Commit f5a1894

Browse files
committed
Fixes #585 and bugfix for required short_name in update Role
1 parent 83e5b25 commit f5a1894

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

server/src/main/java/invite/model/Role.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public class Role implements Serializable, Provisionable {
3030
private String name;
3131

3232
@Column(name = "short_name")
33-
@NotNull
3433
private String shortName;
3534

3635
@Column(name = "description")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public static String sanitizeRoleShortName(String shortName) {
1515
.trim()
1616
.replaceAll(" +", " ")
1717
.replaceAll(" ", "_")
18-
.replaceAll("[^A-Za-z0-9_./]", "")
18+
.replaceAll("[^A-Za-z0-9_./-]", "")
1919
.replaceAll("_+", "_")
2020
.toLowerCase();
2121
return normalizedShortName.endsWith("_") ? normalizedShortName.substring(0, normalizedShortName.length() - 1) : normalizedShortName;

server/src/test/java/invite/provision/scim/GroupURNTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ void sanitizeRoleShortName() {
1818

1919
String sanitizedName = GroupURN.sanitizeRoleShortName("request/path &^");
2020
assertEquals("request/path", sanitizedName);
21+
22+
String sanitizedNameWithHyphen = GroupURN.sanitizeRoleShortName("request-path &^");
23+
assertEquals("request-path", sanitizedNameWithHyphen);
2124
}
2225

2326
@Test

0 commit comments

Comments
 (0)