@sphereon/did-auth-siop
Version:
Self Issued OpenID V2 (SIOPv2) and OpenID 4 Verifiable Presentations (OID4VP)
548 lines (547 loc) • 4.63 MB
JavaScript
"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;
}
}
}