mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 01:07:18 +03:00
user management: allow ':' in user ids (#12531)
Fixes #12520 CHANGELOG_BEGIN CHANGELOG_END
This commit is contained in:
parent
f5d7821ace
commit
89d95e6d6c
@ -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}""")
|
||||
|
||||
}
|
||||
|
@ -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(
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user