user management: allow ':' in user ids (#12531)

Fixes #12520

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Simon Meier 2022-01-21 16:39:42 +01:00 committed by GitHub
parent f5d7821ace
commit 89d95e6d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -353,7 +353,7 @@ private[data] final class IdStringImpl extends IdString {
new ConcatenableMatchingStringModule("Application ID", "._:-#/!|@^$`+'~ ", 255)
/** Identifiers for participant node users are non-empty strings with a length <= 128 that consist of
* lowercase ASCII alphanumeric characters and the symbols "@^$.!`-#+'~_|".
* lowercase ASCII alphanumeric characters and the symbols "@^$.!`-#+'~_|:".
* This character set is chosen such that it maximizes the ease of integration with IAM systems, while removing
* the ambiguity of allowing both "john" and "John" as separate user names.
* Concretely, the character set contains the Auth0 allowed characters (https://auth0.com/docs/authenticate/database-connections/require-username#allowed-characters)
@ -361,6 +361,6 @@ private[data] final class IdStringImpl extends IdString {
*/
override type UserId = String
override val UserId: StringModule[UserId] =
new MatchingStringModule("User ID", """[a-z0-9@^$.!`\-#+'~_|]{1,128}""")
new MatchingStringModule("User ID", """[a-z0-9@^$.!`\-#+'~_|:]{1,128}""")
}

View File

@ -294,7 +294,7 @@ class RefTest extends AnyFreeSpec with Matchers with EitherValues {
}
"UserId" - {
val validCharacters = "abcdefghijklmnopqrstuvwxyz0123456789._-#!|@^$`+'~"
val validCharacters = "abcdefghijklmnopqrstuvwxyz0123456789._-#!|@^$`+'~:"
val validUserIds =
validCharacters.flatMap(c => Vector(c.toString, s"$c$c")) ++
Vector(
@ -318,7 +318,7 @@ class RefTest extends AnyFreeSpec with Matchers with EitherValues {
}
"reject invalid user ids" in {
val invalidCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ \\%&*()=[]{};:<>,?\""
val invalidCharacters = "àáABCDEFGHIJKLMNOPQRSTUVWXYZ \\%&*()=[]{};<>,?\""
val invalidUserIds =
invalidCharacters.map(c => c.toString) ++
Vector(

View File

@ -52,7 +52,7 @@ service UserManagementService {
// Read the :doc:`Authorization documentation </app-dev/authorization>` to learn more.
message User {
// The user identifier, which must be a non-empty string of at most 128
// characters that are either lowercase alphanumeric ASCII characters or one of the symbols "@^$.!`-#+'~_|".
// characters that are either lowercase alphanumeric ASCII characters or one of the symbols "@^$.!`-#+'~_|:".
string id = 1;
// The primary party as which this user reads and acts by default on the ledger