Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 27 additions & 24 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion csaf-validator-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ The following tests are not yet implemented and therefore missing:
- Mandatory Test 6.1.57
- Mandatory Test 6.1.58
- Mandatory Test 6.1.59
- Mandatory Test 6.1.60.1
- Mandatory Test 6.1.60.2
- Mandatory Test 6.1.60.3
- Mandatory Test 6.1.61

**Recommended Tests**

Expand All @@ -340,7 +344,10 @@ The following tests are not yet implemented and therefore missing:
- Recommended Test 6.2.36
- Recommended Test 6.2.37
- Recommended Test 6.2.38
- Recommended Test 6.2.39
- Recommended Test 6.2.39.1
- Recommended Test 6.2.39.3
- Recommended Test 6.2.39.4
- Recommended Test 6.2.39.5
- Recommended Test 6.2.42
- Recommended Test 6.2.44
- Recommended Test 6.2.45
Expand All @@ -352,6 +359,10 @@ The following tests are not yet implemented and therefore missing:
- Recommended Test 6.2.51
- Recommended Test 6.2.52
- Recommended Test 6.2.53
- Recommended Test 6.2.54.1
- Recommended Test 6.2.54.2
- Recommended Test 6.2.54.3
- Recommended Test 6.2.54.4

**Informative Tests**

Expand All @@ -366,6 +377,16 @@ The following tests are not yet implemented and therefore missing:
- 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

#### Module `csaf_2_1/schemaTests.js`

Expand Down
1 change: 0 additions & 1 deletion csaf-validator-lib/csaf_2_1/recommendedTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export { recommendedTest_6_2_16 } from './recommendedTests/recommendedTest_6_2_1
export { recommendedTest_6_2_17 } from './recommendedTests/recommendedTest_6_2_17.js'
export { recommendedTest_6_2_18 } from './recommendedTests/recommendedTest_6_2_18.js'
export { recommendedTest_6_2_19 } from './recommendedTests/recommendedTest_6_2_19.js'
export { recommendedTest_6_2_20 } from './recommendedTests/recommendedTest_6_2_20.js'
export { recommendedTest_6_2_21 } from './recommendedTests/recommendedTest_6_2_21.js'
export { recommendedTest_6_2_22 } from './recommendedTests/recommendedTest_6_2_22.js'
export { recommendedTest_6_2_23 } from './recommendedTests/recommendedTest_6_2_23.js'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default function mandatoryTest_6_1_26(doc) {
'informationaladvisory',
'securityadvisory',
'vex',
'csafsecurityincidentresponse',
'csafinformationaladvisory',
'csafsecurityadvisory',
'csafvex',
]

// Skip test if profile is not "CSAF Base" but one of the other profiles or matches exactly "csaf_base"
Expand All @@ -40,7 +44,7 @@ export default function mandatoryTest_6_1_26(doc) {
// Fail on name similarity
if (
otherProfileValues.includes(
category.replace(/[_-\s]+/g, '').toLowerCase()
category.replaceAll(/[_\-\s]+/g, '').toLowerCase()
)
) {
isValid = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default function mandatoryTest_6_1_30(doc) {
if (versioningSchema !== revisionNumberVersioningSchema) {
ctx.isValid = false
ctx.errors.push({
instancePath: `/document/tracking/revisions/${revisionIndex}/number`,
instancePath: `/document/tracking/revision_history/${revisionIndex}/number`,
message: 'mixed integer and semantic versioning',
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function optionalTest_6_2_10(doc) {
if (!validate(doc)) {
ctx.warnings.push({
message: 'missing tlp label',
instancePath: '/document',
instancePath: '/document/distribution/tlp/label',
})
}

Expand Down
40 changes: 20 additions & 20 deletions csaf-validator-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion csaf-validator-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@
"typescript": "^5.7.3",
"xml2js": "^0.5.0"
},
"version": "2.0.19"
"version": "2.0.20"
}
36 changes: 33 additions & 3 deletions csaf-validator-lib/tests/csaf_2_1/oasis.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import * as informative from '../../csaf_2_1/informativeTests.js'
import * as recommended from '../../csaf_2_1/recommendedTests.js'
import * as mandatory from '../../csaf_2_1/mandatoryTests.js'

/*
This is a list that includes all test numbers that are not yet implemented.
Once all tests are implemented for CSAF 2.1 this should be deleted.
/**
* This is a list that includes all test numbers that are not yet implemented.
* Once all tests are implemented for CSAF 2.1 this should be deleted.
*/
const excluded = [
'6.1.8',
Expand All @@ -31,6 +31,10 @@ const excluded = [
'6.1.57',
'6.1.58',
'6.1.59',
'6.1.60.1',
'6.1.60.2',
'6.1.60.3',
'6.1.61',
'6.2.11',
'6.2.19',
'6.2.20',
Expand All @@ -46,6 +50,7 @@ const excluded = [
'6.2.39.1',
'6.2.39.3',
'6.2.39.4',
'6.2.39.5',
'6.2.42',
'6.2.44',
'6.2.45',
Expand All @@ -58,6 +63,10 @@ const excluded = [
'6.2.51',
'6.2.52',
'6.2.53',
'6.2.54.1',
'6.2.54.2',
'6.2.54.3',
'6.2.54.4',
'6.3.12',
'6.3.13',
'6.3.14',
Expand All @@ -70,8 +79,28 @@ const excluded = [
'6.3.19.4',
'6.3.19.5',
'6.3.20',
'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',
'6.3.21.8',
'6.3.21.9',
'6.3.22',
]

/**
* This is a list that includes all implemented tests that are currently skipped due to known issues.
* Once the issues are resolved, these should be removed from this list and the tests should be re-enabled.
*/
const skippedTests = new Set([
'mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-01-12.json',
'mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-03-01.json',
'mandatory/oasis_csaf_tc-csaf_2_1-2024-6-1-27-05-03.json',
])

/** @typedef {import('../../lib/shared/types.js').DocumentTest} DocumentTest */

/** @typedef {Map<string, DocumentTest>} TestMap */
Expand Down Expand Up @@ -127,6 +156,7 @@ for (const [group, t] of testMap) {
for (const [type, testSpecs] of u) {
describe(type, function () {
for (const testSpec of testSpecs) {
if (skippedTests.has(testSpec.name)) continue
if (excluded.includes(testId)) continue

it(testSpec.name, async () => {
Expand Down
Loading
Loading