Skip to content

Commit 1c4c288

Browse files
authored
Merge branch 'dev' into dr_1399_fix_identifier
2 parents 6f09a77 + 6cc4cab commit 1c4c288

File tree

7 files changed

+318
-81
lines changed

7 files changed

+318
-81
lines changed

api-docs/openapi.json

Lines changed: 74 additions & 62 deletions
Large diffs are not rendered by default.
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://cve.mitre.org/schema/org/organization.json",
4+
"type": "object",
5+
"title": "CVE Update Registry Org Request",
6+
"description": "JSON Schema for updating a CVE Registry organization",
7+
"properties": {
8+
"long_name": {
9+
"type": "string",
10+
"description": "Full name of the organization"
11+
},
12+
"short_name": {
13+
"type": "string",
14+
"description": "Short name or acronym of the organization"
15+
},
16+
"aliases": {
17+
"type": "array",
18+
"items": {
19+
"type": "string"
20+
},
21+
"description": "Alternative names or aliases for the organization"
22+
},
23+
"cve_program_org_function": {
24+
"type": "string",
25+
"enum": ["CNA", "ADP", "Root", "Secretariat"],
26+
"description": "The organization's function within the CVE program"
27+
},
28+
"authority": {
29+
"type": "object",
30+
"properties": {
31+
"active_roles": {
32+
"type": "array",
33+
"items": {
34+
"type": "string",
35+
"enum": ["CNA", "ADP", "Root", "Secretariat"]
36+
}
37+
}
38+
},
39+
"required": ["active_roles"]
40+
},
41+
"reports_to": {
42+
"type": ["string", "null"],
43+
"description": "UUID of the parent organization, if any"
44+
},
45+
"oversees": {
46+
"type": "array",
47+
"items": {
48+
"type": "string"
49+
},
50+
"description": "UUIDs of organizations overseen by this organization"
51+
},
52+
"root_or_tlr": {
53+
"type": "boolean",
54+
"description": "Indicates if the organization is a root or top-level root"
55+
},
56+
"users": {
57+
"type": "array",
58+
"items": {
59+
"type": "string"
60+
},
61+
"description": "UUIDs of users associated with this organization"
62+
},
63+
"charter_or_scope": {
64+
"type": "string",
65+
"description": "Description of the organization's charter or scope"
66+
},
67+
"disclosure_policy": {
68+
"type": "string",
69+
"description": "The organization's disclosure policy"
70+
},
71+
"product_list": {
72+
"type": "string",
73+
"description": "List of products associated with the organization"
74+
},
75+
"contact_info": {
76+
"type": "object",
77+
"properties": {
78+
"additional_contact_users": {
79+
"type": "array",
80+
"items": {
81+
"type": "string"
82+
}
83+
},
84+
"poc": {
85+
"type": "string",
86+
"description": "Point of contact name"
87+
},
88+
"poc_email": {
89+
"type": "string",
90+
"format": "email",
91+
"description": "Point of contact email"
92+
},
93+
"poc_phone": {
94+
"type": "string",
95+
"description": "Point of contact phone number"
96+
},
97+
"admins": {
98+
"type": "array",
99+
"items": {
100+
"type": "string"
101+
},
102+
"description": "UUIDs of admin users"
103+
},
104+
"org_email": {
105+
"type": "string",
106+
"format": "email",
107+
"description": "Organization's email address"
108+
},
109+
"website": {
110+
"type": "string",
111+
"format": "uri",
112+
"description": "Organization's website URL"
113+
}
114+
}
115+
}
116+
}
117+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://cve.mitre.org/schema/user/registry-user.json",
4+
"type": "object",
5+
"title": "CVE Update Registry User Request",
6+
"description": "JSON Schema for updating a CVE Registry User",
7+
"properties": {
8+
"user_id": {
9+
"type": "string",
10+
"description": "User's identifier or username"
11+
},
12+
"name": {
13+
"type": "object",
14+
"properties": {
15+
"first": {
16+
"type": "string",
17+
"description": "User's first name"
18+
},
19+
"last": {
20+
"type": "string",
21+
"description": "User's last name"
22+
},
23+
"middle": {
24+
"type": "string",
25+
"description": "User's middle name"
26+
},
27+
"suffix": {
28+
"type": "string",
29+
"description": "User's name suffix"
30+
}
31+
}
32+
},
33+
"org_affiliations": {
34+
"type": "array",
35+
"items": {
36+
"type": "string"
37+
},
38+
"description": "UUIDs of organizations the user is affiliated with"
39+
},
40+
"cve_program_org_membership": {
41+
"type": "array",
42+
"items": {
43+
"type": "string"
44+
},
45+
"description": "UUIDs of CVE program organizations the user is a member of"
46+
},
47+
"authority": {
48+
"type": "object",
49+
"properties": {
50+
"active_roles": {
51+
"type": "array",
52+
"items": {
53+
"type": "string",
54+
"enum": ["ADMIN", "PUBLISHER"]
55+
}
56+
}
57+
},
58+
"required": ["active_roles"]
59+
},
60+
"contact_info": {
61+
"type": "object",
62+
"properties": {
63+
"email": {
64+
"type": "string",
65+
"format": "email",
66+
"description": "User's email address"
67+
},
68+
"phone": {
69+
"type": "string",
70+
"description": "User's phone number"
71+
}
72+
}
73+
}
74+
}
75+
}

