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:
parent
97ff9eb780
commit
690a8fc42a
1 changed files with 38 additions and 38 deletions
|
|
@ -22,48 +22,48 @@ 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}$": {
|
||||||
},
|
"type": "object",
|
||||||
"additionalProperties": {
|
"properties": {
|
||||||
"type": "object",
|
"uid": {
|
||||||
"properties": {
|
"description": "User UID",
|
||||||
"uid": {
|
"type": "number"
|
||||||
"description": "User UID",
|
},
|
||||||
"type": "number"
|
"gid": {
|
||||||
},
|
"description": "User GID",
|
||||||
"gid": {
|
"type": "number"
|
||||||
"description": "User GID",
|
},
|
||||||
"type": "number"
|
"groups": {
|
||||||
},
|
"description": "Array of group names for this user",
|
||||||
"groups": {
|
"type": "array",
|
||||||
"description": "Array of group names for this user",
|
"items": {
|
||||||
"type": "array",
|
"type": "string"
|
||||||
"items": {
|
}
|
||||||
|
},
|
||||||
|
"description": {
|
||||||
|
"description": "User account description (or full name)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"home": {
|
||||||
|
"description": "Path to user's home directory",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"shell": {
|
||||||
|
"description": "User's login shell",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"password": {
|
||||||
|
"description": "User's encrypted password, as returned by crypt(3)",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"key": {
|
||||||
|
"description": "SSH Public Key to add to ~/.ssh/authorized_keys",
|
||||||
"type": "string"
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"description": {
|
|
||||||
"description": "User account description (or full name)",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"home": {
|
|
||||||
"description": "Path to user's home directory",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"shell": {
|
|
||||||
"description": "User's login shell",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"description": "User's encrypted password, as returned by crypt(3)",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"key": {
|
|
||||||
"description": "SSH Public Key to add to ~/.ssh/authorized_keys",
|
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue