UNPKG

@sphereon/did-auth-siop

Version:

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

1,172 lines (1,169 loc) 1.42 MB
"use strict"; exports.AuthorizationRequestPayloadVID1Schema = validate10; const schema11 = {"$id":"AuthorizationRequestPayloadVID1Schema","$schema":"http://json-schema.org/draft-07/schema#","$ref":"#/definitions/AuthorizationRequestPayloadVID1","definitions":{"AuthorizationRequestPayloadVID1":{"type":"object","properties":{"registration":{"$ref":"#/definitions/RPRegistrationMetadataPayload"},"registration_uri":{"type":"string"},"iss":{"type":"string"},"sub":{"type":"string"},"aud":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"iat":{"type":"number"},"nbf":{"type":"number"},"type":{"type":"string"},"exp":{"type":"number"},"rexp":{"type":"number"},"jti":{"type":"string"},"scope":{"type":"string"},"response_type":{"anyOf":[{"$ref":"#/definitions/ResponseType"},{"type":"string"}]},"client_id":{"type":"string"},"redirect_uri":{"type":"string"},"id_token_hint":{"type":"string"},"nonce":{"type":"string"},"state":{"type":"string"},"response_mode":{"$ref":"#/definitions/ResponseMode"},"request":{"type":"string"},"request_uri":{"type":"string"},"claims":{"$ref":"#/definitions/ClaimPayloadVID1"}}},"RPRegistrationMetadataPayload":{"type":"object","properties":{"client_id":{"anyOf":[{"type":"string"},{}]},"id_token_signing_alg_values_supported":{"anyOf":[{"type":"array","items":{"$ref":"#/definitions/SigningAlgo"}},{"$ref":"#/definitions/SigningAlgo"}]},"request_object_signing_alg_values_supported":{"anyOf":[{"type":"array","items":{"$ref":"#/definitions/SigningAlgo"}},{"$ref":"#/definitions/SigningAlgo"}]},"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"}]}}},"SigningAlgo":{"type":"string","enum":["EdDSA","RS256","PS256","ES256","ES256K"]},"ResponseType":{"type":"string","enum":["id_token","vp_token"]},"Scope":{"type":"string","enum":["openid","openid did_authn","profile","email","address","phone"]},"SubjectType":{"type":"string","enum":["public","pairwise"]},"Format":{"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},"JwtObject":{"type":"object","properties":{"alg":{"type":"array","items":{"type":"string"}}},"required":["alg"],"additionalProperties":false},"LdpObject":{"type":"object","properties":{"proof_type":{"type":"array","items":{"type":"string"}}},"required":["proof_type"],"additionalProperties":false},"DiObject":{"type":"object","properties":{"proof_type":{"type":"array","items":{"type":"string"}},"cryptosuite":{"type":"array","items":{"type":"string"}}},"required":["proof_type","cryptosuite"],"additionalProperties":false},"SdJwtObject":{"type":"object","properties":{"sd-jwt_alg_values":{"type":"array","items":{"type":"string"}},"kb-jwt_alg_values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false},"MsoMdocObject":{"type":"object","properties":{"alg":{"type":"array","items":{"type":"string"}}},"required":["alg"],"additionalProperties":false},"ResponseMode":{"type":"string","enum":["fragment","form_post","post","direct_post","query","direct_post.jwt","query.jwt","fragment.jwt"]},"ClaimPayloadVID1":{"type":"object","properties":{"id_token":{"$ref":"#/definitions/IdTokenClaimPayload"},"vp_token":{"$ref":"#/definitions/VpTokenClaimPayload"}}},"IdTokenClaimPayload":{"type":"object"},"VpTokenClaimPayload":{"type":"object","properties":{"presentation_definition":{"anyOf":[{"$ref":"#/definitions/PresentationDefinitionV1"},{"$ref":"#/definitions/PresentationDefinitionV2"}]},"presentation_definition_uri":{"type":"string"},"dcql_query":{"type":"string"}},"additionalProperties":false},"PresentationDefinitionV1":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"purpose":{"type":"string"},"format":{"$ref":"#/definitions/Format"},"submission_requirements":{"type":"array","items":{"$ref":"#/definitions/SubmissionRequirement"}},"input_descriptors":{"type":"array","items":{"$ref":"#/definitions/InputDescriptorV1"}}},"required":["id","input_descriptors"],"additionalProperties":false},"SubmissionRequirement":{"type":"object","properties":{"name":{"type":"string"},"purpose":{"type":"string"},"rule":{"$ref":"#/definitions/Rules"},"count":{"type":"number"},"min":{"type":"number"},"max":{"type":"number"},"from":{"type":"string"},"from_nested":{"type":"array","items":{"$ref":"#/definitions/SubmissionRequirement"}}},"required":["rule"],"additionalProperties":false},"Rules":{"type":"string","enum":["all","pick"]},"InputDescriptorV1":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"purpose":{"type":"string"},"group":{"type":"array","items":{"type":"string"}},"schema":{"type":"array","items":{"$ref":"#/definitions/Schema"}},"issuance":{"type":"array","items":{"$ref":"#/definitions/Issuance"}},"constraints":{"$ref":"#/definitions/ConstraintsV1"}},"required":["id","schema"],"additionalProperties":false},"Schema":{"type":"object","properties":{"uri":{"type":"string"},"required":{"type":"boolean"}},"required":["uri"],"additionalProperties":false},"Issuance":{"type":"object","properties":{"manifest":{"type":"string"}},"additionalProperties":{}},"ConstraintsV1":{"type":"object","properties":{"limit_disclosure":{"$ref":"#/definitions/Optionality"},"statuses":{"$ref":"#/definitions/Statuses"},"fields":{"type":"array","items":{"$ref":"#/definitions/FieldV1"}},"subject_is_issuer":{"$ref":"#/definitions/Optionality"},"is_holder":{"type":"array","items":{"$ref":"#/definitions/HolderSubject"}},"same_subject":{"type":"array","items":{"$ref":"#/definitions/HolderSubject"}}},"additionalProperties":false},"Optionality":{"type":"string","enum":["required","preferred"]},"Statuses":{"type":"object","properties":{"active":{"$ref":"#/definitions/PdStatus"},"suspended":{"$ref":"#/definitions/PdStatus"},"revoked":{"$ref":"#/definitions/PdStatus"}},"additionalProperties":false},"PdStatus":{"type":"object","properties":{"directive":{"$ref":"#/definitions/Directives"}},"additionalProperties":false},"Directives":{"type":"string","enum":["required","allowed","disallowed"]},"FieldV1":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"array","items":{"type":"string"}},"purpose":{"type":"string"},"filter":{"$ref":"#/definitions/FilterV1"},"predicate":{"$ref":"#/definitions/Optionality"}},"required":["path"],"additionalProperties":false},"FilterV1":{"type":"object","properties":{"const":{"$ref":"#/definitions/OneOfNumberStringBoolean"},"enum":{"type":"array","items":{"$ref":"#/definitions/OneOfNumberStringBoolean"}},"exclusiveMinimum":{"$ref":"#/definitions/OneOfNumberString"},"exclusiveMaximum":{"$ref":"#/definitions/OneOfNumberString"},"format":{"type":"string"},"minLength":{"type":"number"},"maxLength":{"type":"number"},"minimum":{"$ref":"#/definitions/OneOfNumberString"},"maximum":{"$ref":"#/definitions/OneOfNumberString"},"not":{"type":"object"},"pattern":{"type":"string"},"type":{"type":"string"}},"additionalProperties":false},"OneOfNumberStringBoolean":{"type":["boolean","number","string"]},"OneOfNumberString":{"type":["number","string"]},"HolderSubject":{"type":"object","properties":{"field_id":{"type":"array","items":{"type":"string"}},"directive":{"$ref":"#/definitions/Optionality"}},"required":["field_id","directive"],"additionalProperties":false},"PresentationDefinitionV2":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"purpose":{"type":"string"},"format":{"$ref":"#/definitions/Format"},"submission_requirements":{"type":"array","items":{"$ref":"#/definitions/SubmissionRequirement"}},"input_descriptors":{"type":"array","items":{"$ref":"#/definitions/InputDescriptorV2"}},"frame":{"type":"object"}},"required":["id","input_descriptors"],"additionalProperties":false},"InputDescriptorV2":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"purpose":{"type":"string"},"format":{"$ref":"#/definitions/Format"},"group":{"type":"array","items":{"type":"string"}},"issuance":{"type":"array","items":{"$ref":"#/definitions/Issuance"}},"constraints":{"$ref":"#/definitions/ConstraintsV2"}},"required":["id","constraints"],"additionalProperties":false},"ConstraintsV2":{"type":"object","properties":{"limit_disclosure":{"$ref":"#/definitions/Optionality"},"statuses":{"$ref":"#/definitions/Statuses"},"fields":{"type":"array","items":{"$ref":"#/definitions/FieldV2"}},"subject_is_issuer":{"$ref":"#/definitions/Optionality"},"is_holder":{"type":"array","items":{"$ref":"#/definitions/HolderSubject"}},"same_subject":{"type":"array","items":{"$ref":"#/definitions/HolderSubject"}}},"additionalProperties":false},"FieldV2":{"type":"object","properties":{"id":{"type":"string"},"path":{"type":"array","items":{"type":"string"}},"purpose":{"type":"string"},"filter":{"$ref":"#/definitions/FilterV2"},"predicate":{"$ref":"#/definitions/Optionality"},"intent_to_retain":{"type":"boolean"},"name":{"type":"string"},"optional":{"type":"boolean"}},"required":["path"],"additionalProperties":false},"FilterV2":{"type":"object","properties":{"const":{"$ref":"#/definitions/OneOfNumberStringBoolean"},"enum":{"type":"array","items":{"$ref":"#/definitions/OneOfNumberStringBoolean"}},"exclusiveMinimum":{"$ref":"#/definitions/OneOfNumberString"},"exclusiveMaximum":{"$ref":"#/definitions/OneOfNumberString"},"format":{"type":"string"},"formatMaximum":{"type":"string"},"formatMinimum":{"type":"string"},"formatExclusiveMaximum":{"type":"string"},"formatExclusiveMinimum":{"type":"string"},"minLength":{"type":"number"},"maxLength":{"type":"number"},"minimum":{"$ref":"#/definitions/OneOfNumberString"},"maximum":{"$ref":"#/definitions/OneOfNumberString"},"not":{"type":"object"},"pattern":{"type":"string"},"type":{"type":"string"},"contains":{"$ref":"#/definitions/FilterV2"},"items":{"$ref":"#/definitions/FilterV2Items"}},"additionalProperties":false},"FilterV2Items":{"type":"object","properties":{"const":{"$ref":"#/definitions/OneOfNumberStringBoolean"},"enum":{"type":"array","items":{"$ref":"#/definitions/OneOfNumberStringBoolean"}},"exclusiveMinimum":{"$ref":"#/definitions/OneOfNumberString"},"exclusiveMaximum":{"$ref":"#/definitions/OneOfNumberString"},"format":{"type":"string"},"formatMaximum":{"type":"string"},"formatMinimum":{"type":"string"},"formatExclusiveMaximum":{"type":"string"},"formatExclusiveMinimum":{"type":"string"},"minLength":{"type":"number"},"maxLength":{"type":"number"},"minimum":{"$ref":"#/definitions/OneOfNumberString"},"maximum":{"$ref":"#/definitions/OneOfNumberString"},"not":{"type":"object"},"pattern":{"type":"string"},"type":{"type":"string"},"contains":{"$ref":"#/definitions/FilterV2"},"items":{"$ref":"#/definitions/FilterV2Items"}},"additionalProperties":false}}}; const schema12 = {"type":"object","properties":{"registration":{"$ref":"#/definitions/RPRegistrationMetadataPayload"},"registration_uri":{"type":"string"},"iss":{"type":"string"},"sub":{"type":"string"},"aud":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"iat":{"type":"number"},"nbf":{"type":"number"},"type":{"type":"string"},"exp":{"type":"number"},"rexp":{"type":"number"},"jti":{"type":"string"},"scope":{"type":"string"},"response_type":{"anyOf":[{"$ref":"#/definitions/ResponseType"},{"type":"string"}]},"client_id":{"type":"string"},"redirect_uri":{"type":"string"},"id_token_hint":{"type":"string"},"nonce":{"type":"string"},"state":{"type":"string"},"response_mode":{"$ref":"#/definitions/ResponseMode"},"request":{"type":"string"},"request_uri":{"type":"string"},"claims":{"$ref":"#/definitions/ClaimPayloadVID1"}}}; const schema18 = {"type":"string","enum":["id_token","vp_token"]}; const schema25 = {"type":"string","enum":["fragment","form_post","post","direct_post","query","direct_post.jwt","query.jwt","fragment.jwt"]}; const schema13 = {"type":"object","properties":{"client_id":{"anyOf":[{"type":"string"},{}]},"id_token_signing_alg_values_supported":{"anyOf":[{"type":"array","items":{"$ref":"#/definitions/SigningAlgo"}},{"$ref":"#/definitions/SigningAlgo"}]},"request_object_signing_alg_values_supported":{"anyOf":[{"type":"array","items":{"$ref":"#/definitions/SigningAlgo"}},{"$ref":"#/definitions/SigningAlgo"}]},"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"}]}}}; const schema14 = {"type":"string","enum":["EdDSA","RS256","PS256","ES256","ES256K"]}; const schema20 = {"type":"string","enum":["openid","openid did_authn","profile","email","address","phone"]}; const schema22 = {"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 !== undefined){ const _errs1 = errors; var valid0 = _errs1 === errors; } else { var valid0 = true; } if(valid0){ if(data.id_token_signing_alg_values_supported !== undefined){ 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:"#/definitions/SigningAlgo/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:"#/definitions/SigningAlgo/enum",keyword:"enum",params:{allowedValues: schema14.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 _errs10 = errors; if(typeof data1 !== "string"){ const err3 = {instancePath:instancePath+"/id_token_signing_alg_values_supported",schemaPath:"#/definitions/SigningAlgo/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:"#/definitions/SigningAlgo/enum",keyword:"enum",params:{allowedValues: schema14.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err4]; } else { vErrors.push(err4); } errors++; } var _valid0 = _errs10 === 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 !== undefined){ let data3 = data.request_object_signing_alg_values_supported; const _errs13 = errors; const _errs14 = errors; let valid5 = false; const _errs15 = errors; if(errors === _errs15){ if(Array.isArray(data3)){ var valid6 = true; const len1 = data3.length; for(let i1=0; i1<len1; i1++){ let data4 = data3[i1]; const _errs17 = errors; if(typeof data4 !== "string"){ const err6 = {instancePath:instancePath+"/request_object_signing_alg_values_supported/" + i1,schemaPath:"#/definitions/SigningAlgo/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:"#/definitions/SigningAlgo/enum",keyword:"enum",params:{allowedValues: schema14.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err7]; } else { vErrors.push(err7); } errors++; } var valid6 = _errs17 === errors; if(!valid6){ 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 = _errs15 === errors; valid5 = valid5 || _valid1; if(!valid5){ const _errs20 = errors; if(typeof data3 !== "string"){ const err9 = {instancePath:instancePath+"/request_object_signing_alg_values_supported",schemaPath:"#/definitions/SigningAlgo/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:"#/definitions/SigningAlgo/enum",keyword:"enum",params:{allowedValues: schema14.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err10]; } else { vErrors.push(err10); } errors++; } var _valid1 = _errs20 === errors; valid5 = valid5 || _valid1; } if(!valid5){ 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 = _errs14; if(vErrors !== null){ if(_errs14){ vErrors.length = _errs14; } else { vErrors = null; } } } var valid0 = _errs13 === errors; } else { var valid0 = true; } if(valid0){ if(data.response_types_supported !== undefined){ let data5 = data.response_types_supported; const _errs23 = errors; const _errs24 = errors; let valid9 = false; const _errs25 = errors; if(errors === _errs25){ if(Array.isArray(data5)){ var valid10 = true; const len2 = data5.length; for(let i2=0; i2<len2; i2++){ let data6 = data5[i2]; const _errs27 = 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: schema18.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err13]; } else { vErrors.push(err13); } errors++; } var valid10 = _errs27 === errors; if(!valid10){ 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 = _errs25 === errors; valid9 = valid9 || _valid2; if(!valid9){ const _errs30 = 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: schema18.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err16]; } else { vErrors.push(err16); } errors++; } var _valid2 = _errs30 === errors; valid9 = valid9 || _valid2; } if(!valid9){ 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 = _errs24; if(vErrors !== null){ if(_errs24){ vErrors.length = _errs24; } else { vErrors = null; } } } var valid0 = _errs23 === errors; } else { var valid0 = true; } if(valid0){ if(data.scopes_supported !== undefined){ let data7 = data.scopes_supported; const _errs33 = errors; const _errs34 = errors; let valid13 = false; const _errs35 = errors; if(errors === _errs35){ if(Array.isArray(data7)){ var valid14 = true; const len3 = data7.length; for(let i3=0; i3<len3; i3++){ let data8 = data7[i3]; const _errs37 = 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: schema20.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err19]; } else { vErrors.push(err19); } errors++; } var valid14 = _errs37 === errors; if(!valid14){ 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 = _errs35 === errors; valid13 = valid13 || _valid3; if(!valid13){ const _errs40 = 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: schema20.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err22]; } else { vErrors.push(err22); } errors++; } var _valid3 = _errs40 === errors; valid13 = valid13 || _valid3; } if(!valid13){ 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 = _errs34; if(vErrors !== null){ if(_errs34){ vErrors.length = _errs34; } else { vErrors = null; } } } var valid0 = _errs33 === errors; } else { var valid0 = true; } if(valid0){ if(data.subject_types_supported !== undefined){ let data9 = data.subject_types_supported; const _errs43 = errors; const _errs44 = errors; let valid17 = false; const _errs45 = errors; if(errors === _errs45){ if(Array.isArray(data9)){ var valid18 = true; const len4 = data9.length; for(let i4=0; i4<len4; i4++){ let data10 = data9[i4]; const _errs47 = 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: schema22.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err25]; } else { vErrors.push(err25); } errors++; } var valid18 = _errs47 === errors; if(!valid18){ 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 = _errs45 === errors; valid17 = valid17 || _valid4; if(!valid17){ const _errs50 = 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: schema22.enum},message:"must be equal to one of the allowed values"}; if(vErrors === null){ vErrors = [err28]; } else { vErrors.push(err28); } errors++; } var _valid4 = _errs50 === errors; valid17 = valid17 || _valid4; } if(!valid17){ 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 = _errs44; if(vErrors !== null){ if(_errs44){ vErrors.length = _errs44; } else { vErrors = null; } } } var valid0 = _errs43 === errors; } else { var valid0 = true; } if(valid0){ if(data.subject_syntax_types_supported !== undefined){ let data11 = data.subject_syntax_types_supported; const _errs53 = errors; if(errors === _errs53){ if(Array.isArray(data11)){ var valid21 = true; const len5 = data11.length; for(let i5=0; i5<len5; i5++){ const _errs55 = 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 valid21 = _errs55 === errors; if(!valid21){ 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 = _errs53 === errors; } else { var valid0 = true; } if(valid0){ if(data.vp_formats !== undefined){ const _errs57 = errors; var valid0 = _errs57 === errors; } else { var valid0 = true; } if(valid0){ if(data.client_name !== undefined){ const _errs59 = errors; var valid0 = _errs59 === errors; } else { var valid0 = true; } if(valid0){ if(data.logo_uri !== undefined){ const _errs61 = errors; var valid0 = _errs61 === errors; } else { var valid0 = true; } if(valid0){ if(data.client_purpose !== undefined){ const _errs63 = errors; var valid0 = _errs63 === 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; } const schema26 = {"type":"object","properties":{"id_token":{"$ref":"#/definitions/IdTokenClaimPayload"},"vp_token":{"$ref":"#/definitions/VpTokenClaimPayload"}}}; const schema27 = {"type":"object"}; const schema28 = {"type":"object","properties":{"presentation_definition":{"anyOf":[{"$ref":"#/definitions/PresentationDefinitionV1"},{"$ref":"#/definitions/PresentationDefinitionV2"}]},"presentation_definition_uri":{"type":"string"},"dcql_query":{"type":"string"}},"additionalProperties":false}; const schema29 = {"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"purpose":{"type":"string"},"format":{"$ref":"#/definitions/Format"},"submission_requirements":{"type":"array","items":{"$ref":"#/definitions/SubmissionRequirement"}},"input_descriptors":{"type":"array","items":{"$ref":"#/definitions/InputDescriptorV1"}}},"required":["id","input_descriptors"],"additionalProperties":false}; const schema30 = {"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}; const schema31 = {"type":"object","properties":{"alg":{"type":"array","items":{"type":"string"}}},"required":["alg"],"additionalProperties":false}; const schema36 = {"type":"object","properties":{"proof_type":{"type":"array","items":{"type":"string"}}},"required":["proof_type"],"additionalProperties":false}; const schema39 = {"type":"object","properties":{"proof_type":{"type":"array","items":{"type":"string"}},"cryptosuite":{"type":"array","items":{"type":"string"}}},"required":["proof_type","cryptosuite"],"additionalProperties":false}; const schema42 = {"type":"object","properties":{"sd-jwt_alg_values":{"type":"array","items":{"type":"string"}},"kb-jwt_alg_values":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}; const schema43 = {"type":"object","properties":{"alg":{"type":"array","items":{"type":"string"}}},"required":["alg"],"additionalProperties":false}; const 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(schema30.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 !== undefined){ 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 === undefined) && (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 !== undefined){ 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 !== undefined){ 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 === undefined) && (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 !== undefined){ 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 !== undefined){ 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 === undefined) && (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 !== undefined){ 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 !== undefined){ 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 === undefined) && (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 !== undefined){ 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 !== undefined){ 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 === undefined) && (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 !== undefined){ let data13 = data12.alg; const _errs38 = errors; if(errors === _errs38){ if(Array.isArray(data13)){ var valid15 = true; const len4 = data13.length; for(let i4=0; i4<len4; i4++){ const _errs40 = errors; if(typeof data13[i4] !== "string"){ validate17.errors = [{instancePath:instancePath+"/jwt_vp_json/alg/" + i4,schemaPath:"#/definitions/JwtObject/properties/alg/items/type",keyword:"type",params:{type: "string"},message:"must be string"}]; return false; } var valid15 = _errs40 === errors; if(!valid15){ break; } } } else { validate17.errors = [{instancePath:instancePath+"/jwt_vp_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_vp_json",schemaPath:"#/definitions/JwtObject/type",keyword:"type",params:{type: "object"},message:"must be object"}]; return false; } } var valid0 = _errs34 === errors; } else { var valid0 = true; } if(valid0){ if(data.ldp !== undefined){ let data15 = data.ldp; const _errs42 = errors; const _errs43 = errors; if(errors === _errs43){ if(data15 && typeof data15 == "object" && !Array.isArray(data15)){ let missing5; if((data15.proof_type === undefined) && (missing5 = "proof_type")){ validate17.errors = [{instancePath:instancePath+"/ldp",schemaPath:"#/definitions/LdpObject/required",keyword:"required",params:{missingProperty: missing5},message:"must have required property '"+missing5+"'"}]; return false; } else { const _errs45 = errors; for(const key6 in data15){ if(!(key6 === "proof_type")){ validate17.errors = [{instancePath:instancePath+"/ldp",schemaPath:"#/definitions/LdpObject/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"}]; return false; break; } } if(_errs45 === errors){ if(data15.proof_type !== undefined){ let data16 = data15.proof_type; const _errs46 = errors; if(errors === _errs46){ if(Array.isArray(data16)){ var valid18 = true; const len5 = data16.length; for(let i5=0; i5<len5; i5++){ const _errs48 = errors; if(typeof data16[i5] !== "string"){ validate17.errors = [{instancePath:instancePath+"/ldp/proof_type/" + i5,schemaPath:"#/definitions/LdpObject/properties/proof_type/items/type",keyword:"type",params:{type: "string"},message:"must be string"}]; return false; } var valid18 = _errs48 === errors; if(!valid18){ break; } } } else { validate17.errors = [{instancePath:instancePath+"/ldp/proof_type",schemaPath:"#/definitions/LdpObject/properties/proof_type/type",keyword:"type",params:{type: "array"},message:"must be array"}]; return false; } } } } } } else { validate17.errors = [{instancePath:instancePath+"/ldp",schemaPath:"#/definitions/LdpObject/type",keyword:"type",params:{type: "object"},message:"must be object"}]; return false; } } var valid0 = _errs42 === errors; } else { var valid0 = true; } if(valid0){ if(data.ldp_vc !== undefined){ let data18 = data.ldp_vc; const _errs50 = errors; const _errs51 = errors; if(errors === _errs51){ if(data18 && typeof data18 == "object" && !Array.isArray(data18)){ let missing6; if((data18.proof_type === undefined) && (missing6 = "proof_type")){ validate17.errors = [{instancePath:instancePath+"/ldp_vc",schemaPath:"#/definitions/LdpObject/required",keyword:"required",params:{missingProperty: missing6},message:"must have required property '"+missing6+"'"}]; return false; } else { const _errs53 = errors; for(const key7 in data18){ if(!(key7 === "proof_type")){ validate17.errors = [{instancePath:instancePath+"/ldp_vc",schemaPath:"#/definitions/LdpObject/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"}]; return false; break; } } if(_errs53 === errors){ if(data18.proof_type !== undefined){ let data19 = data18.proof_type; const _errs54 = errors; if(errors === _errs54){ if(Array.isArray(data19)){ var valid21 = true; const len6 = data19.length; for(let i6=0; i6<len6; i6++){ const _errs56 = errors; if(typeof data19[i6] !== "string"){ validate17.errors = [{instancePath:instancePath+"/ldp_vc/proof_type/" + i6,schemaPath:"#/definitions/LdpObject/properties/proof_type/items/type",keyword:"type",params:{type: "string"},message:"must be string"}]; return false; } var valid21 = _errs56 === errors; if(!valid21){ break; } } } else { validate17.errors = [{instancePath:instancePath+"/ldp_vc/proof_type",schemaPath:"#/definitions/LdpObject/properties/proof_type/type",keyword:"type",params:{type: "array"},message:"must be array"}]; return false; } } } } } } else { validate17.errors = [{instancePath:instancePath+"/ldp_vc",schemaPath:"#/definitions/LdpObject/type",keyword:"type",params:{type: "object"},message:"must be object"}]; return false; } } var valid0 = _errs50 === errors; } else { var valid0 = true; } if(valid0){ if(data.ldp_vp !== undefined){ let data21 = data.ldp_vp; const _errs58 = errors; const _errs59 = errors; if(errors === _errs59){ if(data21 && typeof data21 == "object" && !Array.isArray(data21)){ let missing7; if((data21.proof_type === undefined) && (missing7 = "proof_type")){ validate17.errors = [{instancePath:instancePath+"/ldp_vp",schemaPath:"#/definitions/LdpObject/required",keyword:"required",params:{missingProperty: missing7},message:"must have required property '"+missing7+"'"}]; return false; } else { const _errs61 = errors; for(const key8 in data21){ if(!(key8 === "proof_type")){ validate17.errors = [{instancePath:instancePath+"/ldp_vp",schemaPath:"#/definitions/LdpObject/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key8},message:"must NOT have additional properties"}]; return false; break; } } if(_errs61 === errors){ if(data21.proof_type !== undefined){ let data22 = data21.proof_type; const _errs62 = errors; if(errors === _errs62){ if(Array.isArray(data22)){ var valid24 = true; const len7 = data22.length; for(let i7=0; i7<len7; i7++){ const _errs64 = errors; if(typeof data22[i7] !== "string"){ validate17.errors = [{instancePath:instancePath+"/ldp_vp/proof_type/" + i7,schemaPath:"#/definitions/LdpObject/properties/proof_type/items/type",keyword:"type",params:{type: "string"},message:"must be string"}]; return false; } var valid24 = _errs64 === errors; if(!valid24){ break; } } } else { validate17.errors = [{instancePath:instancePath+"/ldp_vp/proof_type",schemaPath:"#/definitions/LdpObject/properties/proof_type/type",keyword:"type",params:{type: "array"},message:"must be array"}]; return false; } } } } } } else { validate17.errors = [{instancePath:instancePath+"/ldp_vp",schemaPath:"#/definitions/LdpObject/type",keyword:"type",params:{type: "object"},message:"must be object"}]; return false; } } var valid0 = _errs58 === errors; } else { var valid0 = true; } if(valid0){ if(data.di !== undefined){ let data24 = data.di; const _errs66 = errors; const _errs67 = errors; if(errors === _errs67){ if(data24 && typeof data24 == "object" && !Array.isArray(data24)){ let missing8; if(((data24.proof_type === undefined) && (missing8 = "proof_type")) || ((data24.cryptosuite === undefined) && (missing8 = "cryptosuite"))){ validate17.errors = [{instancePath:instancePath+"/di",schemaPath:"#/definitions/DiObject/required",keyword:"required",params:{missingProperty: missing8},message:"must have required property '"+missing8+"'"}]; return false; } else { const _errs69 = errors; for(const key9 in data24){ if(!((key9 === "proof_type") || (key9 === "cryptosuite"))){ validate17.errors = [{instancePath:instancePath+"/di",schemaPath:"#/definitions/DiObject/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key9},message:"must NOT have additional properties"}]; return false; break; } } if(_errs69 === errors){ if(data24.proof_type !== undefined){ let data25 = data24.proof_type; const _errs70 = errors; if(errors === _errs70){ if(Array.isArray(data25)){ var valid27 = true; const len8 = data25.length; for(let i8=0; i8<len8; i8++){ const _errs72 = errors; if(typeof data25[i8] !== "