diff --git a/CHANGELOG.md b/CHANGELOG.md index 1692cdf..93635ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [1.4.1] + +Changed credential endpoint payload for `jwt_vc_json` to use `credential_definition.type` to support `organisation-wallet` version `0.0.13` + ## [1.4.0] Add [PAR - Pushed Authorization Request](https://www.rfc-editor.org/rfc/rfc9126.html) support diff --git a/README.md b/README.md index 2a7077d..7d86bfd 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ EXAMPLE FILES # Meeco Organisation Wallet -Compatible version `>=0.0.10` +Compatible version `>=0.0.13` ## `meeco-wallet-cli create-credential-offer` diff --git a/package.json b/package.json index 67e9ce7..5cb827e 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,7 @@ "prepare": "npm run build", "version": "oclif readme && git add README.md" }, - "version": "1.4.0", + "version": "1.4.1", "keywords": [ "oclif", "sd-jwt", diff --git a/src/types/create-credential-offer.types.ts b/src/types/create-credential-offer.types.ts index 4b037d6..6a63318 100644 --- a/src/types/create-credential-offer.types.ts +++ b/src/types/create-credential-offer.types.ts @@ -1,13 +1,13 @@ export type CredentialMetadata = { credential_definition: { - types?: string[]; + type?: string[]; vct?: string; }; display: Array<{ name: string }>; format: string; id: string; types?: string[]; -} +}; export type Credential = { credentialIdentifier: string; @@ -15,4 +15,4 @@ export type Credential = { id: string; name: string; types: string[]; -} +}; diff --git a/src/types/openid.types.ts b/src/types/openid.types.ts index ada6e71..e5b5e7e 100644 --- a/src/types/openid.types.ts +++ b/src/types/openid.types.ts @@ -12,7 +12,7 @@ export enum GRANT_TYPES { export type SupportedCredential = { credential_definition: { - types?: string[]; + type?: string[]; vct?: string; }; cryptographic_binding_methods_supported: string[]; @@ -24,7 +24,6 @@ export type SupportedCredential = { ]; format: string; id: string; - types?: string[]; }; export type SupportedCredentialMap = { diff --git a/src/utils/openid/vci.ts b/src/utils/openid/vci.ts index 2fa80b5..a517417 100644 --- a/src/utils/openid/vci.ts +++ b/src/utils/openid/vci.ts @@ -41,8 +41,8 @@ class CredentialOfferError extends Error { } function parseSupportedCredential(credentialIdentifier: string, credential: CredentialMetadata): CredentialChoice { - const credentialTypes = credential.types ?? - credential.credential_definition.types ?? [credential.credential_definition.vct as string]; + const credentialTypes = credential.credential_definition.type ?? + credential.credential_definition.type ?? [credential.credential_definition.vct as string]; const vc: Credential = { credentialIdentifier, @@ -169,10 +169,10 @@ async function exchangePreauthCodeWithToken(endpoint: string, code: string, user type CredentialOfferMetadata = { credential_definition?: { - vct: string; + type?: string[]; + vct?: string; }; format: string; - types?: string[]; // TODO: move this types into credential_definition to support jwt_vc_json }; export async function issueVC(issuer: string, endpoint: string, token: TokenSet, metadata: CredentialOfferMetadata) { @@ -221,7 +221,9 @@ export function getCredentialInfo( format: credentialMetadata.format, } : { + credential_definition: { + type: credentialMetadata.credential_definition.type, + }, format: credentialMetadata.format, - types: credentialMetadata.credential_definition?.types ?? credentialMetadata.types, }; }