From febbadf751ad5dff69b0db9d9f7ff0824e228e05 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Tue, 2 May 2023 13:46:24 -0700 Subject: [PATCH 1/5] Update the sarif schema file The version we were using is quite old. Copied the latest from https://github.com/oasis-tcs/sarif-spec/blob/123e95847b13fbdd4cbe2120fa5e33355d4a042b/Schemata/sarif-schema-2.1.0.json I do not think the sarif spec will be changing any more without an explicit version update, so this is fine for now. --- ....0_schema.json => sarif-schema-2.1.0.json} | 114 ++++++++++++------ src/upload-lib.ts | 3 +- 2 files changed, 78 insertions(+), 39 deletions(-) rename src/{sarif_v2.1.0_schema.json => sarif-schema-2.1.0.json} (96%) diff --git a/src/sarif_v2.1.0_schema.json b/src/sarif-schema-2.1.0.json similarity index 96% rename from src/sarif_v2.1.0_schema.json rename to src/sarif-schema-2.1.0.json index 41b12d4af7..5020cc1668 100644 --- a/src/sarif_v2.1.0_schema.json +++ b/src/sarif-schema-2.1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", + "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema", "$id": "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json", "description": "Static Analysis Results Format (SARIF) Version 2.1.0 JSON Schema: a standard format for the output of static analysis tools.", @@ -15,13 +15,15 @@ "version": { "description": "The SARIF format version of this log file.", - "enum": [ "2.1.0" ] + "enum": [ "2.1.0" ], + "type": "string" }, "runs": { "description": "The set of runs contained in this log file.", - "type": "array", + "type": [ "array", "null" ], "minItems": 0, + "uniqueItems": false, "items": { "$ref": "#/definitions/run" } @@ -180,7 +182,8 @@ "userSpecifiedConfiguration", "toolSpecifiedConfiguration", "debugOutputFile" - ] + ], + "type": "string" } }, @@ -241,6 +244,7 @@ "description": "An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.", "type": "array", "minItems": 1, + "uniqueItems": false, "items": { "$ref": "#/definitions/replacement" } @@ -382,6 +386,7 @@ "description": "An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.", "type": "array", "minItems": 1, + "uniqueItems": false, "items": { "$ref": "#/definitions/threadFlow" } @@ -556,6 +561,7 @@ "description": "An array of exception objects each of which is considered a cause of this exception.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/exception" @@ -583,17 +589,18 @@ "version": { "description": "The SARIF format version of this external properties object.", - "enum": [ "2.1.0" ] + "enum": [ "2.1.0" ], + "type": "string" }, "guid": { - "description": "A stable, unique identifer for this external properties object, in the form of a GUID.", + "description": "A stable, unique identifier for this external properties object, in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, "runGuid": { - "description": "A stable, unique identifer for the run associated with this external properties object, in the form of a GUID.", + "description": "A stable, unique identifier for the run associated with this external properties object, in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -633,6 +640,7 @@ "description": "Describes the invocation of the analysis tool that will be merged with a separate run.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/invocation" @@ -665,6 +673,7 @@ "description": "An array of result objects that will be merged with a separate run.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/result" @@ -724,6 +733,7 @@ "description": "Addresses that will be merged with a separate run.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/address" @@ -771,7 +781,7 @@ }, "guid": { - "description": "A stable, unique identifer for the external property file in the form of a GUID.", + "description": "A stable, unique identifier for the external property file in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -1079,6 +1089,7 @@ "description": "The sequences of edges traversed by this graph traversal.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/edgeTraversal" @@ -1111,6 +1122,7 @@ "description": "An array of strings, containing in order the command line arguments passed to the tool from the operating system.", "type": "array", "minItems": 0, + "uniqueItems": false, "items": { "type": "string" } @@ -1127,13 +1139,13 @@ }, "startTimeUtc": { - "description": "The Coordinated Universal Time (UTC) date and time at which the run started. See \"Date/time properties\" in the SARIF spec for the required format.", + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation started. See \"Date/time properties\" in the SARIF spec for the required format.", "type": "string", "format": "date-time" }, "endTimeUtc": { - "description": "The Coordinated Universal Time (UTC) date and time at which the run ended. See \"Date/time properties\" in the SARIF spec for the required format.", + "description": "The Coordinated Universal Time (UTC) date and time at which the invocation ended. See \"Date/time properties\" in the SARIF spec for the required format.", "type": "string", "format": "date-time" }, @@ -1169,6 +1181,7 @@ "description": "A list of runtime conditions detected by the tool during the analysis.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/notification" @@ -1179,6 +1192,7 @@ "description": "A list of conditions detected by the tool that are relevant to the tool's configuration.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/notification" @@ -1211,27 +1225,27 @@ }, "machine": { - "description": "The machine that hosted the analysis tool run.", + "description": "The machine on which the invocation occurred.", "type": "string" }, "account": { - "description": "The account that ran the analysis tool.", + "description": "The account under which the invocation occurred.", "type": "string" }, "processId": { - "description": "The process id for the analysis tool run.", + "description": "The id of the process in which the invocation occurred.", "type": "integer" }, "executableLocation": { - "description": "An absolute URI specifying the location of the analysis tool's executable.", + "description": "An absolute URI specifying the location of the executable that was invoked.", "$ref": "#/definitions/artifactLocation" }, "workingDirectory": { - "description": "The working directory for the analysis tool run.", + "description": "The working directory for the invocation.", "$ref": "#/definitions/artifactLocation" }, @@ -1442,6 +1456,7 @@ "description": "An array of strings to substitute into the message string.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "type": "string" @@ -1551,7 +1566,8 @@ "level": { "description": "A value specifying the severity level of the notification.", "default": "warning", - "enum": [ "none", "note", "warning", "error" ] + "enum": [ "none", "note", "warning", "error" ], + "type": "string" }, "threadId": { @@ -1762,7 +1778,13 @@ "properties": { "description": "Key/value pairs that provide additional information about the region.", "$ref": "#/definitions/propertyBag" - } + }, + + "anyOf": [ + { "required": [ "startLine" ] }, + { "required": [ "charOffset" ] }, + { "required": [ "byteOffset" ] } + ] } }, @@ -1813,7 +1835,7 @@ }, "guid": { - "description": "A unique identifer for the reporting descriptor in the form of a GUID.", + "description": "A unique identifier for the reporting descriptor in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -1912,7 +1934,8 @@ "level": { "description": "Specifies the failure level for the report.", "default": "warning", - "enum": [ "none", "note", "warning", "error" ] + "enum": [ "none", "note", "warning", "error" ], + "type": "string" }, "rank": { @@ -2017,7 +2040,7 @@ "properties": { "ruleId": { - "description": "The stable, unique identifier of the rule, if any, to which this notification is relevant. This member can be used to retrieve rule metadata from the rules dictionary, if it exists.", + "description": "The stable, unique identifier of the rule, if any, to which this result is relevant.", "type": "string" }, @@ -2036,13 +2059,15 @@ "kind": { "description": "A value that categorizes results by evaluation state.", "default": "fail", - "enum": [ "notApplicable", "pass", "fail", "review", "open", "informational" ] + "enum": [ "notApplicable", "pass", "fail", "review", "open", "informational" ], + "type": "string" }, "level": { "description": "A value specifying the severity level of the result.", "default": "warning", - "enum": [ "none", "note", "warning", "error" ] + "enum": [ "none", "note", "warning", "error" ], + "type": "string" }, "message": { @@ -2059,6 +2084,7 @@ "description": "The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be corrected by making a change at every specified location.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/location" @@ -2066,7 +2092,7 @@ }, "guid": { - "description": "A stable, unique identifer for the result in the form of a GUID.", + "description": "A stable, unique identifier for the result in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -2114,6 +2140,7 @@ "description": "An array of 'codeFlow' objects relevant to the result.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/codeFlow" @@ -2170,7 +2197,8 @@ "unchanged", "updated", "absent" - ] + ], + "type": "string" }, "rank": { @@ -2324,6 +2352,7 @@ "description": "Describes the invocation of the analysis tool.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/invocation" @@ -2339,8 +2368,9 @@ "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", "type": "string", "default": "en-US", - "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" + "pattern": "^(?i)[a-zA]{2}(-[a-z]{2})?$" }, + "versionControlProvenance": { "description": "Specifies the revision in version control of the artifacts that were scanned.", "type": "array", @@ -2396,6 +2426,7 @@ "description": "The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be present (but may be empty) if a log file represents an actual scan.", "type": "array", "minItems": 0, + "uniqueItems": false, "items": { "$ref": "#/definitions/result" } @@ -2457,7 +2488,8 @@ "columnKind": { "description": "Specifies the unit in which the tool measures columns.", - "enum": [ "utf16CodeUnits", "unicodeCodePoints" ] + "enum": [ "utf16CodeUnits", "unicodeCodePoints" ], + "type": "string" }, "externalPropertyFileReferences": { @@ -2491,6 +2523,7 @@ "description": "Addresses associated with this run instance, if any.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "$ref": "#/definitions/address" @@ -2572,7 +2605,7 @@ }, "guid": { - "description": "A stable, unique identifer for this object's containing run object in the form of a GUID.", + "description": "A stable, unique identifier for this object's containing run object in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -2623,6 +2656,7 @@ "description": "An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.", "type": "array", "minItems": 0, + "uniqueItems": false, "items": { "$ref": "#/definitions/stackFrame" } @@ -2661,6 +2695,7 @@ "description": "The parameters of the call that is executing.", "type": "array", "minItems": 0, + "uniqueItems": false, "default": [], "items": { "type": "string", @@ -2682,7 +2717,7 @@ "properties": { "guid": { - "description": "A stable, unique identifer for the suprression in the form of a GUID.", + "description": "A stable, unique identifier for the suprression in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -2692,16 +2727,18 @@ "enum": [ "inSource", "external" - ] + ], + "type": "string" }, - "state": { - "description": "A string that indicates the state of the suppression.", + "status": { + "description": "A string that indicates the review status of the suppression.", "enum": [ "accepted", "underReview", "rejected" - ] + ], + "type": "string" }, "justification": { @@ -2759,6 +2796,7 @@ "description": "A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the result.", "type": "array", "minItems": 1, + "uniqueItems": false, "items": { "$ref": "#/definitions/threadFlowLocation" } @@ -2853,7 +2891,8 @@ "importance": { "description": "Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is \"essential\", \"important\", \"unimportant\". Default: \"important\".", "enum": [ "important", "essential", "unimportant" ], - "default": "important" + "default": "important", + "type": "string" }, "webRequest": { @@ -2911,7 +2950,7 @@ "properties": { "guid": { - "description": "A unique identifer for the tool component in the form of a GUID.", + "description": "A unique identifier for the tool component in the form of a GUID.", "type": "string", "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$" }, @@ -3039,7 +3078,7 @@ "description": "The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to RFC5646).", "type": "string", "default": "en-US", - "pattern": "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" + "pattern": "^(?i)[a-zA]{2}(-[a-z]{2})?$" }, "contents": { @@ -3051,7 +3090,8 @@ "enum": [ "localizedData", "nonLocalizedData" - ] + ], + "type": "string" } }, @@ -3346,4 +3386,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/upload-lib.ts b/src/upload-lib.ts index fe9652ab0a..41d48aeae6 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -225,8 +225,7 @@ export function countResultsInSarif(sarif: string): number { // Throws an error if the file is invalid. export function validateSarifFileSchema(sarifFilePath: string, logger: Logger) { const sarif = JSON.parse(fs.readFileSync(sarifFilePath, "utf8")); - const schema = - require("../src/sarif_v2.1.0_schema.json") as jsonschema.Schema; + const schema = require("../src/sarif-schema-2.1.0.json") as jsonschema.Schema; const result = new jsonschema.Validator().validate(sarif, schema); if (!result.valid) { From ece3cbc8ecd30dcce0d5b61f9d941dacec839521 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Tue, 2 May 2023 13:50:38 -0700 Subject: [PATCH 2/5] Update changelog --- CHANGELOG.md | 1 + lib/upload-lib.js | 2 +- lib/upload-lib.js.map | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d91b5c513d..f8eb386807 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## [UNRELEASED] - You can now configure CodeQL within your code scanning workflow by passing a `config` input to the `init` Action. See [Using a custom configuration file](https://aka.ms/code-scanning-docs/config-file) for more information about configuring code scanning. [#1590](https://github.com/github/codeql-action/pull/1590) +- Updated the SARIF JSON schema file to the latest from [oasis-tcs/sarif-spec](https://github.com/oasis-tcs/sarif-spec/blob/123e95847b13fbdd4cbe2120fa5e33355d4a042b/Schemata/sarif-schema-2.1.0.json). [#1668](https://github.com/github/codeql-action/pull/1668) ## 2.3.2 - 27 Apr 2023 diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 1195d8f41d..45c7c2d6c2 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -179,7 +179,7 @@ exports.countResultsInSarif = countResultsInSarif; // Throws an error if the file is invalid. function validateSarifFileSchema(sarifFilePath, logger) { const sarif = JSON.parse(fs.readFileSync(sarifFilePath, "utf8")); - const schema = require("../src/sarif_v2.1.0_schema.json"); + const schema = require("../src/sarif-schema-2.1.0.json"); const result = new jsonschema.Validator().validate(sarif, schema); if (!result.valid) { // Output the more verbose error messages in groups as these may be very large. diff --git a/lib/upload-lib.js.map b/lib/upload-lib.js.map index 002cf1a25f..71e4b93071 100644 --- a/lib/upload-lib.js.map +++ b/lib/upload-lib.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,qCAA8B;AAC9B,gDAAwB;AAExB,oDAAsC;AAEtC,wDAA+B;AAC/B,uDAAyC;AAEzC,4DAA8C;AAC9C,kDAAoC;AACpC,6DAA+C;AAE/C,6CAAiE;AACjE,6DAAkE;AAClE,6CAA+B;AAC/B,iCAAqE;AACrE,qDAAuC;AAEvC,mEAAmE;AACnE,qDAAqD;AACrD,SAAgB,iBAAiB,C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E,iEAAiE;YACjE,qEAAqE;YACrE,MAAM,UAAU,GAAkB,EAAE,CAAC;YACrC,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE;gBACtC,IACE,MAAM,CAAC,MAAM,KAAK,iCAAiC;oBACnD,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;wBACtC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAC3C;oBACA,MAAM,IAAI,CAAC,CAAC;oBACZ,SAAS;iBACV;gBACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC"} \ No newline at end of file +{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,qCAA8B;AAC9B,gDAAwB;AAExB,oDAAsC;AAEtC,wDAA+B;AAC/B,uDAAyC;AAEzC,4DAA8C;AAC9C,kDAAoC;AACpC,6DAA+C;AAE/C,6CAAiE;AACjE,6DAAkE;AAClE,6CAA+B;AAC/B,iCAAqE;AACrE,qDAAuC;AAEvC,mEAAmE;AACnE,qDAAqD;AACrD,SAAgB,iBAAiB,CAAC,UAAoB;IACpD,MAAM,aAAa,GAAc;QAC/B,OAAO,EAAE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AAE,CAAC;YACrC,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE;gBACtC,IACE,MAAM,CAAC,MAAM,KAAK,iCAAiC;oBACnD,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;wBACtC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAC3C;oBACA,MAAM,IAAI,CAAC,CAAC;oBACZ,SAAS;iBACV;gBACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC"} \ No newline at end of file From ef88842204f7ce687d8f87224b0a08f9d063ea34 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Tue, 2 May 2023 14:26:17 -0700 Subject: [PATCH 3/5] Update jsonschema version Fixes bug in `uniqueItems` property. --- node_modules/.package-lock.json | 5 +- node_modules/jsonschema/README.md | 230 ++++++++++++++--- node_modules/jsonschema/lib/attribute.js | 300 +++++++++++++++++------ node_modules/jsonschema/lib/helpers.js | 137 ++++++++--- node_modules/jsonschema/lib/index.d.ts | 21 +- node_modules/jsonschema/lib/index.js | 1 + node_modules/jsonschema/lib/scan.js | 9 +- node_modules/jsonschema/lib/validator.js | 52 ++-- node_modules/jsonschema/package.json | 12 +- package-lock.json | 7 +- package.json | 2 +- 11 files changed, 599 insertions(+), 177 deletions(-) diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index 03dc19a536..746303f8d9 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -4146,8 +4146,9 @@ } }, "node_modules/jsonschema": { - "version": "1.2.6", - "integrity": "sha512-SqhURKZG07JyKKeo/ir24QnS4/BV7a6gQy93bUSe4lUdNp0QNpIz2c9elWJQ9dpc5cQYY6cvCzgRwy0MQCLyqA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", "engines": { "node": "*" } diff --git a/node_modules/jsonschema/README.md b/node_modules/jsonschema/README.md index 3de393d638..64abb0a00c 100644 --- a/node_modules/jsonschema/README.md +++ b/node_modules/jsonschema/README.md @@ -1,18 +1,21 @@ [![Build Status](https://secure.travis-ci.org/tdegrunt/jsonschema.svg)](http://travis-ci.org/tdegrunt/jsonschema) # jsonschema -[JSON schema](http://json-schema.org/) validator, which is designed to be fast and simple to use. -The latest IETF published draft is v6, this library is mostly v4 compatible. + +[JSON schema](http://json-schema.org/) validator, which is designed to be fast and simple to use. JSON Schema versions through draft-07 are fully supported. ## Contributing & bugs + Please fork the repository, make the changes in your fork and include tests. Once you're done making changes, send in a pull request. ### Bug reports + Please include a test which shows why the code fails. ## Usage ### Simple + Simple object validation using JSON schemas. ```javascript @@ -78,6 +81,7 @@ v.addSchema(addressSchema, '/SimpleAddress'); console.log(v.validate(p, schema)); ``` ### Example for Array schema + ```json var arraySchema = { "type": "array", @@ -95,21 +99,42 @@ For a comprehensive, annotated example illustrating all possible validation opti ## Features ### Definitions + All schema definitions are supported, $schema is ignored. ### Types + All types are supported +### Handling `undefined` + +`undefined` is not a value known to JSON, and by default, the validator treats it as if it is not invalid. i.e., it will return valid. + +```javascript +var res = validate(undefined, {type: 'string'}); +res.valid // true +``` + +This behavior may be changed with the "required" option: + +```javascript +var res = validate(undefined, {type: 'string'}, {required: true}); +res.valid // false +``` + ### Formats + #### Disabling the format keyword. You may disable format validation by providing `disableFormat: true` to the validator options. #### String Formats + All formats are supported, phone numbers are expected to follow the [E.123](http://en.wikipedia.org/wiki/E.123) standard. #### Custom Formats + You may add your own custom format functions. Format functions accept the input being validated and return a boolean value. If the returned value is `true`, then validation succeeds. If the returned value is `false`, then validation fails. @@ -133,27 +158,86 @@ validator.validate('foo', {type: 'string', format: 'myFormat'}).valid; // false ``` ### Results -The first error found will be thrown as an `Error` object if `options.throwError` is `true`. Otherwise all results will be appended to the `result.errors` array which also contains the success flag `result.valid`. -When `oneOf` or `anyOf` validations fail, errors that caused any of the sub-schemas referenced therein to fail are not reported, unless `options.nestedErrors` is truthy. This option may be useful when troubleshooting validation errors in complex schemas. +By default, results will be returned in a `ValidatorResult` object with the following properties: + +* `instance`: any. +* `schema`: Schema. +* `errors`: ValidationError[]. +* `valid`: boolean. + +Each item in `errors` is a `ValidationError` with the following properties: + +* path: array. An array of property keys or array offsets, indicating where inside objects or arrays the instance was found. +* property: string. Describes the property path. Starts with `instance`, and is delimited with a dot (`.`). +* message: string. A human-readable message for debugging use. Provided in English and subject to change. +* schema: object. The schema containing the keyword that failed +* instance: any. The instance that failed +* name: string. The keyword within the schema that failed. +* argument: any. Provides information about the keyword that failed. + +The validator can be configured to throw in the event of a validation error: + +* If the `throwFirst` option is set, the validator will terminate validation at the first encountered error and throw a `ValidatorResultError` object. + +* If the `throwAll` option is set, the validator will throw a `ValidatorResultError` object after the entire instance has been validated. + +* If the `throwError` option is set, it will throw at the first encountered validation error (like `throwFirst`), but the `ValidationError` object itself will be thrown. Note that, despite the name, this does not inherit from Error like `ValidatorResultError` does. + +The `ValidatorResultError` object has the same properties as `ValidatorResult` and additionally inherits from Error. + +#### "nestedErrors" option + +When `oneOf` or `anyOf` validations fail, errors that caused any of the sub-schemas referenced therein to fail are normally suppressed, because it is not necessary to fix all of them. And in the case of `oneOf`, it would itself be an error to fix all of the listed errors. + +This behavior may be configured with `options.nestedErrors`. If truthy, it will emit all the errors from the subschemas. This option may be useful when troubleshooting validation errors in complex schemas: + +```javascript +var schema = { + oneOf: [ + { type: 'string', minLength: 32, maxLength: 32 }, + { type: 'string', maxLength: 16 }, + { type: 'number' }, + ] +}; +var validator = new Validator(); +var result = validator.validate('This string is 28 chars long', schema, {nestedErrors: true}); + +// result.toString() reads out: +// 0: instance does not meet minimum length of 32 +// 1: instance does not meet maximum length of 16 +// 2: instance is not of a type(s) number +// 3: instance is not exactly one from [subschema 0],[subschema 1],[subschema 2] +``` + +#### Localizing Error Messages + +To provide localized, human-readable errors, use the `name` string as a translation key. Feel free to open an issue for support relating to localizing error messages. For example: + +``` +var localized = result.errors.map(function(err){ + return localeService.translate(err.name); +}); +``` + +### Custom keywords -### Custom properties -Specify your own JSON Schema properties with the validator.attributes property: +Specify your own JSON Schema keywords with the validator.attributes property: ```javascript validator.attributes.contains = function validateContains(instance, schema, options, ctx) { - if(typeof instance!='string') return; - if(typeof schema.contains!='string') throw new jsonschema.SchemaError('"contains" expects a string', schema); + if(typeof instance !== 'string') return; + if(typeof schema.contains !== 'string') throw new jsonschema.SchemaError('"contains" expects a string', schema); if(instance.indexOf(schema.contains)<0){ return 'does not contain the string ' + JSON.stringify(schema.contains); } } -var result = validator.validate("i am an instance", { type:"string", contains: "i am" }); +var result = validator.validate("I am an instance", { type:"string", contains: "I am" }); // result.valid === true; ``` The instance passes validation if the function returns nothing. A single validation error is produced -if the fuction returns a string. Any number of errors (maybe none at all) may be returned by passing a +if the function returns a string. Any number of errors (maybe none at all) may be returned by passing a `ValidatorResult` object, which may be used like so: ```javascript @@ -165,6 +249,7 @@ if the fuction returns a string. Any number of errors (maybe none at all) may be ``` ### Dereferencing schemas + Sometimes you may want to download schemas from remote sources, like a database, or over HTTP. When importing a schema, unknown references are inserted into the `validator.unresolvedRefs` Array. Asynchronously shift elements off this array and import them: @@ -184,44 +269,119 @@ function importNextSchema(){ importNextSchema(); ``` -### Pre-Property Validation Hook -If some processing of properties is required prior to validation a function may be passed via the options parameter of the validate function. For example, say you needed to perform type coercion for some properties: +### Default base URI + +Schemas should typically have an `id` with an absolute, full URI. However if the schema you are using contains only relative URI references, the `base` option will be used to resolve these. + +This following example would throw a `SchemaError` if the `base` option were unset: + +```javascript +var result = validate(["Name"], { + id: "/schema.json", + type: "array", + items: { $ref: "http://example.com/schema.json#/definitions/item" }, + definitions: { + item: { type: "string" }, + }, +}, { base: 'http://example.com/' }); +``` + +### Rewrite Hook + +The `rewrite` option lets you change the value of an instance after it has successfully been validated. This will mutate the `instance` passed to the validate function. This can be useful for unmarshalling data and parsing it into native instances, such as changing a string to a `Date` instance. + +The `rewrite` option accepts a function with the following arguments: + +* instance: any +* schema: object +* options: object +* ctx: object +* return value: any new value for the instance + +The value may be removed by returning `undefined`. +If you don't want to change the value, call `return instance`. + +Here is an example that can convert a property expecting a date into a Date instance: ```javascript -const coercionHook = function (instance, property, schema, options, ctx) { - var value = instance[property]; +const schema = { + properties: { + date: {id: 'http://example.com/date', type: 'string'}, + }, +}; - // Skip nulls and undefineds - if (value === null || typeof value == 'undefined') { - return; +const value = { + date: '2020-09-30T23:39:27.060Z', +}; + +function unmarshall(instance, schema){ + if(schema.id === 'http://example.com/date'){ + return new Date(instance); } + return instance; +} - // If the schema declares a type and the property fails type validation. - if (schema.type && this.attributes.type.call(this, instance, schema, options, ctx.makeChild(schema, property))) { - var types = Array.isArray(schema.type) ? schema.type : [schema.type]; - var coerced = undefined; - - // Go through the declared types until we find something that we can - // coerce the value into. - for (var i = 0; typeof coerced == 'undefined' && i < types.length; i++) { - // If we support coercion to this type - if (lib.coercions[types[i]]) { - // ...attempt it. - coerced = lib.coercions[types[i]](value); - } +const v = new Validator(); +const res = v.validate(value, schema, {rewrite: unmarshall}); + +assert(res.instance.date instanceof Date); +``` + + +### Pre-Property Validation Hook + +If some processing of properties is required prior to validation a function may be passed via the options parameter of the validate function. For example, say you needed to perform type coercion for some properties: + +```javascript +// See examples/coercion.js +function preValidateProperty(object, key, schema, options, ctx) { + var value = object[key]; + if (typeof value === 'undefined') return; + + // Test if the schema declares a type, but the type keyword fails validation + if (schema.type && validator.attributes.type.call(validator, value, schema, options, ctx.makeChild(schema, key))) { + // If the type is "number" but the instance is not a number, cast it + if(schema.type==='number' && typeof value!=='number'){ + object[key] = parseFloat(value); + return; } - // If we got a successful coercion we modify the property of the instance. - if (typeof coerced != 'undefined') { - instance[property] = coerced; + // If the type is "string" but the instance is not a string, cast it + if(schema.type==='string' && typeof value!=='string'){ + object[key] = String(value).toString(); + return; } } -}.bind(validator) +}; // And now, to actually perform validation with the coercion hook! -v.validate(instance, schema, { preValidateProperty: coercionHook }); +v.validate(instance, schema, { preValidateProperty }); +``` + +### Skip validation of certain keywords + +Use the "skipAttributes" option to skip validation of certain keywords. Provide an array of keywords to ignore. + +For skipping the "format" keyword, see the disableFormat option. + +### Fail on unknown keywords + +By default, JSON Schema is supposed to ignore unknown schema keywords. + +You can change this behavior to require that all keywords used in a schema have a defined behavior, by using setting the "allowUnknownAttributes" option to false. + +This example will throw a `SchemaError`: + +```javascript +var schema = { + type: "string", + format: "email", + example: "foo", +}; +var result = validate("Name", schema, { allowUnknownAttributes: false }); ``` ## Tests + Uses [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) as well as our own tests. You'll need to update and init the git submodules: diff --git a/node_modules/jsonschema/lib/attribute.js b/node_modules/jsonschema/lib/attribute.js index 1a2577ee0f..67f526aa1a 100644 --- a/node_modules/jsonschema/lib/attribute.js +++ b/node_modules/jsonschema/lib/attribute.js @@ -16,13 +16,13 @@ attribute.ignoreProperties = { 'description': true, 'title': true, // arguments to other properties - 'exclusiveMinimum': true, - 'exclusiveMaximum': true, 'additionalItems': true, + 'then': true, + 'else': true, // special-handled properties '$schema': true, '$ref': true, - 'extends': true + 'extends': true, }; /** @@ -47,7 +47,9 @@ validators.type = function validateType (instance, schema, options, ctx) { var types = Array.isArray(schema.type) ? schema.type : [schema.type]; if (!types.some(this.testType.bind(this, instance, schema, options, ctx))) { var list = types.map(function (v) { - return v.id && ('<' + v.id + '>') || (v+''); + if(!v) return; + var id = v.$id || v.id; + return id ? ('<' + id + '>') : (v+''); }); result.addError({ name: 'type', @@ -60,9 +62,12 @@ validators.type = function validateType (instance, schema, options, ctx) { function testSchemaNoThrow(instance, options, ctx, callback, schema){ var throwError = options.throwError; + var throwAll = options.throwAll; options.throwError = false; + options.throwAll = false; var res = this.validateSchema(instance, schema, options, ctx); options.throwError = throwError; + options.throwAll = throwAll; if (!res.valid && callback instanceof Function) { callback(res); @@ -91,9 +96,11 @@ validators.anyOf = function validateAnyOf (instance, schema, options, ctx) { if (!schema.anyOf.some( testSchemaNoThrow.bind( this, instance, options, ctx, function(res){inner.importErrors(res);} - ))) { + ))) { var list = schema.anyOf.map(function (v, i) { - return (v.id && ('<' + v.id + '>')) || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; + var id = v.$id || v.id; + if(id) return '<' + id + '>'; + return(v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; }); if (options.nestedErrors) { result.importErrors(inner); @@ -128,7 +135,8 @@ validators.allOf = function validateAllOf (instance, schema, options, ctx) { schema.allOf.forEach(function(v, i){ var valid = self.validateSchema(instance, v, options, ctx); if(!valid.valid){ - var msg = (v.id && ('<' + v.id + '>')) || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; + var id = v.$id || v.id; + var msg = id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; result.addError({ name: 'allOf', argument: { id: msg, length: valid.errors.length, valid: valid }, @@ -161,9 +169,10 @@ validators.oneOf = function validateOneOf (instance, schema, options, ctx) { var count = schema.oneOf.filter( testSchemaNoThrow.bind( this, instance, options, ctx, function(res) {inner.importErrors(res);} - ) ).length; + ) ).length; var list = schema.oneOf.map(function (v, i) { - return (v.id && ('<' + v.id + '>')) || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; + var id = v.$id || v.id; + return id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']'; }); if (count!==1) { if (options.nestedErrors) { @@ -178,6 +187,70 @@ validators.oneOf = function validateOneOf (instance, schema, options, ctx) { return result; }; +/** + * Validates "then" or "else" depending on the result of validating "if" + * @param instance + * @param schema + * @param options + * @param ctx + * @return {String|null} + */ +validators.if = function validateIf (instance, schema, options, ctx) { + // Ignore undefined instances + if (instance === undefined) return null; + if (!helpers.isSchema(schema.if)) throw new Error('Expected "if" keyword to be a schema'); + var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema.if); + var result = new ValidatorResult(instance, schema, options, ctx); + var res; + if(ifValid){ + if (schema.then === undefined) return; + if (!helpers.isSchema(schema.then)) throw new Error('Expected "then" keyword to be a schema'); + res = this.validateSchema(instance, schema.then, options, ctx.makeChild(schema.then)); + result.importErrors(res); + }else{ + if (schema.else === undefined) return; + if (!helpers.isSchema(schema.else)) throw new Error('Expected "else" keyword to be a schema'); + res = this.validateSchema(instance, schema.else, options, ctx.makeChild(schema.else)); + result.importErrors(res); + } + return result; +}; + +function getEnumerableProperty(object, key){ + // Determine if `key` shows up in `for(var key in object)` + // First test Object.hasOwnProperty.call as an optimization: that guarantees it does + if(Object.hasOwnProperty.call(object, key)) return object[key]; + // Test `key in object` as an optimization; false means it won't + if(!(key in object)) return; + while( (object = Object.getPrototypeOf(object)) ){ + if(Object.propertyIsEnumerable.call(object, key)) return object[key]; + } +} + +/** + * Validates propertyNames + * @param instance + * @param schema + * @param options + * @param ctx + * @return {String|null|ValidatorResult} + */ +validators.propertyNames = function validatePropertyNames (instance, schema, options, ctx) { + if(!this.types.object(instance)) return; + var result = new ValidatorResult(instance, schema, options, ctx); + var subschema = schema.propertyNames!==undefined ? schema.propertyNames : {}; + if(!helpers.isSchema(subschema)) throw new SchemaError('Expected "propertyNames" to be a schema (object or boolean)'); + + for (var property in instance) { + if(getEnumerableProperty(instance, property) !== undefined){ + var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema)); + result.importErrors(res); + } + } + + return result; +}; + /** * Validates properties * @param instance @@ -191,12 +264,17 @@ validators.properties = function validateProperties (instance, schema, options, var result = new ValidatorResult(instance, schema, options, ctx); var properties = schema.properties || {}; for (var property in properties) { + var subschema = properties[property]; + if(subschema===undefined){ + continue; + }else if(subschema===null){ + throw new SchemaError('Unexpected null, expected schema in "properties"'); + } if (typeof options.preValidateProperty == 'function') { - options.preValidateProperty(instance, property, properties[property], options, ctx); + options.preValidateProperty(instance, property, subschema, options, ctx); } - - var prop = Object.hasOwnProperty.call(instance, property) ? instance[property] : undefined; - var res = this.validateSchema(prop, properties[property], options, ctx.makeChild(properties[property], property)); + var prop = getEnumerableProperty(instance, property); + var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property)); if(res.instance !== result.instance[property]) result.instance[property] = res.instance; result.importErrors(res); } @@ -206,7 +284,7 @@ validators.properties = function validateProperties (instance, schema, options, /** * Test a specific property within in instance against the additionalProperties schema attribute * This ignores properties with definitions in the properties schema attribute, but no other attributes. - * If too many more types of property-existance tests pop up they may need their own class of tests (like `type` has) + * If too many more types of property-existence tests pop up they may need their own class of tests (like `type` has) * @private * @return {boolean} */ @@ -219,7 +297,7 @@ function testAdditionalProperty (instance, schema, options, ctx, property, resul result.addError({ name: 'additionalProperties', argument: property, - message: "additionalProperty " + JSON.stringify(property) + " exists in instance when not allowed", + message: "is not allowed to have the additional property " + JSON.stringify(property), }); } else { var additionalProperties = schema.additionalProperties || {}; @@ -250,17 +328,29 @@ validators.patternProperties = function validatePatternProperties (instance, sch for (var property in instance) { var test = true; for (var pattern in patternProperties) { - var expr = new RegExp(pattern); - if (!expr.test(property)) { + var subschema = patternProperties[pattern]; + if(subschema===undefined){ + continue; + }else if(subschema===null){ + throw new SchemaError('Unexpected null, expected schema in "patternProperties"'); + } + try { + var regexp = new RegExp(pattern, 'u'); + } catch(_e) { + // In the event the stricter handling causes an error, fall back on the forgiving handling + // DEPRECATED + regexp = new RegExp(pattern); + } + if (!regexp.test(property)) { continue; } test = false; if (typeof options.preValidateProperty == 'function') { - options.preValidateProperty(instance, property, patternProperties[pattern], options, ctx); + options.preValidateProperty(instance, property, subschema, options, ctx); } - var res = this.validateSchema(instance[property], patternProperties[pattern], options, ctx.makeChild(patternProperties[pattern], property)); + var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property)); if(res.instance !== result.instance[property]) result.instance[property] = res.instance; result.importErrors(res); } @@ -308,7 +398,7 @@ validators.minProperties = function validateMinProperties (instance, schema, opt name: 'minProperties', argument: schema.minProperties, message: "does not meet minimum property length of " + schema.minProperties, - }) + }); } return result; }; @@ -344,10 +434,14 @@ validators.maxProperties = function validateMaxProperties (instance, schema, opt validators.items = function validateItems (instance, schema, options, ctx) { var self = this; if (!this.types.array(instance)) return; - if (!schema.items) return; + if (schema.items===undefined) return; var result = new ValidatorResult(instance, schema, options, ctx); instance.every(function (value, i) { - var items = Array.isArray(schema.items) ? (schema.items[i] || schema.additionalItems) : schema.items; + if(Array.isArray(schema.items)){ + var items = schema.items[i]===undefined ? schema.additionalItems : schema.items[i]; + }else{ + var items = schema.items; + } if (items === undefined) { return true; } @@ -366,6 +460,34 @@ validators.items = function validateItems (instance, schema, options, ctx) { return result; }; +/** + * Validates the "contains" keyword + * @param instance + * @param schema + * @param options + * @param ctx + * @return {String|null|ValidatorResult} + */ +validators.contains = function validateContains (instance, schema, options, ctx) { + var self = this; + if (!this.types.array(instance)) return; + if (schema.contains===undefined) return; + if (!helpers.isSchema(schema.contains)) throw new Error('Expected "contains" keyword to be a schema'); + var result = new ValidatorResult(instance, schema, options, ctx); + var count = instance.some(function (value, i) { + var res = self.validateSchema(value, schema.contains, options, ctx.makeChild(schema.contains, i)); + return res.errors.length===0; + }); + if(count===false){ + result.addError({ + name: 'contains', + argument: schema.contains, + message: "must contain an item matching given schema", + }); + } + return result; +}; + /** * Validates minimum and exclusiveMinimum when the type of the instance value is a number. * @param instance @@ -375,18 +497,22 @@ validators.items = function validateItems (instance, schema, options, ctx) { validators.minimum = function validateMinimum (instance, schema, options, ctx) { if (!this.types.number(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); - var valid = true; if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) { - valid = instance > schema.minimum; + if(!(instance > schema.minimum)){ + result.addError({ + name: 'minimum', + argument: schema.minimum, + message: "must be greater than " + schema.minimum, + }); + } } else { - valid = instance >= schema.minimum; - } - if (!valid) { - result.addError({ - name: 'minimum', - argument: schema.minimum, - message: "must have a minimum value of " + schema.minimum, - }); + if(!(instance >= schema.minimum)){ + result.addError({ + name: 'minimum', + argument: schema.minimum, + message: "must be greater than or equal to " + schema.minimum, + }); + } } return result; }; @@ -400,17 +526,65 @@ validators.minimum = function validateMinimum (instance, schema, options, ctx) { validators.maximum = function validateMaximum (instance, schema, options, ctx) { if (!this.types.number(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); - var valid; if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) { - valid = instance < schema.maximum; + if(!(instance < schema.maximum)){ + result.addError({ + name: 'maximum', + argument: schema.maximum, + message: "must be less than " + schema.maximum, + }); + } } else { - valid = instance <= schema.maximum; + if(!(instance <= schema.maximum)){ + result.addError({ + name: 'maximum', + argument: schema.maximum, + message: "must be less than or equal to " + schema.maximum, + }); + } } + return result; +}; + +/** + * Validates the number form of exclusiveMinimum when the type of the instance value is a number. + * @param instance + * @param schema + * @return {String|null} + */ +validators.exclusiveMinimum = function validateExclusiveMinimum (instance, schema, options, ctx) { + // Support the boolean form of exclusiveMinimum, which is handled by the "minimum" keyword. + if(typeof schema.exclusiveMinimum === 'boolean') return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema, options, ctx); + var valid = instance > schema.exclusiveMinimum; + if (!valid) { + result.addError({ + name: 'exclusiveMinimum', + argument: schema.exclusiveMinimum, + message: "must be strictly greater than " + schema.exclusiveMinimum, + }); + } + return result; +}; + +/** + * Validates the number form of exclusiveMaximum when the type of the instance value is a number. + * @param instance + * @param schema + * @return {String|null} + */ +validators.exclusiveMaximum = function validateExclusiveMaximum (instance, schema, options, ctx) { + // Support the boolean form of exclusiveMaximum, which is handled by the "maximum" keyword. + if(typeof schema.exclusiveMaximum === 'boolean') return; + if (!this.types.number(instance)) return; + var result = new ValidatorResult(instance, schema, options, ctx); + var valid = instance < schema.exclusiveMaximum; if (!valid) { result.addError({ - name: 'maximum', - argument: schema.maximum, - message: "must have a maximum value of " + schema.maximum, + name: 'exclusiveMaximum', + argument: schema.exclusiveMaximum, + message: "must be strictly less than " + schema.exclusiveMaximum, }); } return result; @@ -444,7 +618,7 @@ var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy (in result.addError({ name: validationType, argument: validationArgument, - message: errorMessage + JSON.stringify(validationArgument) + message: errorMessage + JSON.stringify(validationArgument), }); } @@ -458,7 +632,7 @@ var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy (in * @return {String|null} */ validators.multipleOf = function validateMultipleOf (instance, schema, options, ctx) { - return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); + return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "multipleOf", "is not a multiple of (divisible by) "); }; /** @@ -480,14 +654,14 @@ validators.divisibleBy = function validateDivisibleBy (instance, schema, options validators.required = function validateRequired (instance, schema, options, ctx) { var result = new ValidatorResult(instance, schema, options, ctx); if (instance === undefined && schema.required === true) { - // A boolean form is implemented for reverse-compatability with schemas written against older drafts + // A boolean form is implemented for reverse-compatibility with schemas written against older drafts result.addError({ name: 'required', - message: "is required" + message: "is required", }); } else if (this.types.object(instance) && Array.isArray(schema.required)) { schema.required.forEach(function(n){ - if(instance[n]===undefined){ + if(getEnumerableProperty(instance, n)===undefined){ result.addError({ name: 'required', argument: n, @@ -508,7 +682,15 @@ validators.required = function validateRequired (instance, schema, options, ctx) validators.pattern = function validatePattern (instance, schema, options, ctx) { if (!this.types.string(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); - if (!instance.match(schema.pattern)) { + var pattern = schema.pattern; + try { + var regexp = new RegExp(pattern, 'u'); + } catch(_e) { + // In the event the stricter handling causes an error, fall back on the forgiving handling + // DEPRECATED + regexp = new RegExp(pattern); + } + if (!instance.match(regexp)) { result.addError({ name: 'pattern', argument: schema.pattern, @@ -633,32 +815,6 @@ validators.maxItems = function validateMaxItems (instance, schema, options, ctx) return result; }; -/** - * Validates that every item in an instance array is unique, when instance is an array - * @param instance - * @param schema - * @param options - * @param ctx - * @return {String|null|ValidatorResult} - */ -validators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) { - if (!this.types.array(instance)) return; - var result = new ValidatorResult(instance, schema, options, ctx); - function testArrays (v, i, a) { - for (var j = i + 1; j < a.length; j++) if (helpers.deepCompareStrict(v, a[j])) { - return false; - } - return true; - } - if (!instance.every(testArrays)) { - result.addError({ - name: 'uniqueItems', - message: "contains duplicate item", - }); - } - return result; -}; - /** * Deep compares arrays for duplicates * @param v @@ -683,6 +839,7 @@ function testArrays (v, i, a) { * @return {String|null} */ validators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) { + if (schema.uniqueItems!==true) return; if (!this.types.array(instance)) return; var result = new ValidatorResult(instance, schema, options, ctx); if (!instance.every(testArrays)) { @@ -806,7 +963,8 @@ validators.not = validators.disallow = function validateNot (instance, schema, o if(!Array.isArray(notTypes)) notTypes=[notTypes]; notTypes.forEach(function (type) { if (self.testType(instance, schema, options, ctx, type)) { - var schemaId = type && type.id && ('<' + type.id + '>') || type; + var id = type && (type.$id || type.id); + var schemaId = id || type; result.addError({ name: 'not', argument: schemaId, diff --git a/node_modules/jsonschema/lib/helpers.js b/node_modules/jsonschema/lib/helpers.js index 93ad0e0417..14dc0ebbb2 100644 --- a/node_modules/jsonschema/lib/helpers.js +++ b/node_modules/jsonschema/lib/helpers.js @@ -2,21 +2,23 @@ var uri = require('url'); -var ValidationError = exports.ValidationError = function ValidationError (message, instance, schema, propertyPath, name, argument) { - if (propertyPath) { - this.property = propertyPath; +var ValidationError = exports.ValidationError = function ValidationError (message, instance, schema, path, name, argument) { + if(Array.isArray(path)){ + this.path = path; + this.property = path.reduce(function(sum, item){ + return sum + makeSuffix(item); + }, 'instance'); + }else if(path !== undefined){ + this.property = path; } if (message) { this.message = message; } if (schema) { - if (schema.id) { - this.schema = schema.id; - } else { - this.schema = schema; - } + var id = schema.$id || schema.id; + this.schema = id || schema; } - if (instance) { + if (instance !== undefined) { this.instance = instance; } this.name = name; @@ -31,27 +33,33 @@ ValidationError.prototype.toString = function toString() { var ValidatorResult = exports.ValidatorResult = function ValidatorResult(instance, schema, options, ctx) { this.instance = instance; this.schema = schema; + this.options = options; + this.path = ctx.path; this.propertyPath = ctx.propertyPath; this.errors = []; this.throwError = options && options.throwError; + this.throwFirst = options && options.throwFirst; + this.throwAll = options && options.throwAll; this.disableFormat = options && options.disableFormat === true; }; ValidatorResult.prototype.addError = function addError(detail) { var err; if (typeof detail == 'string') { - err = new ValidationError(detail, this.instance, this.schema, this.propertyPath); + err = new ValidationError(detail, this.instance, this.schema, this.path); } else { if (!detail) throw new Error('Missing error detail'); if (!detail.message) throw new Error('Missing error message'); if (!detail.name) throw new Error('Missing validator type'); - err = new ValidationError(detail.message, this.instance, this.schema, this.propertyPath, detail.name, detail.argument); + err = new ValidationError(detail.message, this.instance, this.schema, this.path, detail.name, detail.argument); } - if (this.throwError) { + this.errors.push(err); + if (this.throwFirst) { + throw new ValidatorResultError(this); + }else if(this.throwError){ throw err; } - this.errors.push(err); return err; }; @@ -59,7 +67,7 @@ ValidatorResult.prototype.importErrors = function importErrors(res) { if (typeof res == 'string' || (res && res.validatorType)) { this.addError(res); } else if (res && res.errors) { - Array.prototype.push.apply(this.errors, res.errors); + this.errors = this.errors.concat(res.errors); } }; @@ -74,6 +82,20 @@ Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() { return !this.errors.length; } }); +module.exports.ValidatorResultError = ValidatorResultError; +function ValidatorResultError(result) { + if(Error.captureStackTrace){ + Error.captureStackTrace(this, ValidatorResultError); + } + this.instance = result.instance; + this.schema = result.schema; + this.options = result.options; + this.errors = result.errors; +} +ValidatorResultError.prototype = new Error(); +ValidatorResultError.prototype.constructor = ValidatorResultError; +ValidatorResultError.prototype.name = "Validation Error"; + /** * Describes a problem with a Schema which prevents validation of an instance * @name SchemaError @@ -86,14 +108,22 @@ var SchemaError = exports.SchemaError = function SchemaError (msg, schema) { Error.captureStackTrace(this, SchemaError); }; SchemaError.prototype = Object.create(Error.prototype, - { constructor: {value: SchemaError, enumerable: false} - , name: {value: 'SchemaError', enumerable: false} + { + constructor: {value: SchemaError, enumerable: false}, + name: {value: 'SchemaError', enumerable: false}, }); -var SchemaContext = exports.SchemaContext = function SchemaContext (schema, options, propertyPath, base, schemas) { +var SchemaContext = exports.SchemaContext = function SchemaContext (schema, options, path, base, schemas) { this.schema = schema; this.options = options; - this.propertyPath = propertyPath; + if(Array.isArray(path)){ + this.path = path; + this.propertyPath = path.reduce(function(sum, item){ + return sum + makeSuffix(item); + }, 'instance'); + }else{ + this.propertyPath = path; + } this.base = base; this.schemas = schemas; }; @@ -103,36 +133,60 @@ SchemaContext.prototype.resolve = function resolve (target) { }; SchemaContext.prototype.makeChild = function makeChild(schema, propertyName){ - var propertyPath = (propertyName===undefined) ? this.propertyPath : this.propertyPath+makeSuffix(propertyName); - var base = uri.resolve(this.base, schema.id||''); - var ctx = new SchemaContext(schema, this.options, propertyPath, base, Object.create(this.schemas)); - if(schema.id && !ctx.schemas[base]){ + var path = (propertyName===undefined) ? this.path : this.path.concat([propertyName]); + var id = schema.$id || schema.id; + var base = uri.resolve(this.base, id||''); + var ctx = new SchemaContext(schema, this.options, path, base, Object.create(this.schemas)); + if(id && !ctx.schemas[base]){ ctx.schemas[base] = schema; } return ctx; -} +}; var FORMAT_REGEXPS = exports.FORMAT_REGEXPS = { + // 7.3.1. Dates, Times, and Duration 'date-time': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/, 'date': /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/, 'time': /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/, + 'duration': /P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i, + // 7.3.2. Email Addresses + // TODO: fix the email production 'email': /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/, + 'idn-email': /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u, + + // 7.3.3. Hostnames + + // 7.3.4. IP Addresses 'ip-address': /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/, + // FIXME whitespace is invalid 'ipv6': /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/, - 'uri': /^[a-zA-Z][a-zA-Z0-9+-.]*:[^\s]*$/, - 'color': /^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/, + // 7.3.5. Resource Identifiers + // TODO: A more accurate regular expression for "uri" goes: + // [A-Za-z][+\-.0-9A-Za-z]*:((/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?)?#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])|/?%[0-9A-Fa-f]{2}|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*(#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|/(/((%[0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?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u, + 'uuid': /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, + + // 7.3.6. uri-template + 'uri-template': /(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu, + + // 7.3.7. JSON Pointers + 'json-pointer': /^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu, + 'relative-json-pointer': /^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu, // hostname regex from: http://stackoverflow.com/a/1420225/5628 'hostname': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, 'host-name': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, - 'alpha': /^[a-zA-Z]+$/, - 'alphanumeric': /^[a-zA-Z0-9]+$/, 'utc-millisec': function (input) { return (typeof input === 'string') && parseFloat(input) === parseInt(input, 10) && !isNaN(input); }, + + // 7.3.8. regex 'regex': function (input) { var result = true; try { @@ -142,8 +196,15 @@ var FORMAT_REGEXPS = exports.FORMAT_REGEXPS = { } return result; }, - 'style': /\s*(.+?):\s*([^;]+);?/, - 'phone': /^\+(?:[0-9] ?){6,14}[0-9]$/ + + // Other definitions + // "style" was removed from JSON Schema in draft-4 and is deprecated + 'style': /[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/, + // "color" was removed from JSON Schema in draft-4 and is deprecated + 'color': /^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/, + 'phone': /^\+(?:[0-9] ?){6,14}[0-9]$/, + 'alpha': /^[a-zA-Z]+$/, + 'alphanumeric': /^[a-zA-Z0-9]+$/, }; FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; @@ -212,10 +273,10 @@ exports.deepCompareStrict = function deepCompareStrict (a, b) { function deepMerger (target, dst, e, i) { if (typeof e === 'object') { - dst[i] = deepMerge(target[i], e) + dst[i] = deepMerge(target[i], e); } else { if (target.indexOf(e) === -1) { - dst.push(e) + dst.push(e); } } } @@ -232,7 +293,7 @@ function copyistWithDeepMerge (target, src, dst, key) { if (!target[key]) { dst[key] = src[key]; } else { - dst[key] = deepMerge(target[key], src[key]) + dst[key] = deepMerge(target[key], src[key]); } } } @@ -253,7 +314,7 @@ function deepMerge (target, src) { } return dst; -}; +} module.exports.deepMerge = deepMerge; @@ -284,9 +345,9 @@ function pathEncoder (v) { * @return {String} */ exports.encodePath = function encodePointer(a){ - // ~ must be encoded explicitly because hacks - // the slash is encoded by encodeURIComponent - return a.map(pathEncoder).join(''); + // ~ must be encoded explicitly because hacks + // the slash is encoded by encodeURIComponent + return a.map(pathEncoder).join(''); }; @@ -323,3 +384,7 @@ exports.getDecimalPlaces = function getDecimalPlaces(number) { return decimalPlaces; }; +exports.isSchema = function isSchema(val){ + return (typeof val === 'object' && val) || (typeof val === 'boolean'); +}; + diff --git a/node_modules/jsonschema/lib/index.d.ts b/node_modules/jsonschema/lib/index.d.ts index 056d2cbec8..ba47f9e54d 100644 --- a/node_modules/jsonschema/lib/index.d.ts +++ b/node_modules/jsonschema/lib/index.d.ts @@ -29,6 +29,7 @@ export declare class ValidatorResult { export declare class ValidationError { constructor(message?: string, instance?: any, schema?: Schema, propertyPath?: any, name?: string, argument?: any); + path: (string|number)[]; property: string; message: string; schema: string|Schema; @@ -48,6 +49,7 @@ export declare class SchemaError extends Error{ export declare function validate(instance: any, schema: any, options?: Options): ValidatorResult export interface Schema { + $id?: string id?: string $schema?: string $ref?: string @@ -55,9 +57,9 @@ export interface Schema { description?: string multipleOf?: number maximum?: number - exclusiveMaximum?: boolean + exclusiveMaximum?: number | boolean minimum?: number - exclusiveMinimum?: boolean + exclusiveMinimum?: number | boolean maxLength?: number minLength?: number pattern?: string | RegExp @@ -82,6 +84,7 @@ export interface Schema { dependencies?: { [name: string]: Schema | string[] } + const?: any 'enum'?: any[] type?: string | string[] format?: string @@ -89,27 +92,39 @@ export interface Schema { anyOf?: Schema[] oneOf?: Schema[] not?: Schema + if?: Schema + then?: Schema + else?: Schema } export interface Options { skipAttributes?: string[]; allowUnknownAttributes?: boolean; + preValidateProperty?: PreValidatePropertyFunction; rewrite?: RewriteFunction; - propertyName?: string; base?: string; throwError?: boolean; + required?: boolean; + throwFirst?: boolean; + throwAll?: boolean; + nestedErrors?: boolean; } export interface RewriteFunction { (instance: any, schema: Schema, options: Options, ctx: SchemaContext): any; } +export interface PreValidatePropertyFunction { + (instance: any, key: string, schema: Schema, options: Options, ctx: SchemaContext): any; +} + export interface SchemaContext { schema: Schema; options: Options; propertyPath: string; base: string; schemas: {[base: string]: Schema}; + makeChild: (schema: Schema, key: string) => SchemaContext; } export interface CustomFormat { diff --git a/node_modules/jsonschema/lib/index.js b/node_modules/jsonschema/lib/index.js index c68bb2c492..98c57453ca 100644 --- a/node_modules/jsonschema/lib/index.js +++ b/node_modules/jsonschema/lib/index.js @@ -3,6 +3,7 @@ var Validator = module.exports.Validator = require('./validator'); module.exports.ValidatorResult = require('./helpers').ValidatorResult; +module.exports.ValidatorResultError = require('./helpers').ValidatorResultError; module.exports.ValidationError = require('./helpers').ValidationError; module.exports.SchemaError = require('./helpers').SchemaError; module.exports.SchemaScanResult = require('./scan').SchemaScanResult; diff --git a/node_modules/jsonschema/lib/scan.js b/node_modules/jsonschema/lib/scan.js index d05307d041..26f6b336dc 100644 --- a/node_modules/jsonschema/lib/scan.js +++ b/node_modules/jsonschema/lib/scan.js @@ -1,3 +1,4 @@ +"use strict"; var urilib = require('url'); var helpers = require('./helpers'); @@ -23,13 +24,14 @@ module.exports.scan = function scan(base, schema){ ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri]+1 : 0; return; } - var ourBase = schema.id ? urilib.resolve(baseuri, schema.id) : baseuri; + var id = schema.$id || schema.id; + var ourBase = id ? urilib.resolve(baseuri, id) : baseuri; if (ourBase) { // If there's no fragment, append an empty one if(ourBase.indexOf('#')<0) ourBase += '#'; if(found[ourBase]){ if(!helpers.deepCompareStrict(found[ourBase], schema)){ - throw new Error('Schema <'+schema+'> already exists with different definition'); + throw new Error('Schema <'+ourBase+'> already exists with different definition'); } return found[ourBase]; } @@ -68,7 +70,6 @@ module.exports.scan = function scan(base, schema){ var found = {}; var ref = {}; - var schemaUri = base; scanSchema(base, schema); return new SchemaScanResult(found, ref); -} +}; diff --git a/node_modules/jsonschema/lib/validator.js b/node_modules/jsonschema/lib/validator.js index 43dd43ae0c..cce16946ef 100644 --- a/node_modules/jsonschema/lib/validator.js +++ b/node_modules/jsonschema/lib/validator.js @@ -6,6 +6,7 @@ var attribute = require('./attribute'); var helpers = require('./helpers'); var scanSchema = require('./scan').scan; var ValidatorResult = helpers.ValidatorResult; +var ValidatorResultError = helpers.ValidatorResultError; var SchemaError = helpers.SchemaError; var SchemaContext = helpers.SchemaContext; //var anonymousBase = 'vnd.jsonschema:///'; @@ -49,13 +50,15 @@ Validator.prototype.addSchema = function addSchema (schema, base) { return null; } var scan = scanSchema(base||anonymousBase, schema); - var ourUri = base || schema.id; + var ourUri = base || schema.$id || schema.id; for(var uri in scan.id){ this.schemas[uri] = scan.id[uri]; } for(var uri in scan.ref){ + // If this schema is already defined, it will be filtered out by the next step this.unresolvedRefs.push(uri); } + // Remove newly defined schemas from unresolvedRefs this.unresolvedRefs = this.unresolvedRefs.filter(function(uri){ return typeof self.schemas[uri]==='undefined'; }); @@ -103,14 +106,18 @@ Validator.prototype.getSchema = function getSchema (urn) { * @return {Array} */ Validator.prototype.validate = function validate (instance, schema, options, ctx) { + if((typeof schema !== 'boolean' && typeof schema !== 'object') || schema === null){ + throw new SchemaError('Expected `schema` to be an object or boolean'); + } if (!options) { options = {}; } - var propertyName = options.propertyName || 'instance'; + // This section indexes subschemas in the provided schema, so they don't need to be added with Validator#addSchema // This will work so long as the function at uri.resolve() will resolve a relative URI to a relative URI - var base = urilib.resolve(options.base||anonymousBase, schema.id||''); + var id = schema.$id || schema.id; + var base = urilib.resolve(options.base||anonymousBase, id||''); if(!ctx){ - ctx = new SchemaContext(schema, options, propertyName, base, Object.create(this.schemas)); + ctx = new SchemaContext(schema, options, [], base, Object.create(this.schemas)); if (!ctx.schemas[base]) { ctx.schemas[base] = schema; } @@ -120,14 +127,18 @@ Validator.prototype.validate = function validate (instance, schema, options, ctx ctx.schemas[n] = sch; } } - if (schema) { - var result = this.validateSchema(instance, schema, options, ctx); - if (!result) { - throw new Error('Result undefined'); - } + if(options.required && instance===undefined){ + var result = new ValidatorResult(instance, schema, options, ctx); + result.addError('is required, but is undefined'); return result; } - throw new SchemaError('no schema specified', schema); + var result = this.validateSchema(instance, schema, options, ctx); + if (!result) { + throw new Error('Result undefined'); + }else if(options.throwAll && result.errors.length){ + throw new ValidatorResultError(result); + } + return result; }; /** @@ -152,7 +163,7 @@ function shouldResolve(schema) { Validator.prototype.validateSchema = function validateSchema (instance, schema, options, ctx) { var result = new ValidatorResult(instance, schema, options, ctx); - // Support for the true/false schemas + // Support for the true/false schemas if(typeof schema==='boolean') { if(schema===true){ // `true` is always valid @@ -180,10 +191,10 @@ Validator.prototype.validateSchema = function validateSchema (instance, schema, } // If passed a string argument, load that schema URI - var switchSchema; - if (switchSchema = shouldResolve(schema)) { + var switchSchema = shouldResolve(schema); + if (switchSchema) { var resolved = this.resolve(schema, switchSchema, ctx); - var subctx = new SchemaContext(resolved.subschema, options, ctx.propertyPath, resolved.switchSchema, ctx.schemas); + var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas); return this.validateSchema(instance, resolved.subschema, options, subctx); } @@ -220,7 +231,7 @@ Validator.prototype.validateSchema = function validateSchema (instance, schema, */ Validator.prototype.schemaTraverser = function schemaTraverser (schemaobj, s) { schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx)); -} +}; /** * @private @@ -229,12 +240,12 @@ Validator.prototype.schemaTraverser = function schemaTraverser (schemaobj, s) { * @returns Object schema or resolved schema */ Validator.prototype.superResolve = function superResolve (schema, ctx) { - var ref; - if(ref = shouldResolve(schema)) { + var ref = shouldResolve(schema); + if(ref) { return this.resolve(schema, ref, ctx).subschema; } return schema; -} +}; /** * @private @@ -275,6 +286,11 @@ Validator.prototype.resolve = function resolve (schema, switchSchema, ctx) { * @return {boolean} */ Validator.prototype.testType = function validateType (instance, schema, options, ctx, type) { + if(type===undefined){ + return; + }else if(type===null){ + throw new SchemaError('Unexpected null in "type" keyword'); + } if (typeof this.types[type] == 'function') { return this.types[type].call(this, instance); } diff --git a/node_modules/jsonschema/package.json b/node_modules/jsonschema/package.json index 5954258856..1b7664e821 100644 --- a/node_modules/jsonschema/package.json +++ b/node_modules/jsonschema/package.json @@ -1,7 +1,7 @@ { "author": "Tom de Grunt ", "name": "jsonschema", - "version": "1.2.6", + "version": "1.4.1", "license": "MIT", "dependencies": {}, "contributors": [ @@ -9,12 +9,15 @@ "name": "Austin Wright" } ], - "main": "./lib", + "main": "./lib/index.js", "typings": "./lib/index.d.ts", "devDependencies": { + "@stryker-mutator/core": "^4.0.0", + "@stryker-mutator/mocha-runner": "^4.0.0", + "chai": "~4.2.0", + "eslint": "^7.7.0", "json-metaschema": "^1.2.0", - "mocha": "~3", - "chai": "~1.5.0" + "mocha": "~8.1.1" }, "optionalDependencies": {}, "engines": { @@ -33,6 +36,7 @@ }, "description": "A fast and easy to use JSON Schema validator", "scripts": { + "stryker": "stryker run", "test": "./node_modules/.bin/mocha -R spec" } } diff --git a/package-lock.json b/package-lock.json index ea8d5f3b5a..4dbc9a929b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "fs": "0.0.1-security", "get-folder-size": "^2.0.1", "js-yaml": "^4.1.0", - "jsonschema": "1.2.6", + "jsonschema": "1.4.1", "long": "^5.2.0", "path": "^0.12.7", "semver": "^7.3.2", @@ -4202,8 +4202,9 @@ } }, "node_modules/jsonschema": { - "version": "1.2.6", - "integrity": "sha512-SqhURKZG07JyKKeo/ir24QnS4/BV7a6gQy93bUSe4lUdNp0QNpIz2c9elWJQ9dpc5cQYY6cvCzgRwy0MQCLyqA==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", "engines": { "node": "*" } diff --git a/package.json b/package.json index aa60612533..7d60ed84d5 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "fs": "0.0.1-security", "get-folder-size": "^2.0.1", "js-yaml": "^4.1.0", - "jsonschema": "1.2.6", + "jsonschema": "1.4.1", "long": "^5.2.0", "path": "^0.12.7", "semver": "^7.3.2", From 3df80238a3c3bdb4627962d400a53476d0942e98 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Tue, 2 May 2023 15:19:05 -0700 Subject: [PATCH 4/5] Re-run sync.py with new ruamel.yaml --- .github/workflows/__ml-powered-queries.yml | 3 ++- .../workflows/__packaging-codescanning-config-inputs-js.yml | 3 ++- .github/workflows/__packaging-config-inputs-js.yml | 3 ++- .github/workflows/__packaging-config-js.yml | 3 ++- .github/workflows/__packaging-inputs-js.yml | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/__ml-powered-queries.yml b/.github/workflows/__ml-powered-queries.yml index 9bb163d9a7..fc11c53bc3 100644 --- a/.github/workflows/__ml-powered-queries.yml +++ b/.github/workflows/__ml-powered-queries.yml @@ -114,7 +114,8 @@ jobs: if: "!(matrix.version == 'stable-20220401' && runner.os == 'Windows')" with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: js/ml-powered/nosql-injection,js/ml-powered/path-injection,js/ml-powered/sql-injection,js/ml-powered/xss + queries-run: + js/ml-powered/nosql-injection,js/ml-powered/path-injection,js/ml-powered/sql-injection,js/ml-powered/xss queries-not-run: foo,bar - name: Check results diff --git a/.github/workflows/__packaging-codescanning-config-inputs-js.yml b/.github/workflows/__packaging-codescanning-config-inputs-js.yml index 781b9b3d0a..adc418ea04 100644 --- a/.github/workflows/__packaging-codescanning-config-inputs-js.yml +++ b/.github/workflows/__packaging-codescanning-config-inputs-js.yml @@ -83,7 +83,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__packaging-config-inputs-js.yml b/.github/workflows/__packaging-config-inputs-js.yml index 3dc4ea923e..879fecccd3 100644 --- a/.github/workflows/__packaging-config-inputs-js.yml +++ b/.github/workflows/__packaging-config-inputs-js.yml @@ -83,7 +83,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__packaging-config-js.yml b/.github/workflows/__packaging-config-js.yml index a9aa16637f..18a03452f6 100644 --- a/.github/workflows/__packaging-config-js.yml +++ b/.github/workflows/__packaging-config-js.yml @@ -82,7 +82,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results diff --git a/.github/workflows/__packaging-inputs-js.yml b/.github/workflows/__packaging-inputs-js.yml index 35603d6a38..700a790079 100644 --- a/.github/workflows/__packaging-inputs-js.yml +++ b/.github/workflows/__packaging-inputs-js.yml @@ -82,7 +82,8 @@ jobs: uses: ./../action/.github/actions/check-sarif with: sarif-file: ${{ runner.temp }}/results/javascript.sarif - queries-run: javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block + queries-run: + javascript/example/empty-or-one-block,javascript/example/empty-or-one-block,javascript/example/other-query-block,javascript/example/two-block queries-not-run: foo,bar - name: Assert Results From 684c4b5c77a26db94849489bfeaf6d15242ea21c Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Fri, 5 May 2023 08:41:11 -0700 Subject: [PATCH 5/5] Update CHANGELOG.md Co-authored-by: Aditya Sharad <6874315+adityasharad@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8eb386807..d602afce52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [UNRELEASED] - You can now configure CodeQL within your code scanning workflow by passing a `config` input to the `init` Action. See [Using a custom configuration file](https://aka.ms/code-scanning-docs/config-file) for more information about configuring code scanning. [#1590](https://github.com/github/codeql-action/pull/1590) -- Updated the SARIF JSON schema file to the latest from [oasis-tcs/sarif-spec](https://github.com/oasis-tcs/sarif-spec/blob/123e95847b13fbdd4cbe2120fa5e33355d4a042b/Schemata/sarif-schema-2.1.0.json). [#1668](https://github.com/github/codeql-action/pull/1668) +- Updated the SARIF 2.1.0 JSON schema file to the latest from [oasis-tcs/sarif-spec](https://github.com/oasis-tcs/sarif-spec/blob/123e95847b13fbdd4cbe2120fa5e33355d4a042b/Schemata/sarif-schema-2.1.0.json). [#1668](https://github.com/github/codeql-action/pull/1668) ## 2.3.2 - 27 Apr 2023