Skip to content

196 csaf 2.1 optional test 6.2.28 #258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 17, 2025
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
2 changes: 1 addition & 1 deletion csaf_2_1/mandatoryTests/mandatoryTest_6_1_39.js
Original file line number Diff line number Diff line change
@@ -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()

Expand Down
2 changes: 1 addition & 1 deletion csaf_2_1/mandatoryTests/mandatoryTest_6_1_40.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
NIL_UUID,
NO_SHARING_ALLOWED,
PUBLIC,
} from './sharingGroup.js'
} from '../sharingGroup.js'

const ajv = new Ajv()

Expand Down
2 changes: 1 addition & 1 deletion csaf_2_1/mandatoryTests/mandatoryTest_6_1_41.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
NIL_UUID,
NO_SHARING_ALLOWED,
PUBLIC,
} from './sharingGroup.js'
} from '../sharingGroup.js'

const ajv = new Ajv()

Expand Down
1 change: 1 addition & 0 deletions csaf_2_1/recommendedTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
52 changes: 52 additions & 0 deletions csaf_2_1/recommendedTests/recommendedTest_6_2_28.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import Ajv from 'ajv/dist/jtd.js'
import { MAX_UUID } from '../sharingGroup.js'

const ajv = new Ajv()

const inputSchema = /** @type {const} */ ({
additionalProperties: true,
properties: {
document: {
additionalProperties: true,
properties: {
distribution: {
additionalProperties: true,
properties: {
sharing_group: {
additionalProperties: true,
properties: {
id: { 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 recommendedTest_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({
instancePath: '/document/distribution/sharing_group/id',
message: 'The Max UUID should not be used as sharing group id.',
})
}

return ctx
}
File renamed without changes.
1 change: 0 additions & 1 deletion tests/csaf_2_1/oasis.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const excluded = [
'6.2.25',
'6.2.26',
'6.2.27',
'6.2.28',
'6.2.29',
'6.2.30',
'6.2.31',
Expand Down