From f624b11f046f94190cbd687974c712220c59a9ce Mon Sep 17 00:00:00 2001 From: Artur Sudnik-Hrynkiewicz Date: Thu, 28 Sep 2023 12:17:49 +0200 Subject: [PATCH] fix: fixing `issuer` not included in the allowed field names --- .../src/validators/is-allowed-field-json-path-key.ts | 2 +- apps/input-descriptor-to-credential/test/app.e2e-spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/input-descriptor-to-credential/src/validators/is-allowed-field-json-path-key.ts b/apps/input-descriptor-to-credential/src/validators/is-allowed-field-json-path-key.ts index 3dfc4d1f..3ba40d71 100644 --- a/apps/input-descriptor-to-credential/src/validators/is-allowed-field-json-path-key.ts +++ b/apps/input-descriptor-to-credential/src/validators/is-allowed-field-json-path-key.ts @@ -23,7 +23,7 @@ import { } from 'class-validator'; import { ValidationArguments } from 'class-validator/types/validation/ValidationArguments'; -export const allowedFieldNames = ['@context', 'credentialSubject', 'id', 'issuanceDate', 'type']; +export const allowedFieldNames = ['@context', 'credentialSubject', 'id', 'issuanceDate', 'type', 'issuer']; @ValidatorConstraint({ async: false }) export class IsAllowedFieldJsonPathKeyConstraint implements ValidatorConstraintInterface { diff --git a/apps/input-descriptor-to-credential/test/app.e2e-spec.ts b/apps/input-descriptor-to-credential/test/app.e2e-spec.ts index a0ba9499..8568edcd 100644 --- a/apps/input-descriptor-to-credential/test/app.e2e-spec.ts +++ b/apps/input-descriptor-to-credential/test/app.e2e-spec.ts @@ -95,7 +95,7 @@ describe('AppController (e2e)', () => { expect(result.body).toEqual({ error: 'Bad Request', message: [ - 'constraints.fields.0.path property key name value must be one of the allowed string values: @context,credentialSubject,id,issuanceDate,type', + 'constraints.fields.0.path property key name value must be one of the allowed string values: @context,credentialSubject,id,issuanceDate,type,issuer', 'constraints.fields needs to be an array of objects with at least the following path field values: $.@context, $.credentialSubject, $.type' ], statusCode: 400