UNPKG

@sphereon/did-auth-siop

Version:

Self Issued OpenID V2 (SIOPv2) and OpenID 4 Verifiable Presentations (OID4VP)

872 lines (870 loc) 3.74 MB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // lib/schemas/validation/schemaValidation.cjs var require_schemaValidation = __commonJS({ "lib/schemas/validation/schemaValidation.cjs"(exports) { "use strict"; exports.AuthorizationRequestPayloadVID1Schema = validate10; var schema14 = { "type": "string", "enum": ["id_token", "vp_token"] }; var schema21 = { "type": "string", "enum": ["fragment", "form_post", "post", "direct_post", "query", "direct_post.jwt", "query.jwt", "fragment.jwt"] }; var schema13 = { "type": "object", "properties": { "client_id": { "anyOf": [{ "type": "string" }, {}] }, "id_token_signing_alg_values_supported": { "anyOf": [{ "type": "array", "items": { "type": "string", "enum": ["EdDSA", "RS256", "PS256", "ES256", "ES256K"] } }, { "type": "string", "enum": ["EdDSA", "RS256", "PS256", "ES256", "ES256K"] }] }, "request_object_signing_alg_values_supported": { "anyOf": [{ "type": "array", "items": { "type": "string", "enum": ["EdDSA", "RS256", "PS256", "ES256", "ES256K"] } }, { "type": "string", "enum": ["EdDSA", "RS256", "PS256", "ES256", "ES256K"] }] }, "response_types_supported": { "anyOf": [{ "type": "array", "items": { "$ref": "#/definitions/ResponseType" } }, { "$ref": "#/definitions/ResponseType" }] }, "scopes_supported": { "anyOf": [{ "type": "array", "items": { "$ref": "#/definitions/Scope" } }, { "$ref": "#/definitions/Scope" }] }, "subject_types_supported": { "anyOf": [{ "type": "array", "items": { "$ref": "#/definitions/SubjectType" } }, { "$ref": "#/definitions/SubjectType" }] }, "subject_syntax_types_supported": { "type": "array", "items": { "type": "string" } }, "vp_formats": { "anyOf": [{ "$ref": "#/definitions/Format" }, {}] }, "client_name": { "anyOf": [{ "type": "string" }, {}] }, "logo_uri": { "anyOf": [{ "type": "string" }, {}] }, "client_purpose": { "anyOf": [{}, { "type": "string" }] } } }; var schema16 = { "type": "string", "enum": ["openid", "openid did_authn", "profile", "email", "address", "phone"] }; var schema18 = { "type": "string", "enum": ["public", "pairwise"] }; function validate12(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (errors === 0) { if (data && typeof data == "object" && !Array.isArray(data)) { if (data.client_id !== void 0) { const _errs1 = errors; var valid0 = _errs1 === errors; } else { var valid0 = true; } if (valid0) { if (data.id_token_signing_alg_values_supported !== void 0) { let data1 = data.id_token_signing_alg_values_supported; const _errs3 = errors; const _errs4 = errors; let valid1 = false; const _errs5 = errors; if (errors === _errs5) { if (Array.isArray(data1)) { var valid2 = true; const len0 = data1.length; for (let i0 = 0; i0 < len0; i0++) { let data2 = data1[i0]; const _errs7 = errors; if (typeof data2 !== "string") { const err0 = { instancePath: instancePath + "/id_token_signing_alg_values_supported/" + i0, schemaPath: "#/properties/id_token_signing_alg_values_supported/anyOf/0/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err0]; } else { vErrors.push(err0); } errors++; } if (!(data2 === "EdDSA" || data2 === "RS256" || data2 === "PS256" || data2 === "ES256" || data2 === "ES256K")) { const err1 = { instancePath: instancePath + "/id_token_signing_alg_values_supported/" + i0, schemaPath: "#/properties/id_token_signing_alg_values_supported/anyOf/0/items/enum", keyword: "enum", params: { allowedValues: schema13.properties.id_token_signing_alg_values_supported.anyOf[0].items.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err1]; } else { vErrors.push(err1); } errors++; } var valid2 = _errs7 === errors; if (!valid2) { break; } } } else { const err2 = { instancePath: instancePath + "/id_token_signing_alg_values_supported", schemaPath: "#/properties/id_token_signing_alg_values_supported/anyOf/0/type", keyword: "type", params: { type: "array" }, message: "must be array" }; if (vErrors === null) { vErrors = [err2]; } else { vErrors.push(err2); } errors++; } } var _valid0 = _errs5 === errors; valid1 = valid1 || _valid0; if (!valid1) { const _errs9 = errors; if (typeof data1 !== "string") { const err3 = { instancePath: instancePath + "/id_token_signing_alg_values_supported", schemaPath: "#/properties/id_token_signing_alg_values_supported/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err3]; } else { vErrors.push(err3); } errors++; } if (!(data1 === "EdDSA" || data1 === "RS256" || data1 === "PS256" || data1 === "ES256" || data1 === "ES256K")) { const err4 = { instancePath: instancePath + "/id_token_signing_alg_values_supported", schemaPath: "#/properties/id_token_signing_alg_values_supported/anyOf/1/enum", keyword: "enum", params: { allowedValues: schema13.properties.id_token_signing_alg_values_supported.anyOf[1].enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err4]; } else { vErrors.push(err4); } errors++; } var _valid0 = _errs9 === errors; valid1 = valid1 || _valid0; } if (!valid1) { const err5 = { instancePath: instancePath + "/id_token_signing_alg_values_supported", schemaPath: "#/properties/id_token_signing_alg_values_supported/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; if (vErrors === null) { vErrors = [err5]; } else { vErrors.push(err5); } errors++; validate12.errors = vErrors; return false; } else { errors = _errs4; if (vErrors !== null) { if (_errs4) { vErrors.length = _errs4; } else { vErrors = null; } } } var valid0 = _errs3 === errors; } else { var valid0 = true; } if (valid0) { if (data.request_object_signing_alg_values_supported !== void 0) { let data3 = data.request_object_signing_alg_values_supported; const _errs11 = errors; const _errs12 = errors; let valid3 = false; const _errs13 = errors; if (errors === _errs13) { if (Array.isArray(data3)) { var valid4 = true; const len1 = data3.length; for (let i1 = 0; i1 < len1; i1++) { let data4 = data3[i1]; const _errs15 = errors; if (typeof data4 !== "string") { const err6 = { instancePath: instancePath + "/request_object_signing_alg_values_supported/" + i1, schemaPath: "#/properties/request_object_signing_alg_values_supported/anyOf/0/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err6]; } else { vErrors.push(err6); } errors++; } if (!(data4 === "EdDSA" || data4 === "RS256" || data4 === "PS256" || data4 === "ES256" || data4 === "ES256K")) { const err7 = { instancePath: instancePath + "/request_object_signing_alg_values_supported/" + i1, schemaPath: "#/properties/request_object_signing_alg_values_supported/anyOf/0/items/enum", keyword: "enum", params: { allowedValues: schema13.properties.request_object_signing_alg_values_supported.anyOf[0].items.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err7]; } else { vErrors.push(err7); } errors++; } var valid4 = _errs15 === errors; if (!valid4) { break; } } } else { const err8 = { instancePath: instancePath + "/request_object_signing_alg_values_supported", schemaPath: "#/properties/request_object_signing_alg_values_supported/anyOf/0/type", keyword: "type", params: { type: "array" }, message: "must be array" }; if (vErrors === null) { vErrors = [err8]; } else { vErrors.push(err8); } errors++; } } var _valid1 = _errs13 === errors; valid3 = valid3 || _valid1; if (!valid3) { const _errs17 = errors; if (typeof data3 !== "string") { const err9 = { instancePath: instancePath + "/request_object_signing_alg_values_supported", schemaPath: "#/properties/request_object_signing_alg_values_supported/anyOf/1/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err9]; } else { vErrors.push(err9); } errors++; } if (!(data3 === "EdDSA" || data3 === "RS256" || data3 === "PS256" || data3 === "ES256" || data3 === "ES256K")) { const err10 = { instancePath: instancePath + "/request_object_signing_alg_values_supported", schemaPath: "#/properties/request_object_signing_alg_values_supported/anyOf/1/enum", keyword: "enum", params: { allowedValues: schema13.properties.request_object_signing_alg_values_supported.anyOf[1].enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err10]; } else { vErrors.push(err10); } errors++; } var _valid1 = _errs17 === errors; valid3 = valid3 || _valid1; } if (!valid3) { const err11 = { instancePath: instancePath + "/request_object_signing_alg_values_supported", schemaPath: "#/properties/request_object_signing_alg_values_supported/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; if (vErrors === null) { vErrors = [err11]; } else { vErrors.push(err11); } errors++; validate12.errors = vErrors; return false; } else { errors = _errs12; if (vErrors !== null) { if (_errs12) { vErrors.length = _errs12; } else { vErrors = null; } } } var valid0 = _errs11 === errors; } else { var valid0 = true; } if (valid0) { if (data.response_types_supported !== void 0) { let data5 = data.response_types_supported; const _errs19 = errors; const _errs20 = errors; let valid5 = false; const _errs21 = errors; if (errors === _errs21) { if (Array.isArray(data5)) { var valid6 = true; const len2 = data5.length; for (let i2 = 0; i2 < len2; i2++) { let data6 = data5[i2]; const _errs23 = errors; if (typeof data6 !== "string") { const err12 = { instancePath: instancePath + "/response_types_supported/" + i2, schemaPath: "#/definitions/ResponseType/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err12]; } else { vErrors.push(err12); } errors++; } if (!(data6 === "id_token" || data6 === "vp_token")) { const err13 = { instancePath: instancePath + "/response_types_supported/" + i2, schemaPath: "#/definitions/ResponseType/enum", keyword: "enum", params: { allowedValues: schema14.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err13]; } else { vErrors.push(err13); } errors++; } var valid6 = _errs23 === errors; if (!valid6) { break; } } } else { const err14 = { instancePath: instancePath + "/response_types_supported", schemaPath: "#/properties/response_types_supported/anyOf/0/type", keyword: "type", params: { type: "array" }, message: "must be array" }; if (vErrors === null) { vErrors = [err14]; } else { vErrors.push(err14); } errors++; } } var _valid2 = _errs21 === errors; valid5 = valid5 || _valid2; if (!valid5) { const _errs26 = errors; if (typeof data5 !== "string") { const err15 = { instancePath: instancePath + "/response_types_supported", schemaPath: "#/definitions/ResponseType/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err15]; } else { vErrors.push(err15); } errors++; } if (!(data5 === "id_token" || data5 === "vp_token")) { const err16 = { instancePath: instancePath + "/response_types_supported", schemaPath: "#/definitions/ResponseType/enum", keyword: "enum", params: { allowedValues: schema14.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err16]; } else { vErrors.push(err16); } errors++; } var _valid2 = _errs26 === errors; valid5 = valid5 || _valid2; } if (!valid5) { const err17 = { instancePath: instancePath + "/response_types_supported", schemaPath: "#/properties/response_types_supported/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; if (vErrors === null) { vErrors = [err17]; } else { vErrors.push(err17); } errors++; validate12.errors = vErrors; return false; } else { errors = _errs20; if (vErrors !== null) { if (_errs20) { vErrors.length = _errs20; } else { vErrors = null; } } } var valid0 = _errs19 === errors; } else { var valid0 = true; } if (valid0) { if (data.scopes_supported !== void 0) { let data7 = data.scopes_supported; const _errs29 = errors; const _errs30 = errors; let valid9 = false; const _errs31 = errors; if (errors === _errs31) { if (Array.isArray(data7)) { var valid10 = true; const len3 = data7.length; for (let i3 = 0; i3 < len3; i3++) { let data8 = data7[i3]; const _errs33 = errors; if (typeof data8 !== "string") { const err18 = { instancePath: instancePath + "/scopes_supported/" + i3, schemaPath: "#/definitions/Scope/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err18]; } else { vErrors.push(err18); } errors++; } if (!(data8 === "openid" || data8 === "openid did_authn" || data8 === "profile" || data8 === "email" || data8 === "address" || data8 === "phone")) { const err19 = { instancePath: instancePath + "/scopes_supported/" + i3, schemaPath: "#/definitions/Scope/enum", keyword: "enum", params: { allowedValues: schema16.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err19]; } else { vErrors.push(err19); } errors++; } var valid10 = _errs33 === errors; if (!valid10) { break; } } } else { const err20 = { instancePath: instancePath + "/scopes_supported", schemaPath: "#/properties/scopes_supported/anyOf/0/type", keyword: "type", params: { type: "array" }, message: "must be array" }; if (vErrors === null) { vErrors = [err20]; } else { vErrors.push(err20); } errors++; } } var _valid3 = _errs31 === errors; valid9 = valid9 || _valid3; if (!valid9) { const _errs36 = errors; if (typeof data7 !== "string") { const err21 = { instancePath: instancePath + "/scopes_supported", schemaPath: "#/definitions/Scope/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err21]; } else { vErrors.push(err21); } errors++; } if (!(data7 === "openid" || data7 === "openid did_authn" || data7 === "profile" || data7 === "email" || data7 === "address" || data7 === "phone")) { const err22 = { instancePath: instancePath + "/scopes_supported", schemaPath: "#/definitions/Scope/enum", keyword: "enum", params: { allowedValues: schema16.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err22]; } else { vErrors.push(err22); } errors++; } var _valid3 = _errs36 === errors; valid9 = valid9 || _valid3; } if (!valid9) { const err23 = { instancePath: instancePath + "/scopes_supported", schemaPath: "#/properties/scopes_supported/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; if (vErrors === null) { vErrors = [err23]; } else { vErrors.push(err23); } errors++; validate12.errors = vErrors; return false; } else { errors = _errs30; if (vErrors !== null) { if (_errs30) { vErrors.length = _errs30; } else { vErrors = null; } } } var valid0 = _errs29 === errors; } else { var valid0 = true; } if (valid0) { if (data.subject_types_supported !== void 0) { let data9 = data.subject_types_supported; const _errs39 = errors; const _errs40 = errors; let valid13 = false; const _errs41 = errors; if (errors === _errs41) { if (Array.isArray(data9)) { var valid14 = true; const len4 = data9.length; for (let i4 = 0; i4 < len4; i4++) { let data10 = data9[i4]; const _errs43 = errors; if (typeof data10 !== "string") { const err24 = { instancePath: instancePath + "/subject_types_supported/" + i4, schemaPath: "#/definitions/SubjectType/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err24]; } else { vErrors.push(err24); } errors++; } if (!(data10 === "public" || data10 === "pairwise")) { const err25 = { instancePath: instancePath + "/subject_types_supported/" + i4, schemaPath: "#/definitions/SubjectType/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err25]; } else { vErrors.push(err25); } errors++; } var valid14 = _errs43 === errors; if (!valid14) { break; } } } else { const err26 = { instancePath: instancePath + "/subject_types_supported", schemaPath: "#/properties/subject_types_supported/anyOf/0/type", keyword: "type", params: { type: "array" }, message: "must be array" }; if (vErrors === null) { vErrors = [err26]; } else { vErrors.push(err26); } errors++; } } var _valid4 = _errs41 === errors; valid13 = valid13 || _valid4; if (!valid13) { const _errs46 = errors; if (typeof data9 !== "string") { const err27 = { instancePath: instancePath + "/subject_types_supported", schemaPath: "#/definitions/SubjectType/type", keyword: "type", params: { type: "string" }, message: "must be string" }; if (vErrors === null) { vErrors = [err27]; } else { vErrors.push(err27); } errors++; } if (!(data9 === "public" || data9 === "pairwise")) { const err28 = { instancePath: instancePath + "/subject_types_supported", schemaPath: "#/definitions/SubjectType/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" }; if (vErrors === null) { vErrors = [err28]; } else { vErrors.push(err28); } errors++; } var _valid4 = _errs46 === errors; valid13 = valid13 || _valid4; } if (!valid13) { const err29 = { instancePath: instancePath + "/subject_types_supported", schemaPath: "#/properties/subject_types_supported/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" }; if (vErrors === null) { vErrors = [err29]; } else { vErrors.push(err29); } errors++; validate12.errors = vErrors; return false; } else { errors = _errs40; if (vErrors !== null) { if (_errs40) { vErrors.length = _errs40; } else { vErrors = null; } } } var valid0 = _errs39 === errors; } else { var valid0 = true; } if (valid0) { if (data.subject_syntax_types_supported !== void 0) { let data11 = data.subject_syntax_types_supported; const _errs49 = errors; if (errors === _errs49) { if (Array.isArray(data11)) { var valid17 = true; const len5 = data11.length; for (let i5 = 0; i5 < len5; i5++) { const _errs51 = errors; if (typeof data11[i5] !== "string") { validate12.errors = [{ instancePath: instancePath + "/subject_syntax_types_supported/" + i5, schemaPath: "#/properties/subject_syntax_types_supported/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } var valid17 = _errs51 === errors; if (!valid17) { break; } } } else { validate12.errors = [{ instancePath: instancePath + "/subject_syntax_types_supported", schemaPath: "#/properties/subject_syntax_types_supported/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; return false; } } var valid0 = _errs49 === errors; } else { var valid0 = true; } if (valid0) { if (data.vp_formats !== void 0) { const _errs53 = errors; var valid0 = _errs53 === errors; } else { var valid0 = true; } if (valid0) { if (data.client_name !== void 0) { const _errs55 = errors; var valid0 = _errs55 === errors; } else { var valid0 = true; } if (valid0) { if (data.logo_uri !== void 0) { const _errs57 = errors; var valid0 = _errs57 === errors; } else { var valid0 = true; } if (valid0) { if (data.client_purpose !== void 0) { const _errs59 = errors; var valid0 = _errs59 === errors; } else { var valid0 = true; } } } } } } } } } } } } else { validate12.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; return false; } } validate12.errors = vErrors; return errors === 0; } __name(validate12, "validate12"); var schema26 = { "type": "object", "properties": { "jwt": { "$ref": "#/definitions/JwtObject" }, "jwt_vc": { "$ref": "#/definitions/JwtObject" }, "jwt_vc_json": { "$ref": "#/definitions/JwtObject" }, "jwt_vp": { "$ref": "#/definitions/JwtObject" }, "jwt_vp_json": { "$ref": "#/definitions/JwtObject" }, "ldp": { "$ref": "#/definitions/LdpObject" }, "ldp_vc": { "$ref": "#/definitions/LdpObject" }, "ldp_vp": { "$ref": "#/definitions/LdpObject" }, "di": { "$ref": "#/definitions/DiObject" }, "di_vc": { "$ref": "#/definitions/DiObject" }, "di_vp": { "$ref": "#/definitions/DiObject" }, "vc+sd-jwt": { "$ref": "#/definitions/SdJwtObject" }, "mso_mdoc": { "$ref": "#/definitions/MsoMdocObject" } }, "additionalProperties": false }; var func2 = Object.prototype.hasOwnProperty; function validate17(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) { let vErrors = null; let errors = 0; if (errors === 0) { if (data && typeof data == "object" && !Array.isArray(data)) { const _errs1 = errors; for (const key0 in data) { if (!func2.call(schema26.properties, key0)) { validate17.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }]; return false; break; } } if (_errs1 === errors) { if (data.jwt !== void 0) { let data0 = data.jwt; const _errs2 = errors; const _errs3 = errors; if (errors === _errs3) { if (data0 && typeof data0 == "object" && !Array.isArray(data0)) { let missing0; if (data0.alg === void 0 && (missing0 = "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt", schemaPath: "#/definitions/JwtObject/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }]; return false; } else { const _errs5 = errors; for (const key1 in data0) { if (!(key1 === "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt", schemaPath: "#/definitions/JwtObject/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }]; return false; break; } } if (_errs5 === errors) { if (data0.alg !== void 0) { let data1 = data0.alg; const _errs6 = errors; if (errors === _errs6) { if (Array.isArray(data1)) { var valid3 = true; const len0 = data1.length; for (let i0 = 0; i0 < len0; i0++) { const _errs8 = errors; if (typeof data1[i0] !== "string") { validate17.errors = [{ instancePath: instancePath + "/jwt/alg/" + i0, schemaPath: "#/definitions/JwtObject/properties/alg/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } var valid3 = _errs8 === errors; if (!valid3) { break; } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt/alg", schemaPath: "#/definitions/JwtObject/properties/alg/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; return false; } } } } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt", schemaPath: "#/definitions/JwtObject/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; return false; } } var valid0 = _errs2 === errors; } else { var valid0 = true; } if (valid0) { if (data.jwt_vc !== void 0) { let data3 = data.jwt_vc; const _errs10 = errors; const _errs11 = errors; if (errors === _errs11) { if (data3 && typeof data3 == "object" && !Array.isArray(data3)) { let missing1; if (data3.alg === void 0 && (missing1 = "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vc", schemaPath: "#/definitions/JwtObject/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }]; return false; } else { const _errs13 = errors; for (const key2 in data3) { if (!(key2 === "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vc", schemaPath: "#/definitions/JwtObject/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" }]; return false; break; } } if (_errs13 === errors) { if (data3.alg !== void 0) { let data4 = data3.alg; const _errs14 = errors; if (errors === _errs14) { if (Array.isArray(data4)) { var valid6 = true; const len1 = data4.length; for (let i1 = 0; i1 < len1; i1++) { const _errs16 = errors; if (typeof data4[i1] !== "string") { validate17.errors = [{ instancePath: instancePath + "/jwt_vc/alg/" + i1, schemaPath: "#/definitions/JwtObject/properties/alg/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } var valid6 = _errs16 === errors; if (!valid6) { break; } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt_vc/alg", schemaPath: "#/definitions/JwtObject/properties/alg/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; return false; } } } } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt_vc", schemaPath: "#/definitions/JwtObject/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; return false; } } var valid0 = _errs10 === errors; } else { var valid0 = true; } if (valid0) { if (data.jwt_vc_json !== void 0) { let data6 = data.jwt_vc_json; const _errs18 = errors; const _errs19 = errors; if (errors === _errs19) { if (data6 && typeof data6 == "object" && !Array.isArray(data6)) { let missing2; if (data6.alg === void 0 && (missing2 = "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vc_json", schemaPath: "#/definitions/JwtObject/required", keyword: "required", params: { missingProperty: missing2 }, message: "must have required property '" + missing2 + "'" }]; return false; } else { const _errs21 = errors; for (const key3 in data6) { if (!(key3 === "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vc_json", schemaPath: "#/definitions/JwtObject/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key3 }, message: "must NOT have additional properties" }]; return false; break; } } if (_errs21 === errors) { if (data6.alg !== void 0) { let data7 = data6.alg; const _errs22 = errors; if (errors === _errs22) { if (Array.isArray(data7)) { var valid9 = true; const len2 = data7.length; for (let i2 = 0; i2 < len2; i2++) { const _errs24 = errors; if (typeof data7[i2] !== "string") { validate17.errors = [{ instancePath: instancePath + "/jwt_vc_json/alg/" + i2, schemaPath: "#/definitions/JwtObject/properties/alg/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } var valid9 = _errs24 === errors; if (!valid9) { break; } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt_vc_json/alg", schemaPath: "#/definitions/JwtObject/properties/alg/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; return false; } } } } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt_vc_json", schemaPath: "#/definitions/JwtObject/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; return false; } } var valid0 = _errs18 === errors; } else { var valid0 = true; } if (valid0) { if (data.jwt_vp !== void 0) { let data9 = data.jwt_vp; const _errs26 = errors; const _errs27 = errors; if (errors === _errs27) { if (data9 && typeof data9 == "object" && !Array.isArray(data9)) { let missing3; if (data9.alg === void 0 && (missing3 = "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vp", schemaPath: "#/definitions/JwtObject/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }]; return false; } else { const _errs29 = errors; for (const key4 in data9) { if (!(key4 === "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vp", schemaPath: "#/definitions/JwtObject/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key4 }, message: "must NOT have additional properties" }]; return false; break; } } if (_errs29 === errors) { if (data9.alg !== void 0) { let data10 = data9.alg; const _errs30 = errors; if (errors === _errs30) { if (Array.isArray(data10)) { var valid12 = true; const len3 = data10.length; for (let i3 = 0; i3 < len3; i3++) { const _errs32 = errors; if (typeof data10[i3] !== "string") { validate17.errors = [{ instancePath: instancePath + "/jwt_vp/alg/" + i3, schemaPath: "#/definitions/JwtObject/properties/alg/items/type", keyword: "type", params: { type: "string" }, message: "must be string" }]; return false; } var valid12 = _errs32 === errors; if (!valid12) { break; } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt_vp/alg", schemaPath: "#/definitions/JwtObject/properties/alg/type", keyword: "type", params: { type: "array" }, message: "must be array" }]; return false; } } } } } } else { validate17.errors = [{ instancePath: instancePath + "/jwt_vp", schemaPath: "#/definitions/JwtObject/type", keyword: "type", params: { type: "object" }, message: "must be object" }]; return false; } } var valid0 = _errs26 === errors; } else { var valid0 = true; } if (valid0) { if (data.jwt_vp_json !== void 0) { let data12 = data.jwt_vp_json; const _errs34 = errors; const _errs35 = errors; if (errors === _errs35) { if (data12 && typeof data12 == "object" && !Array.isArray(data12)) { let missing4; if (data12.alg === void 0 && (missing4 = "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vp_json", schemaPath: "#/definitions/JwtObject/required", keyword: "required", params: { missingProperty: missing4 }, message: "must have required property '" + missing4 + "'" }]; return false; } else { const _errs37 = errors; for (const key5 in data12) { if (!(key5 === "alg")) { validate17.errors = [{ instancePath: instancePath + "/jwt_vp_json", schemaPath: "#/definitions/JwtObject/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key5 }, message: "must NOT have additional properties" }]; return false; break; } } if (_errs37 === errors) { if (data12.alg !== void 0) { let data13 = data12.alg; const _errs38 = errors; if (errors === _errs38) {