stages/users: fix user names schema validation

Use `patternProperties` instead of `propertyNames` and `pattern`,
which is not in draft 4 and so did not work (but also did not
throw an error).

Co-Developed-by: Achilleas Koutsou <achilleas@koutsou.net>
This commit is contained in:
Christian Kellner 2021-06-09 10:56:41 +00:00 committed by Lars Karlitski
parent 97ff9eb780
commit 690a8fc42a

View file

@ -22,12 +22,11 @@ SCHEMA = """
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"users": { "users": {
"additionalProperties": false,
"type": "object", "type": "object",
"description": "Keys are usernames, values are objects giving user info.", "description": "Keys are usernames, values are objects giving user info.",
"propertyNames": { "patternProperties": {
"pattern": "^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$" "^[A-Za-z0-9_][A-Za-z0-9_-]{0,31}$": {
},
"additionalProperties": {
"type": "object", "type": "object",
"properties": { "properties": {
"uid": { "uid": {
@ -68,6 +67,7 @@ SCHEMA = """
} }
} }
} }
}
} }
""" """