Skip to content

convertRegistryToLegacy uses registryOrg?.modified (not last_updated) #1639

@ElectricNroff

Description

@ElectricNroff

convertRegistryToLegacy (registryOrg) {
return {
name: registryOrg?.long_name ?? null,
short_name: registryOrg?.short_name ?? null,
UUID: registryOrg?.UUID ?? null,
authority: {
active_roles: registryOrg?.authority || ['CNA']
},
policies: {
id_quota: registryOrg?.hard_quota ?? null
},
time: {
created: registryOrg?.created ?? null,
modified: registryOrg?.modified ?? null

accesses seven properties of registryOrg: long_name, short_name, UUID, authority, hard_quota, created, and modified. However,
const schema = {
_id: false,
UUID: String,
long_name: String,
short_name: String,
aliases: [String],
authority: [String],
root_or_tlr: Boolean,
reports_to: String,
users: { type: [String], set: toUndefined },
admins: [String],
contact_info: {
additional_contact_users: [String],
poc: String,
poc_email: String,
poc_phone: String,
org_email: String,
website: String
},
cna_role_type: String,
cna_country: String,
vulnerability_advisory_locations: [String],
advisory_location_require_credentials: Boolean,
industry: String,
tl_root_start_date: Date,
is_cna_discussion_list: Boolean,
in_use: Boolean,
created: Date,
last_updated: Date
}

has last_updated instead of modified - and last_updated seems to be intended because of the conversion in the opposite direction, i.e., last_updated: legacyOrg?.time?.modified in convertLegacyToRegistry.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

In Review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions