From 0c36f6c0c479d91c0d4cdab5d28502e5c7f0fb31 Mon Sep 17 00:00:00 2001 From: bendo-eXX Date: Wed, 22 Jul 2026 14:50:23 +0200 Subject: [PATCH] feat(CSAF2.1): add informativeTest_6_3_21_4.js --- README.md | 42 +++++++++---------- csaf_2_1/informativeTests.js | 1 + .../informativeTest_6_3_21_4.js | 26 ++++++++++++ tests/csaf_2_1/oasis.js | 1 - 4 files changed, 48 insertions(+), 22 deletions(-) create mode 100644 csaf_2_1/informativeTests/informativeTest_6_3_21_4.js diff --git a/README.md b/README.md index bd3e87bd..89484221 100644 --- a/README.md +++ b/README.md @@ -357,27 +357,26 @@ The following tests are not yet implemented and therefore missing: **Informative Tests** -- Informative Test 6.2.13 -- Informative Test 6.2.14 -- Informative Test 6.2.15 -- Informative Test 6.2.16 -- Informative Test 6.2.17 -- Informative Test 6.2.19.1 -- Informative Test 6.2.19.2 -- Informative Test 6.2.19.3 -- Informative Test 6.2.19.4 -- Informative Test 6.2.19.5 -- Informative Test 6.2.20 -- Informative Test 6.2.21.1 -- Informative Test 6.2.21.2 -- Informative Test 6.2.21.3 -- Informative Test 6.2.21.4 -- Informative Test 6.2.21.5 -- Informative Test 6.2.21.6 -- Informative Test 6.2.21.7 -- Informative Test 6.2.21.8 -- Informative Test 6.2.21.9 -- Informative Test 6.2.22 +- Informative Test 6.3.13 +- Informative Test 6.3.14 +- Informative Test 6.3.15 +- Informative Test 6.3.16 +- Informative Test 6.3.17 +- Informative Test 6.3.19.1 +- Informative Test 6.3.19.2 +- Informative Test 6.3.19.3 +- Informative Test 6.3.19.4 +- Informative Test 6.3.19.5 +- Informative Test 6.3.20 +- Informative Test 6.3.21.1 +- Informative Test 6.3.21.2 +- Informative Test 6.3.21.3 +- Informative Test 6.3.21.5 +- Informative Test 6.3.21.6 +- Informative Test 6.3.21.7 +- Informative Test 6.3.21.8 +- Informative Test 6.3.21.9 +- Informative Test 6.3.22 #### Module `csaf_2_1/schemaTests.js` @@ -523,6 +522,7 @@ export const informativeTest_6_3_10: DocumentTest export const informativeTest_6_3_11: DocumentTest export const informativeTest_6_3_12: DocumentTest export const informativeTest_6_3_18: DocumentTest +export const informativeTest_6_3_21_4: DocumentTest ``` [(back to top)](#bsi-csaf-validator-lib) diff --git a/csaf_2_1/informativeTests.js b/csaf_2_1/informativeTests.js index e15078a9..3cb240ad 100644 --- a/csaf_2_1/informativeTests.js +++ b/csaf_2_1/informativeTests.js @@ -13,3 +13,4 @@ export { informativeTest_6_3_4 } from './informativeTests/informativeTest_6_3_4. export { informativeTest_6_3_5 } from './informativeTests/informativeTest_6_3_5.js' export { informativeTest_6_3_12 } from './informativeTests/informativeTest_6_3_12.js' export { informativeTest_6_3_18 } from './informativeTests/informativeTest_6_3_18.js' +export { informativeTest_6_3_21_4 } from './informativeTests/informativeTest_6_3_21_4.js' diff --git a/csaf_2_1/informativeTests/informativeTest_6_3_21_4.js b/csaf_2_1/informativeTests/informativeTest_6_3_21_4.js new file mode 100644 index 00000000..819b1239 --- /dev/null +++ b/csaf_2_1/informativeTests/informativeTest_6_3_21_4.js @@ -0,0 +1,26 @@ +import { walkPath } from '../../lib/walkPaths.js' + +/** + * This implements the informative test 6.3.21.4 of the CSAF 2.1 standard. + * @param {any} doc + * @returns + */ +export async function informativeTest_6_3_21_4(doc) { + const ctx = { + infos: /** @type {Array<{ message: string; instancePath: string }>} */ ([]), + } + + await walkPath( + doc, + '/product_tree/branches[*]/product/x_extensions', + async (instancePath) => { + ctx.infos.push({ + instancePath, + message: + 'The element "x_extensions" exists in a path that starts with "$.product_tree.branches".', + }) + } + ) + + return ctx +} diff --git a/tests/csaf_2_1/oasis.js b/tests/csaf_2_1/oasis.js index ffe51ad4..ee18e8a3 100644 --- a/tests/csaf_2_1/oasis.js +++ b/tests/csaf_2_1/oasis.js @@ -64,7 +64,6 @@ const excluded = [ '6.3.21.1', '6.3.21.2', '6.3.21.3', - '6.3.21.4', '6.3.21.5', '6.3.21.6', '6.3.21.7',