Skip to content

Commit 5f94285

Browse files
authored
Merge pull request #1725 from CVEProject/dev
v2.7.2 - Renaming some fields & Reports_to and Oversees updates
2 parents 5fcbad4 + 7003204 commit 5f94285

17 files changed

Lines changed: 289 additions & 53 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ yarn-debug.log*
1111
yarn-error.log*
1212
lerna-debug.log*
1313

14+
## Developer Agent stuff`
15+
.agents/
16+
1417
# Diagnostic reports (https://nodejs.org/api/report.html)
1518
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
1619

api-docs/openapi.json

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"openapi": "3.0.2",
33
"info": {
4-
"version": "2.7.1",
4+
"version": "2.7.2",
55
"title": "CVE Services API",
66
"description": "The CVE Services API supports automation tooling for the CVE Program. Credentials are required for most service endpoints. Representatives of <a href='https://www.cve.org/ProgramOrganization/CNAs'>CVE Numbering Authorities (CNAs)</a> should use one of the methods below to obtain credentials: <ul><li>If your organization already has an Organizational Administrator (OA) account for the CVE Services, ask your admin for credentials</li> <li>Contact your Root (<a href='https://www.cve.org/PartnerInformation/ListofPartners/partner/Google'>Google</a>, <a href='https://www.cve.org/PartnerInformation/ListofPartners/partner/INCIBE'>INCIBE</a>, <a href='https://www.cve.org/PartnerInformation/ListofPartners/partner/jpcert'>JPCERT/CC</a>, or <a href='https://www.cve.org/PartnerInformation/ListofPartners/partner/redhat'>Red Hat</a>) or Top-Level Root (<a href='https://www.cve.org/PartnerInformation/ListofPartners/partner/icscert'>CISA ICS</a> or <a href='https://www.cve.org/PartnerInformation/ListofPartners/partner/mitre'>MITRE</a>) to request credentials </ul> <p>CVE data is to be in the JSON 5.2 CVE Record format. Details of the JSON 5.2 schema are located <a href='https://github.com/CVEProject/cve-schema/releases/tag/v5.2.0' target='_blank'>here</a>.</p> <a href='https://cveform.mitre.org/' class='link' target='_blank'>Contact the CVE Services team</a>",
77
"contact": {
@@ -2605,7 +2605,7 @@
26052605
"Registry Organization"
26062606
],
26072607
"summary": "Updates information about the organization specified by short name (accessible Temporarily to Secretariat only)",
2608-
"description": " <h2>Access Control</h2> <p>User must belong to an organization with the <b>Secretariat</b> role temporarily.</p> <p>In the future, only the organization's admin will be able to request changes to its information.</p> <p>With Joint Approval required for the following fields:</p> <h2>Expected Behavior</h2> <b>This endpoint expects a full organization object in the request body.</b> <p><b>Secretariat:</b> Updates any organization's information</p> <p><b>Organization Admin:</b> Requests changes to its organization's information</p> <ul> <li>short_name</li> <li>long_name</li> <li>authority</li> <li>aliases</li> <li>oversees</li> <li>root_or_tlr</li> <li>charter_or_scope</li> <li>product_list</li> <li>disclosure_policy</li> <li>contact_info.poc</li> <li>contact_info.poc_email</li> <li>contact_info.poc_phone</li> <li>contact_info.org_email</li> <li>cna_role_type</li> <li>cna_country</li> <li>vulnerability_advisory_locations</li> <li>advisory_location_require_credentials</li> <li>industry</li> <li>tl_root_start_date</li> <li>is_cna_discussion_list</li> </ul>",
2608+
"description": " <h2>Access Control</h2> <p>User must belong to an organization with the <b>Secretariat</b> role temporarily.</p> <p>In the future, only the organization's admin will be able to request changes to its information.</p> <p>With Joint Approval required for the following fields:</p> <h2>Expected Behavior</h2> <b>This endpoint expects a full organization object in the request body.</b> <p><b>Secretariat:</b> Updates any organization's information</p> <p><b>Organization Admin:</b> Requests changes to its organization's information</p> <ul> <li>short_name</li> <li>long_name</li> <li>authority</li> <li>aliases</li> <li>oversees</li> <li>root_or_tlr</li> <li>charter_or_scope</li> <li>product_list</li> <li>disclosure_policy</li> <li>contact_info.poc</li> <li>contact_info.poc_email</li> <li>contact_info.poc_phone</li> <li>contact_info.org_email</li> <li>partner_role</li> <li>partner_type</li> <li>partner_country</li> <li>vulnerability_advisory_locations</li> <li>advisory_location_require_credentials</li> <li>industry</li> <li>tl_root_start_date</li> <li>is_cna_discussion_list</li> </ul>",
26092609
"operationId": "orgUpdateSingle",
26102610
"parameters": [
26112611
{
@@ -3166,6 +3166,107 @@
31663166
}
31673167
}
31683168
},
3169+
"/registry/org/{shortname}/conversation/{index}": {
3170+
"put": {
3171+
"tags": [
3172+
"Registry Organization"
3173+
],
3174+
"summary": "Update the conversation at the given index for the given organization (accessible to Secretariat or Org Admin)",
3175+
"description": " <h2>Access Control</h2> <p>User must belong to an organization with the <b>Secretariat</b> role or be an <b>Admin</b> of the organization</p> <h2>Expected Behavior</h2> <p><b>Admin User:</b> Allowed to update only the message body of any conversation posted by them</p> <p><b>Secretariat:</b> Allowed to update the message body and/or visibility of any conversation</p>",
3176+
"operationId": "registryUserUpdateConversation",
3177+
"parameters": [
3178+
{
3179+
"name": "shortname",
3180+
"in": "path",
3181+
"required": true,
3182+
"schema": {
3183+
"type": "string"
3184+
},
3185+
"description": "The shortname of the organization"
3186+
},
3187+
{
3188+
"name": "index",
3189+
"in": "path",
3190+
"required": true,
3191+
"schema": {
3192+
"type": "string"
3193+
},
3194+
"description": "The index of the conversation to update"
3195+
},
3196+
{
3197+
"$ref": "#/components/parameters/apiEntityHeader"
3198+
},
3199+
{
3200+
"$ref": "#/components/parameters/apiUserHeader"
3201+
},
3202+
{
3203+
"$ref": "#/components/parameters/apiSecretHeader"
3204+
}
3205+
],
3206+
"responses": {
3207+
"200": {
3208+
"description": "Returns the updated conversation",
3209+
"content": {
3210+
"application/json": {
3211+
"schema": {
3212+
"$ref": "../schemas/conversation/update-conversation-response.json"
3213+
}
3214+
}
3215+
}
3216+
},
3217+
"400": {
3218+
"description": "Bad Request",
3219+
"content": {
3220+
"application/json": {
3221+
"schema": {
3222+
"$ref": "../schemas/errors/bad-request.json"
3223+
}
3224+
}
3225+
}
3226+
},
3227+
"401": {
3228+
"description": "Not Authenticated",
3229+
"content": {
3230+
"application/json": {
3231+
"schema": {
3232+
"$ref": "../schemas/errors/generic.json"
3233+
}
3234+
}
3235+
}
3236+
},
3237+
"403": {
3238+
"description": "Forbidden",
3239+
"content": {
3240+
"application/json": {
3241+
"schema": {
3242+
"$ref": "../schemas/errors/generic.json"
3243+
}
3244+
}
3245+
}
3246+
},
3247+
"404": {
3248+
"description": "Not Found",
3249+
"content": {
3250+
"application/json": {
3251+
"schema": {
3252+
"$ref": "../schemas/errors/generic.json"
3253+
}
3254+
}
3255+
}
3256+
},
3257+
"500": {
3258+
"description": "Internal Server Error",
3259+
"content": {
3260+
"application/json": {
3261+
"schema": {
3262+
"$ref": "../schemas/errors/generic.json"
3263+
}
3264+
}
3265+
}
3266+
}
3267+
}
3268+
}
3269+
},
31693270
"/org": {
31703271
"get": {
31713272
"tags": [

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "cve-services",
33
"author": "Automation Working Group",
4-
"version": "2.7.1",
4+
"version": "2.7.2",
55
"license": "(CC0)",
66
"devDependencies": {
77
"@faker-js/faker": "^7.6.0",

schemas/registry-org/create-registry-org-request.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
"enum": ["CNA", "ADP", "BULK_DOWNLOAD", "SECRETARIAT"]
2828
}
2929
},
30-
"reports_to": {
31-
"type": ["string", "null"],
32-
"description": "UUID of the parent organization, if any"
33-
},
3430
"oversees": {
3531
"type": "array",
3632
"items": {

schemas/registry-org/get-registry-org-response.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,17 @@
105105
"org_email"
106106
]
107107
},
108-
"cna_role_type": {
108+
"partner_role": {
109109
"type": "string",
110-
"description": "Type of CNA role"
110+
"description": "Role of the partner"
111111
},
112-
"cna_country": {
112+
"partner_type": {
113113
"type": "string",
114-
"description": "Country of the CNA"
114+
"description": "Type of the partner"
115+
},
116+
"partner_country": {
117+
"type": "string",
118+
"description": "Country of the partner"
115119
},
116120
"vulnerability_advisory_locations": {
117121
"type": "array",

schemas/registry-org/list-registry-orgs-response.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,17 @@
134134
"org_email"
135135
]
136136
},
137-
"cna_role_type": {
137+
"partner_role": {
138138
"type": "string",
139-
"description": "Type of CNA role"
139+
"description": "Role of the partner"
140140
},
141-
"cna_country": {
141+
"partner_type": {
142142
"type": "string",
143-
"description": "Country of the CNA"
143+
"description": "Type of the partner"
144+
},
145+
"partner_country": {
146+
"type": "string",
147+
"description": "Country of the partner"
144148
},
145149
"vulnerability_advisory_locations": {
146150
"type": "array",

schemas/registry-org/update-registry-org-request.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
},
3939
"required": ["active_roles"]
4040
},
41-
"reports_to": {
42-
"type": ["string", "null"],
43-
"description": "UUID of the parent organization, if any"
44-
},
4541
"oversees": {
4642
"type": "array",
4743
"items": {

src/constants/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function getConstants () {
4444
USER_ROLES: [
4545
'ADMIN'
4646
],
47-
JOINT_APPROVAL_FIELDS: ['short_name', 'long_name', 'authority', 'aliases', 'oversees', 'root_or_tlr', 'charter_or_scope', 'product_list', 'disclosure_policy', 'contact_info.poc', 'contact_info.poc_email', 'contact_info.poc_phone', 'contact_info.org_email', 'cna_role_type', 'cna_country', 'vulnerability_advisory_locations', 'advisory_location_require_credentials', 'industry', 'tl_root_start_date', 'is_cna_discussion_list', 'hard_quota'],
47+
JOINT_APPROVAL_FIELDS: ['short_name', 'long_name', 'authority', 'aliases', 'oversees', 'root_or_tlr', 'charter_or_scope', 'product_list', 'disclosure_policy', 'contact_info.poc', 'contact_info.poc_email', 'contact_info.poc_phone', 'contact_info.org_email', 'partner_role', 'partner_type', 'partner_country', 'vulnerability_advisory_locations', 'advisory_location_require_credentials', 'industry', 'tl_root_start_date', 'is_cna_discussion_list', 'hard_quota'],
4848
JOINT_APPROVAL_FIELDS_LEGACY: ['short_name', 'name', 'authority.active_roles', 'policies.id_quota'],
4949
USER_ROLE_ENUM: {
5050
ADMIN: 'ADMIN'

src/controller/org.controller/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,9 @@ router.put('/registry/org/:shortname',
556556
<li>contact_info.poc_email</li>
557557
<li>contact_info.poc_phone</li>
558558
<li>contact_info.org_email</li>
559-
<li>cna_role_type</li>
560-
<li>cna_country</li>
559+
<li>partner_role</li>
560+
<li>partner_type</li>
561+
<li>partner_country</li>
561562
<li>vulnerability_advisory_locations</li>
562563
<li>advisory_location_require_credentials</li>
563564
<li>industry</li>

src/controller/org.controller/org.middleware.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ function validateCreateOrgParameters () {
6565
'charter_or_scope',
6666
'disclosure_policy',
6767
'product_list',
68-
'reports_to',
6968
'contact_info.poc',
7069
'contact_info.poc_email',
7170
'contact_info.poc_phone',
7271
'contact_info.org_email',
7372
'contact_info.website',
74-
'cna_role_type',
75-
'cna_country',
73+
'partner_role',
74+
'partner_type',
75+
'partner_country',
7676
'industry'
7777
])
7878
.default('')
@@ -88,7 +88,7 @@ function validateCreateOrgParameters () {
8888
.isArray()
8989
.isInt({ min: CONSTANTS.MONGOOSE_VALIDATION.Org_policies_id_quota_min, max: CONSTANTS.MONGOOSE_VALIDATION.Org_policies_id_quota_max })
9090
.withMessage(errorMsgs.ID_QUOTA),
91-
...isNotAllowed('name', 'users', 'contact_info.admins', 'in_use', 'created', 'last_updated', 'policies.id_quota')
91+
...isNotAllowed('reports_to', 'name', 'users', 'contact_info.admins', 'in_use', 'created', 'last_updated', 'policies.id_quota')
9292
]
9393
} else {
9494
validations = [
@@ -128,15 +128,15 @@ function validateCreateOrgParameters () {
128128
'charter_or_scope',
129129
'disclosure_policy',
130130
'product_list',
131-
'reports_to',
132131
'contact_info.poc',
133132
'contact_info.poc_email',
134133
'contact_info.poc_phone',
135134
'contact_info.org_email',
136135
'contact_info.additional_contact_users',
137136
'contact_info.website',
138-
'cna_role_type',
139-
'cna_country',
137+
'partner_role',
138+
'partner_type',
139+
'partner_country',
140140
'vulnerability_advisory_locations',
141141
'advisory_location_require_credentials',
142142
'industry',
@@ -214,14 +214,14 @@ function validateUpdateOrgParameters () {
214214
'charter_or_scope',
215215
'disclosure_policy',
216216
'product_list',
217-
'reports_to',
218217
'contact_info.poc',
219218
'contact_info.poc_email',
220219
'contact_info.poc_phone',
221220
'contact_info.org_email',
222221
'contact_info.website',
223-
'cna_role_type',
224-
'cna_country',
222+
'partner_role',
223+
'partner_type',
224+
'partner_country',
225225
'vulnerability_advisory_locations',
226226
'advisory_location_require_credentials',
227227
'industry',
@@ -302,15 +302,15 @@ const QUERY_PARAMETERS = {
302302
'disclosure_policy',
303303
'product_list',
304304
'oversees',
305-
'reports_to',
306305
'contact_info',
307306
'contact_info.poc',
308307
'contact_info.poc_email',
309308
'contact_info.poc_phone',
310309
'contact_info.org_email',
311310
'contact_info.website',
312-
'cna_role_type',
313-
'cna_country',
311+
'partner_role',
312+
'partner_type',
313+
'partner_country',
314314
'vulnerability_advisory_locations',
315315
'advisory_location_require_credentials',
316316
'industry',

0 commit comments

Comments
 (0)