diff --git a/packages/callback-example/lib/__tests__/issuerCallback.spec.ts b/packages/callback-example/lib/__tests__/issuerCallback.spec.ts index be203bd9..2a9aabe6 100644 --- a/packages/callback-example/lib/__tests__/issuerCallback.spec.ts +++ b/packages/callback-example/lib/__tests__/issuerCallback.spec.ts @@ -121,7 +121,7 @@ describe('issuerCallback', () => { { format: 'ldp_vc', credential_definition: { - types: ['VerifiableCredential'], + type: ['VerifiableCredential'], '@context': ['https://www.w3.org/2018/credentials/v1'], credentialSubject: {}, }, diff --git a/packages/client/lib/CredentialRequestClient.ts b/packages/client/lib/CredentialRequestClient.ts index 6918d477..33ad5488 100644 --- a/packages/client/lib/CredentialRequestClient.ts +++ b/packages/client/lib/CredentialRequestClient.ts @@ -104,14 +104,14 @@ export class CredentialRequestClient { return { types, format, - proof, + proof, // TODO Don't we need credential_definition here as well? }; } else if (format === 'jwt_vc_json-ld' || format === 'ldp_vc') { return { format, proof, credential_definition: { - types, + type: types, // FIXME: this was not included in the original code, but it is required '@context': [], }, diff --git a/packages/client/lib/OpenID4VCIClient.ts b/packages/client/lib/OpenID4VCIClient.ts index 77993c53..0471ab65 100644 --- a/packages/client/lib/OpenID4VCIClient.ts +++ b/packages/client/lib/OpenID4VCIClient.ts @@ -500,7 +500,7 @@ export class OpenID4VCIClient { } else if ('vct' in c) { return [c.vct]; } else { - return c.credential_definition.types; + return c.credential_definition.type; } }); } diff --git a/packages/common/lib/functions/CredentialOfferUtil.ts b/packages/common/lib/functions/CredentialOfferUtil.ts index 235ea56d..7e075d15 100644 --- a/packages/common/lib/functions/CredentialOfferUtil.ts +++ b/packages/common/lib/functions/CredentialOfferUtil.ts @@ -271,7 +271,7 @@ export function getTypesFromOffer(credentialOffer: UniformCredentialOfferPayload if (typeof curr === 'string') { return [...prev, curr]; } else if (curr.format === 'jwt_vc_json-ld' || curr.format === 'ldp_vc') { - return [...prev, ...curr.credential_definition.types]; + return [...prev, ...curr.credential_definition.type]; } else if (curr.format === 'jwt_vc_json' || curr.format === 'jwt_vc') { return [...prev, ...curr.types]; } else if (curr.format === 'vc+sd-jwt') { diff --git a/packages/common/lib/functions/CredentialRequestUtil.ts b/packages/common/lib/functions/CredentialRequestUtil.ts index 9eac981a..55ebbe66 100644 --- a/packages/common/lib/functions/CredentialRequestUtil.ts +++ b/packages/common/lib/functions/CredentialRequestUtil.ts @@ -5,7 +5,7 @@ export function getTypesFromRequest(credentialRequest: UniformCredentialRequest, if (credentialRequest.format === 'jwt_vc_json' || credentialRequest.format === 'jwt_vc') { types = credentialRequest.types; } else if (credentialRequest.format === 'jwt_vc_json-ld' || credentialRequest.format === 'ldp_vc') { - types = credentialRequest.credential_definition.types; + types = credentialRequest.credential_definition.type; } else if (credentialRequest.format === 'vc+sd-jwt') { types = [credentialRequest.vct]; } diff --git a/packages/common/lib/types/Generic.types.ts b/packages/common/lib/types/Generic.types.ts index 50defbe6..06b82b51 100644 --- a/packages/common/lib/types/Generic.types.ts +++ b/packages/common/lib/types/Generic.types.ts @@ -185,7 +185,7 @@ export type CreateCredentialOfferURIResult = { export interface JsonLdIssuerCredentialDefinition { '@context': ICredentialContextType[]; - types: string[]; + type: string[]; credentialSubject?: IssuerCredentialSubject; } diff --git a/packages/issuer-rest/lib/__tests__/IssuerTokenServer.spec.ts b/packages/issuer-rest/lib/__tests__/IssuerTokenServer.spec.ts index fde3285a..cbc600c2 100644 --- a/packages/issuer-rest/lib/__tests__/IssuerTokenServer.spec.ts +++ b/packages/issuer-rest/lib/__tests__/IssuerTokenServer.spec.ts @@ -49,7 +49,7 @@ describe('OID4VCIServer', () => { format: 'ldp_vc', credential_definition: { '@context': ['test_context'], - types: ['VerifiableCredential'], + type: ['VerifiableCredential'], credentialSubject: {}, }, }, diff --git a/packages/issuer/lib/__tests__/VcIssuer.spec.ts b/packages/issuer/lib/__tests__/VcIssuer.spec.ts index c5e56954..e607c539 100644 --- a/packages/issuer/lib/__tests__/VcIssuer.spec.ts +++ b/packages/issuer/lib/__tests__/VcIssuer.spec.ts @@ -61,7 +61,7 @@ describe('VcIssuer', () => { { format: 'ldp_vc', credential_definition: { - types: ['VerifiableCredential'], + type: ['VerifiableCredential'], '@context': ['https://www.w3.org/2018/credentials/v1'], credentialSubject: {}, },