Skip to content

Commit 7336dad

Browse files
authored
Merge pull request #1475 from CVEProject/emathew/registry-user-schema
Resolves issue #1447, Create Registry User Schema
2 parents f010d42 + c8957eb commit 7336dad

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "/Registry-user",
4+
"type": "object",
5+
"title": "CVE Registry User Schema",
6+
"description": "The schema for CVE Services Registry Users",
7+
"definitions": {
8+
"uuidType": {
9+
"description": "A version 4 (random) universally unique identifier (UUID) as defined by [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.3).",
10+
"type": "string",
11+
"format": "uuid",
12+
"pattern": "^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$"
13+
},
14+
"name": {
15+
"description": "User's name components",
16+
"type": "object",
17+
"required": [
18+
"first",
19+
"last"
20+
],
21+
"properties": {
22+
"first": {
23+
"type": "string",
24+
"maxLength": 100
25+
},
26+
"middle": {
27+
"type": "string",
28+
"maxLength": 100
29+
},
30+
"last": {
31+
"type": "string",
32+
"maxLength": 100
33+
},
34+
"suffix": {
35+
"type": "string",
36+
"maxLength": 100
37+
}
38+
},
39+
"additionalProperties": false
40+
}
41+
},
42+
"properties": {
43+
"name": {
44+
"$ref": "#/definitions/name"
45+
},
46+
"username": {
47+
"description": "Username should be 3-128 characters. Allowed characters are alphanumeric and -_@.",
48+
"type": "string",
49+
"minLength": 3,
50+
"maxLength": 128,
51+
"pattern": "^[A-Za-z0-9\\-_@.]{3,128}$"
52+
},
53+
"secret": {
54+
"description": "Hashed secret for user authentication",
55+
"type": "string"
56+
},
57+
"UUID": {
58+
"$ref": "#/definitions/uuidType"
59+
},
60+
"status": {
61+
"description": "User status: 'active' or 'inactive'",
62+
"type": "string",
63+
"enum": [
64+
"active",
65+
"inactive"
66+
]
67+
}
68+
},
69+
"required": [
70+
"username",
71+
"secret"
72+
],
73+
"additionalProperties": false
74+
}

0 commit comments

Comments
 (0)