Skip to content

Commit d0833ba

Browse files
committed
id_quota stuff
1 parent d305b59 commit d0833ba

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed

src/controller/org.controller/index.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,77 @@ router.get('/registry/org/:shortname/users',
3333
controller.USER_ALL)
3434

3535
router.get('/registry/org/:shortname/id_quota',
36+
/*
37+
#swagger.tags = ['Registry Organization']
38+
#swagger.operationId = 'orgIdQuota'
39+
#swagger.summary = "Retrieves an organization's CVE ID quota (accessible to all registered users)"
40+
#swagger.description = "
41+
<h2>Access Control</h2>
42+
<p>All registered users can access this endpoint</p>
43+
<h2>Expected Behavior</h2>
44+
<p><b>Regular, CNA & Admin Users:</b> Retrieves the CVE ID quota for the user's organization</p>
45+
<p><b>Secretariat:</b> Retrieves the CVE ID quota for any organization</p>"
46+
#swagger.parameters['shortname'] = { description: 'The shortname of the organization' }
47+
#swagger.parameters['$ref'] = [
48+
'#/components/parameters/registry',
49+
'#/components/parameters/apiEntityHeader',
50+
'#/components/parameters/apiUserHeader',
51+
'#/components/parameters/apiSecretHeader'
52+
]
53+
#swagger.responses[200] = {
54+
description: 'Returns the CVE ID quota for an organization',
55+
content: {
56+
"application/json": {
57+
schema: {
58+
oneOf: [
59+
{ $ref: '../schemas/org/get-org-quota-response.json' },
60+
{ $ref: '../schemas/registry-org/get-registry-org-quota-response.json' }
61+
]
62+
}
63+
}
64+
}
65+
}
66+
#swagger.responses[400] = {
67+
description: 'Bad Request',
68+
content: {
69+
"application/json": {
70+
schema: { $ref: '../schemas/errors/bad-request.json' }
71+
}
72+
}
73+
}
74+
#swagger.responses[401] = {
75+
description: 'Not Authenticated',
76+
content: {
77+
"application/json": {
78+
schema: { $ref: '../schemas/errors/generic.json' }
79+
}
80+
}
81+
}
82+
#swagger.responses[403] = {
83+
description: 'Forbidden',
84+
content: {
85+
"application/json": {
86+
schema: { $ref: '../schemas/errors/generic.json' }
87+
}
88+
}
89+
}
90+
#swagger.responses[404] = {
91+
description: 'Not Found',
92+
content: {
93+
"application/json": {
94+
schema: { $ref: '../schemas/errors/generic.json' }
95+
}
96+
}
97+
}
98+
#swagger.responses[500] = {
99+
description: 'Internal Server Error',
100+
content: {
101+
"application/json": {
102+
schema: { $ref: '../schemas/errors/generic.json' }
103+
}
104+
}
105+
}
106+
*/
36107
mw.useRegistry(),
37108
mw.validateUser,
38109
param(['shortname']).isString().trim().notEmpty().isLength({ min: CONSTANTS.MIN_SHORTNAME_LENGTH, max: CONSTANTS.MAX_SHORTNAME_LENGTH }),

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ router.get('/registryOrg',
1313
/*
1414
#swagger.tags = ['Registry Organization']
1515
#swagger.operationId = 'getAllRegistryOrgs'
16+
#swagger.ignore = true
1617
#swagger.summary = "Retrieves information about all registry organizations (accessible to Secretariat only)"
1718
#swagger.description = "
1819
<h2>Access Control</h2>
@@ -80,6 +81,7 @@ router.get('/registryOrg/:identifier',
8081
/*
8182
#swagger.tags = ['Registry Organization']
8283
#swagger.operationId = 'getSingleRegistryOrg'
84+
#swagger.ignore = true
8385
#swagger.summary = "Retrieves information about a specific registry organization"
8486
#swagger.description = "
8587
<h2>Access Control</h2>
@@ -150,6 +152,7 @@ router.post('/registryOrg',
150152
/*
151153
#swagger.tags = ['Registry Organization']
152154
#swagger.operationId = 'createRegistryOrg'
155+
#swagger.ignore = true
153156
#swagger.summary = "Creates a new registry organization (accessible to Secretariat only)"
154157
#swagger.description = "
155158
<h2>Access Control</h2>
@@ -254,6 +257,7 @@ router.put('/registryOrg/:shortname',
254257
/*
255258
#swagger.tags = ['Registry Organization']
256259
#swagger.operationId = 'updateRegistryOrg'
260+
#swagger.ignore = true
257261
#swagger.summary = "Updates an existing registry organization (accessible to Secretariat only)"
258262
#swagger.description = "
259263
<h2>Access Control</h2>
@@ -374,6 +378,7 @@ router.delete('/registryOrg/:identifier',
374378
/*
375379
#swagger.tags = ['Registry Organization']
376380
#swagger.operationId = 'deleteRegistryOrg'
381+
#swagger.ignore = true
377382
#swagger.summary = "Deletes an existing registry organization (accessible to Secretariat only)"
378383
#swagger.description = "
379384
<h2>Access Control</h2>
@@ -455,6 +460,7 @@ router.get('/registryOrg/:shortname/users',
455460
/*
456461
#swagger.tags = ['Registry User']
457462
#swagger.operationId = 'registryUserOrgAll'
463+
#swagger.ignore = true
458464
#swagger.summary = "Retrieves all users for the organization with the specified short name (accessible to all registered users)"
459465
#swagger.description = "
460466
<h2>Access Control</h2>
@@ -530,6 +536,7 @@ router.post('/registryOrg/:shortname/user',
530536
/*
531537
#swagger.tags = ['Registry User']
532538
#swagger.operationId = 'RegistryUserCreateSingle'
539+
#swagger.ignore = true
533540
#swagger.summary = "Create a user with the provided short name as the owning organization (accessible to Admins and Secretariats)"
534541
#swagger.description = "
535542
<h2>Access Control</h2>

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ router.get('/registryUser',
1111
/*
1212
#swagger.tags = ['Registry User']
1313
#swagger.operationId = 'getAllRegistryUsers'
14+
#swagger.ignore = true
1415
#swagger.summary = "Retrieves information about all registry users (accessible to Secretariat only)"
1516
#swagger.description = "
1617
<h2>Access Control</h2>
@@ -77,6 +78,7 @@ router.get('/registryUser/:identifier',
7778
/*
7879
#swagger.tags = ['Registry User']
7980
#swagger.operationId = 'getSingleRegistryUser'
81+
#swagger.ignore = true
8082
#swagger.summary = "Retrieves information about a specific registry user"
8183
#swagger.description = "
8284
<h2>Access Control</h2>
@@ -147,6 +149,7 @@ router.post('/registryUser',
147149
/*
148150
#swagger.tags = ['Registry User']
149151
#swagger.operationId = 'createRegistryUser'
152+
#swagger.ignore = true
150153
#swagger.summary = "Creates a new registry user (accessible to Secretariat only)"
151154
#swagger.description = "
152155
<h2>Access Control</h2>
@@ -220,6 +223,7 @@ router.put('/registryUser/:identifier',
220223
/*
221224
#swagger.tags = ['Registry User']
222225
#swagger.operationId = 'updateRegistryUser'
226+
#swagger.ignore = true
223227
#swagger.summary = "Updates an existing registry user (accessible to Secretariat only)"
224228
#swagger.description = "
225229
<h2>Access Control</h2>
@@ -308,6 +312,7 @@ router.delete(
308312
/*
309313
#swagger.tags = ['Registry User']
310314
#swagger.operationId = 'deleteRegistryUser'
315+
#swagger.ignore = true
311316
#swagger.summary = "Deletes an existing registry user (accessible to Secretariat only)"
312317
#swagger.description = "
313318
<h2>Access Control</h2>

0 commit comments

Comments
 (0)