Skip to content

Commit 353f378

Browse files
authored
chore: harden schema validators (CycloneDX#859)
<!-- Thank you for taking the time to develop and contribute a core enhancement or fix for a defect! We kindly request that you create pull requests only for things that have been discussed in a ticket first; exceptions may be made for spelling or grammar fixes. Read more about the process here: https://cyclonedx.org/participate/standardization-process/#working-model Please have the related ticket/issue ID ready. If there is none, feel free to create a new ticket: https://github.com/CycloneDX/specification/issues/new/choose --> <!-- Please provide a brief description of what this pull request intends to do and which ticket it fixes/closes. Example: > As discussed in ticket CycloneDX#485, this PR adds Streebog to the hash algorithm enum. > > fixes CycloneDX#485 In case this is for a spelling or grammar improvement, please provide a brief description. Example: > Fixe typo: color(AE) -> colour(BE) -->
2 parents b29918c + ecd4f22 commit 353f378

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

tools/src/test/js/json-schema-functional-tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const ajv = new Ajv({
5656
strict: false,
5757
validateFormats: true,
5858
addUsedSchema: false,
59+
loadSchema: (uri) => { throw new Error(`Remote schemas are disabled: ${uri}`) },
5960
schemas: {
6061
'http://cyclonedx.org/schema/spdx.schema.json': spdxSchema,
6162
'http://cyclonedx.org/schema/jsf-0.82.schema.json': jsfSchema,

tools/src/test/js/json-schema-lint-tests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function getAjv(strict) {
5252
addUsedSchema: false,
5353
allowUnionTypes: false,
5454
keywords: ["meta:enum"],
55+
loadSchema: (uri) => { throw new Error(`Remote schemas are disabled: ${uri}`) },
5556
schemas: {
5657
'http://cyclonedx.org/schema/spdx.schema.json': spdxSchema,
5758
'http://cyclonedx.org/schema/jsf-0.82.schema.json': jsfSchema,

0 commit comments

Comments
 (0)