From ce1fcd17bb0289ef63e1a64ee2202e3a08b5718c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Burgd=C3=B6rfer?= Date: Thu, 27 Feb 2025 16:36:40 +0100 Subject: [PATCH 1/5] feat: add mandatory test 6.1.37 --- tests/csaf_2_1/oasis.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/csaf_2_1/oasis.js b/tests/csaf_2_1/oasis.js index 88c5fff7..b5a73bc7 100644 --- a/tests/csaf_2_1/oasis.js +++ b/tests/csaf_2_1/oasis.js @@ -29,7 +29,6 @@ const excluded = [ '6.1.27.18', '6.1.27.19', '6.1.36', - '6.1.37', '6.1.42', '6.1.43', '6.1.44', From 4a38f9843ba69307059d6dd3f26fad7d65a45d03 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 19 Apr 2025 15:27:20 +0200 Subject: [PATCH 2/5] feat: add optional test 6.2.28 --- csaf_2_1/optionalTests.js | 0 .../recommendedTests/optionalTest_6_2_28.js | 54 +++++++++++++++++++ tests/csaf_2_1/oasis.js | 1 - 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 csaf_2_1/optionalTests.js create mode 100644 csaf_2_1/recommendedTests/optionalTest_6_2_28.js diff --git a/csaf_2_1/optionalTests.js b/csaf_2_1/optionalTests.js new file mode 100644 index 00000000..e69de29b diff --git a/csaf_2_1/recommendedTests/optionalTest_6_2_28.js b/csaf_2_1/recommendedTests/optionalTest_6_2_28.js new file mode 100644 index 00000000..ed467666 --- /dev/null +++ b/csaf_2_1/recommendedTests/optionalTest_6_2_28.js @@ -0,0 +1,54 @@ +import Ajv from 'ajv/dist/jtd.js' + +const ajv = new Ajv() + +const MAX_UUID = 'ffffffff-ffff-ffff-ffff-ffffffffffff' + +const inputSchema = /** @type {const} */ ({ + additionalProperties: true, + properties: { + document: { + additionalProperties: true, + properties: { + distribution: { + additionalProperties: true, + properties: { + sharing_group: { + additionalProperties: true, + properties: { + id: { type: 'string' }, + name: { type: 'string' }, + }, + }, + }, + }, + }, + }, + }, +}) +const validateInput = ajv.compile(inputSchema) + +/** + * Test for the optional test 6.2.28 + * The Max UUID should not be used for the sharing group id. + * @param {any} doc + */ +export function optionalTest_6_2_28(doc) { + const ctx = { + warnings: + /** @type {Array<{ instancePath: string; message: string }>} */ ([]), + } + + if (!validateInput(doc)) { + return ctx + } + const sharingGroup = doc.document.distribution.sharing_group + if (sharingGroup.id === MAX_UUID) { + ctx.warnings.push({ + message: 'The MAX UUID should not be used for the sharing group id.', + instancePath: `/document/distribution/sharing_group/id`, + }) + } + + return ctx +} diff --git a/tests/csaf_2_1/oasis.js b/tests/csaf_2_1/oasis.js index b5a73bc7..47c8933c 100644 --- a/tests/csaf_2_1/oasis.js +++ b/tests/csaf_2_1/oasis.js @@ -52,7 +52,6 @@ const excluded = [ '6.2.25', '6.2.26', '6.2.27', - '6.2.28', '6.2.29', '6.2.30', '6.2.31', From 9af2c5450f40efc9afdaff5d49ea4440f52dc8a6 Mon Sep 17 00:00:00 2001 From: Benjamin Date: Fri, 25 Apr 2025 09:54:33 +0200 Subject: [PATCH 3/5] feat: used sharingGroup.js for the Max UUID --- csaf_2_1/mandatoryTests/mandatoryTest_6_1_39.js | 2 +- csaf_2_1/mandatoryTests/mandatoryTest_6_1_40.js | 2 +- csaf_2_1/mandatoryTests/mandatoryTest_6_1_41.js | 2 +- csaf_2_1/recommendedTests/optionalTest_6_2_28.js | 7 +++---- csaf_2_1/{mandatoryTests => }/sharingGroup.js | 0 5 files changed, 6 insertions(+), 7 deletions(-) rename csaf_2_1/{mandatoryTests => }/sharingGroup.js (100%) diff --git a/csaf_2_1/mandatoryTests/mandatoryTest_6_1_39.js b/csaf_2_1/mandatoryTests/mandatoryTest_6_1_39.js index 3e0aec2e..0fc751f2 100644 --- a/csaf_2_1/mandatoryTests/mandatoryTest_6_1_39.js +++ b/csaf_2_1/mandatoryTests/mandatoryTest_6_1_39.js @@ -1,5 +1,5 @@ import Ajv from 'ajv/dist/jtd.js' -import { MAX_UUID, NIL_UUID } from './sharingGroup.js' +import { MAX_UUID, NIL_UUID } from '../sharingGroup.js' const ajv = new Ajv() diff --git a/csaf_2_1/mandatoryTests/mandatoryTest_6_1_40.js b/csaf_2_1/mandatoryTests/mandatoryTest_6_1_40.js index 2d697be7..21e35729 100644 --- a/csaf_2_1/mandatoryTests/mandatoryTest_6_1_40.js +++ b/csaf_2_1/mandatoryTests/mandatoryTest_6_1_40.js @@ -4,7 +4,7 @@ import { NIL_UUID, NO_SHARING_ALLOWED, PUBLIC, -} from './sharingGroup.js' +} from '../sharingGroup.js' const ajv = new Ajv() diff --git a/csaf_2_1/mandatoryTests/mandatoryTest_6_1_41.js b/csaf_2_1/mandatoryTests/mandatoryTest_6_1_41.js index 3835e81d..1079028a 100644 --- a/csaf_2_1/mandatoryTests/mandatoryTest_6_1_41.js +++ b/csaf_2_1/mandatoryTests/mandatoryTest_6_1_41.js @@ -4,7 +4,7 @@ import { NIL_UUID, NO_SHARING_ALLOWED, PUBLIC, -} from './sharingGroup.js' +} from '../sharingGroup.js' const ajv = new Ajv() diff --git a/csaf_2_1/recommendedTests/optionalTest_6_2_28.js b/csaf_2_1/recommendedTests/optionalTest_6_2_28.js index ed467666..c507c09e 100644 --- a/csaf_2_1/recommendedTests/optionalTest_6_2_28.js +++ b/csaf_2_1/recommendedTests/optionalTest_6_2_28.js @@ -1,9 +1,8 @@ import Ajv from 'ajv/dist/jtd.js' +import { MAX_UUID } from '../sharingGroup.js' const ajv = new Ajv() -const MAX_UUID = 'ffffffff-ffff-ffff-ffff-ffffffffffff' - const inputSchema = /** @type {const} */ ({ additionalProperties: true, properties: { @@ -45,8 +44,8 @@ export function optionalTest_6_2_28(doc) { const sharingGroup = doc.document.distribution.sharing_group if (sharingGroup.id === MAX_UUID) { ctx.warnings.push({ - message: 'The MAX UUID should not be used for the sharing group id.', - instancePath: `/document/distribution/sharing_group/id`, + instancePath: '/document/distribution/sharing_group/id', + message: 'The Max UUID should not be used as sharing group id.', }) } diff --git a/csaf_2_1/mandatoryTests/sharingGroup.js b/csaf_2_1/sharingGroup.js similarity index 100% rename from csaf_2_1/mandatoryTests/sharingGroup.js rename to csaf_2_1/sharingGroup.js From 9150b3e4200a403c5a28d0a5a977f127b24ce708 Mon Sep 17 00:00:00 2001 From: bendo-eXX Date: Fri, 6 Jun 2025 17:57:09 +0200 Subject: [PATCH 4/5] rename Test to recommendedTest_6_2_28.js --- csaf_2_1/optionalTests.js | 0 csaf_2_1/recommendedTests.js | 1 + .../{optionalTest_6_2_28.js => recommendedTest_6_2_28.js} | 2 +- tests/csaf_2_1/oasis.js | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) delete mode 100644 csaf_2_1/optionalTests.js rename csaf_2_1/recommendedTests/{optionalTest_6_2_28.js => recommendedTest_6_2_28.js} (96%) diff --git a/csaf_2_1/optionalTests.js b/csaf_2_1/optionalTests.js deleted file mode 100644 index e69de29b..00000000 diff --git a/csaf_2_1/recommendedTests.js b/csaf_2_1/recommendedTests.js index 2d0d83f3..81f003bb 100644 --- a/csaf_2_1/recommendedTests.js +++ b/csaf_2_1/recommendedTests.js @@ -27,4 +27,5 @@ export { recommendedTest_6_2_8 } from './recommendedTests/recommendedTest_6_2_8. export { recommendedTest_6_2_9 } from './recommendedTests/recommendedTest_6_2_9.js' export { recommendedTest_6_2_3 } from './recommendedTests/recommendedTest_6_2_3.js' export { recommendedTest_6_2_22 } from './recommendedTests/recommendedTest_6_2_22.js' +export { recommendedTest_6_2_28 } from './recommendedTests/recommendedTest_6_2_28.js' export { recommendedTest_6_2_38 } from './recommendedTests/recommendedTest_6_2_38.js' diff --git a/csaf_2_1/recommendedTests/optionalTest_6_2_28.js b/csaf_2_1/recommendedTests/recommendedTest_6_2_28.js similarity index 96% rename from csaf_2_1/recommendedTests/optionalTest_6_2_28.js rename to csaf_2_1/recommendedTests/recommendedTest_6_2_28.js index c507c09e..9cf492dc 100644 --- a/csaf_2_1/recommendedTests/optionalTest_6_2_28.js +++ b/csaf_2_1/recommendedTests/recommendedTest_6_2_28.js @@ -32,7 +32,7 @@ const validateInput = ajv.compile(inputSchema) * The Max UUID should not be used for the sharing group id. * @param {any} doc */ -export function optionalTest_6_2_28(doc) { +export function recommendedTest_6_2_28(doc) { const ctx = { warnings: /** @type {Array<{ instancePath: string; message: string }>} */ ([]), diff --git a/tests/csaf_2_1/oasis.js b/tests/csaf_2_1/oasis.js index 47c8933c..89a6f6aa 100644 --- a/tests/csaf_2_1/oasis.js +++ b/tests/csaf_2_1/oasis.js @@ -29,6 +29,7 @@ const excluded = [ '6.1.27.18', '6.1.27.19', '6.1.36', + '6.1.37', '6.1.42', '6.1.43', '6.1.44', From 7258aa8735d22eeb27f4a12b28295d207a3a8f5a Mon Sep 17 00:00:00 2001 From: bendo-eXX Date: Fri, 13 Jun 2025 13:21:46 +0200 Subject: [PATCH 5/5] fix: remove name from the schema --- csaf_2_1/recommendedTests/recommendedTest_6_2_28.js | 1 - 1 file changed, 1 deletion(-) diff --git a/csaf_2_1/recommendedTests/recommendedTest_6_2_28.js b/csaf_2_1/recommendedTests/recommendedTest_6_2_28.js index 9cf492dc..9231bf67 100644 --- a/csaf_2_1/recommendedTests/recommendedTest_6_2_28.js +++ b/csaf_2_1/recommendedTests/recommendedTest_6_2_28.js @@ -16,7 +16,6 @@ const inputSchema = /** @type {const} */ ({ additionalProperties: true, properties: { id: { type: 'string' }, - name: { type: 'string' }, }, }, },