src/controller/registry-org.controller/index.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ router.get('/registryOrg',
2929
description: 'A list of all registry organizations, along with pagination fields if results span multiple pages of data',
3030
content: {
3131
"application/json": {
32-
schema: { $ref: '../schemas/registry-org/get-registry-org-response.json' }
32+
schema: { $ref: '../schemas/registry-org/list-registry-orgs-response.json' }
3333
}
3434
}
3535
}
@@ -101,7 +101,7 @@ router.get('/registryOrg/:identifier',
101101
description: 'The requested registry organization information is returned',
102102
content: {
103103
"application/json": {
104-
schema: { $ref: '../schemas/org/get-org-response.json' }
104+
schema: { $ref: '../schemas/registry-org/get-registry-org-response.json' }
105105
}
106106
}
107107
}
@@ -165,15 +165,15 @@ router.post('/registryOrg',
165165
required: true,
166166
content: {
167167
'application/json': {
168-
schema: { $ref: '#/components/schemas/CreateOrgPayload' }
168+
schema: { $ref: '../schemas/registry-org/create-registry-org-request.json' }
169169
}
170170
}
171171
}
172172
#swagger.responses[201] = {
173173
description: 'The registry organization was successfully created',
174174
content: {
175175
"application/json": {
176-
schema: { $ref: '../schemas/org/create-org-response.json' }
176+
schema: { $ref: '../schemas/registry-org/create-registry-org-response.json' }
177177
}
178178
}
179179
}
@@ -275,15 +275,15 @@ router.put('/registryOrg/:shortname',
275275
required: true,
276276
content: {
277277
'application/json': {
278-
schema: { $ref: '#/components/schemas/UpdateOrgPayload' }
278+
schema: { $ref: '../schemas/registry-org/update-registry-org-request.json' }
279279
}
280280
}
281281
}
282282
#swagger.responses[200] = {
283283
description: 'The registry organization was successfully updated',
284284
content: {
285285
"application/json": {
286-
schema: { $ref: '../schemas/org/update-org-response.json' }
286+
schema: { $ref: '../schemas/registry-org/update-registry-org-response.json' }
287287
}
288288
}
289289
}
@@ -395,7 +395,15 @@ router.delete('/registryOrg/:identifier',
395395
description: 'The registry organization was successfully deleted',
396396
content: {
397397
"application/json": {
398-
schema: { $ref: '../schemas/org/delete-org-response.json' }
398+
schema: {
399+
type: 'object',
400+
properties: {
401+
message: {
402+
type: 'string',
403+
description: 'Message describing successful deletion operation'
404+
}
405+
}
406+
}
399407
}
400408
}
401409
}
@@ -465,7 +473,7 @@ router.get('/registryOrg/:shortname/users',
465473
description: 'Returns all users for the organization, along with pagination fields if results span multiple pages of data',
466474
content: {
467475
"application/json": {
468-
schema: { $ref: '../schemas/user/list-users-response.json' }
476+
schema: { $ref: '../schemas/registry-user/list-registry-users-response.json' }
469477
}
470478
}
471479
}
@@ -539,15 +547,15 @@ router.post('/registryOrg/:shortname/user',
539547
required: true,
540548
content: {
541549
'application/json': {
542-
schema: { $ref: '../schemas/user/create-user-request.json' },
550+
schema: { $ref: '../schemas/registry-user/create-registry-user-request.json' },
543551
}
544552
}
545553
}
546554
#swagger.responses[200] = {
547555
description: 'Returns the new user information (with the secret)',
548556
content: {
549557
"application/json": {
550-
schema: { $ref: '../schemas/user/create-user-response.json' },
558+
schema: { $ref: '../schemas/registry-user/create-registry-user-response.json' },
551559
}
552560
}
553561
}

src/controller/registry-user.controller/index.js

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ router.get('/registryUser',
2424
'#/components/parameters/apiSecretHeader'
2525
]
2626
#swagger.responses[200] = {
27-
description: 'A list of all registry organizations, along with pagination fields if results span multiple pages of data',
27+
description: 'A list of all registry users, along with pagination fields if results span multiple pages of data',
2828
content: {
2929
"application/json": {
30-
schema: { $ref: '../schemas/registry-user/get-registry-users-response.json' }
30+
schema: { $ref: '../schemas/registry-user/list-registry-users-response.json' }
3131
}
3232
}
3333
}
@@ -98,7 +98,7 @@ router.get('/registryUser/:identifier',
9898
description: 'The requested registry user information is returned',
9999
content: {
100100
"application/json": {
101-
schema: { $ref: '../schemas/user/get-user-response.json' }
101+
schema: { $ref: '../schemas/registry-user/get-registry-user-response.json' }
102102
}
103103
}
104104
}
@@ -162,15 +162,15 @@ router.post('/registryUser',
162162
required: true,
163163
content: {
164164
'application/json': {
165-
schema: { $ref: '#/components/schemas/CreateUserPayload' }
165+
schema: { $ref: '../schemas/registry-user/create-registry-user-request.json' }
166166
}
167167
}
168168
}
169169
#swagger.responses[201] = {
170170
description: 'The registry user was successfully created',
171171
content: {
172172
"application/json": {
173-
schema: { $ref: '../schemas/user/create-user-response.json' }
173+
schema: { $ref: '../schemas/registry-user/create-registry-user-response.json' }
174174
}
175175
}
176176
}
@@ -241,15 +241,15 @@ router.put('/registryUser/:identifier',
241241
required: true,
242242
content: {
243243
'application/json': {
244-
schema: { $ref: '#/components/schemas/UpdateUserPayload' }
244+
schema: { $ref: '../schemas/registry-user/update-registry-user-request.json' }
245245
}
246246
}
247247
}
248248
#swagger.responses[200] = {
249249
description: 'The registry user was successfully updated',
250250
content: {
251251
"application/json": {
252-
schema: { $ref: '../schemas/user/update-user-response.json' }
252+
schema: { $ref: '../schemas/registry-user/update-registry-user-response.json' }
253253
}
254254
}
255255
}
@@ -303,7 +303,8 @@ router.put('/registryUser/:identifier',
303303
controller.UPDATE_USER
304304
)
305305

306-
router.delete('/registryUser/:identifier',
306+
router.delete(
307+
'/registryUser/:identifier',
307308
/*
308309
#swagger.tags = ['Registry User']
309310
#swagger.operationId = 'deleteRegistryUser'
@@ -328,7 +329,15 @@ router.delete('/registryUser/:identifier',
328329
description: 'The registry user was successfully deleted',
329330
content: {
330331
"application/json": {
331-
schema: { $ref: '../schemas/user/delete-user-response.json' }
332+
schema: {
333+
type: 'object',
334+
properties: {
335+
message: {
336+
type: 'string',
337+
description: 'Message describing successful deletion operation'
338+
}
339+
}
340+
}
332341
}
333342
}
334343
}

src/controller/schemas.controller/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,15 @@ router.get('/registry-org/create-registry-org-response.json', controller.getCrea
5555
router.get('/registry-org/get-registry-org-response.json', controller.getRegistryOrgResponseSchema)
5656
router.get('/registry-org/get-registry-org-quota-response.json', controller.getRegistryOrgQuotaResponseSchema)
5757
router.get('/registry-org/list-registry-orgs-response.json', controller.getListRegistryOrgsResponseSchema)
58+
router.get('/registry-org/update-registry-org-request.json', controller.getUpdateRegistryOrgRequestSchema)
5859
router.get('/registry-org/update-registry-org-response.json', controller.getUpdateRegistryOrgResponseSchema)
5960

6061
// Schemas relating to Registry-User
6162
router.get('/registry-user/create-registry-user-request.json', controller.getCreateRegistryUserRequestSchema)
6263
router.get('/registry-user/create-registry-user-response.json', controller.getCreateRegistryUserResponseSchema)
6364
router.get('/registry-user/get-registry-user-response.json', controller.getRegistryUserResponseSchema)
6465
router.get('/registry-user/list-registry-users-response.json', controller.getListRegistryUsersResponseSchema)
66+
router.get('/registry-user/update-registry-user-request.json', controller.getUpdateRegistryUserRequestSchema)
6567
router.get('/registry-user/update-registry-user-response.json', controller.getUpdateRegistryUserResponseSchema)
6668

6769
module.exports = router

0 commit comments

Comments
 (0)