@credo-ts/didcomm 0.7.1 → 0.7.2-alpha-20260918180656
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.d.mts +7 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.d.mts.map +1 -1
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.mjs +20 -6
- package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -82,6 +82,12 @@ declare class DidCommJsonLdCredentialFormatService implements DidCommCredentialF
|
|
|
82
82
|
requestAttachment
|
|
83
83
|
}: DidCommCredentialFormatProcessCredentialOptions): Promise<void>;
|
|
84
84
|
private verifyReceivedCredentialMatchesRequest;
|
|
85
|
+
/**
|
|
86
|
+
* Returns the requested credential with the `@context` of the agreed proof type's signature suite
|
|
87
|
+
* appended, mirroring what the issuer's suite does when signing. Returns the requested credential
|
|
88
|
+
* unchanged if the context is already present or the suite declares no context url.
|
|
89
|
+
*/
|
|
90
|
+
private withSuiteContext;
|
|
85
91
|
supportsFormat(format: string): boolean;
|
|
86
92
|
deleteCredentialById(agentContext: AgentContext, credentialRecordId: string): Promise<void>;
|
|
87
93
|
areCredentialsEqual: (message1: DidCommAttachment, message2: DidCommAttachment) => boolean;
|
|
@@ -97,7 +103,7 @@ declare class DidCommJsonLdCredentialFormatService implements DidCommCredentialF
|
|
|
97
103
|
offerAttachment,
|
|
98
104
|
requestAttachment
|
|
99
105
|
}: DidCommCredentialFormatAutoRespondRequestOptions): Promise<boolean>;
|
|
100
|
-
shouldAutoRespondToCredential(
|
|
106
|
+
shouldAutoRespondToCredential(agentContext: AgentContext, {
|
|
101
107
|
requestAttachment,
|
|
102
108
|
credentialAttachment
|
|
103
109
|
}: DidCommCredentialFormatAutoRespondCredentialOptions): Promise<boolean>;
|
package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommJsonLdCredentialFormatService.d.mts","names":[],"sources":["../../../../../src/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"DidCommJsonLdCredentialFormatService.d.mts","names":[],"sources":["../../../../../src/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.ts"],"mappings":";;;;;;;cA8Ca,oCAAA,YACA,8BAAA,CAA+B,6BAAA;EAAA,SAE1B,SAAA;EAAA,SACA,oBAAA;EAHhB;;;;;;;EAYa,cAAA,CACX,aAAA,EAAe,YAAA;IACb;EAAA,GAAqB,4CAAA,CAA6C,6BAAA,IACnE,OAAA,CAAQ,2CAAA;EAAR;;;;EAsBU,eAAA,CACX,aAAA,EAAe,YAAA;IACb;EAAA,GAAc,qCAAA,GACf,OAAA;EAWU,cAAA,CACX,aAAA,EAAe,YAAA;IACb,YAAA;IAAc;EAAA,GAAsB,4CAAA,CAA6C,6BAAA,IAClF,OAAA,CAAQ,wCAAA;EADP;;;;;;;EAyBS,WAAA,CACX,aAAA,EAAe,YAAA;IACb,iBAAA;IAAmB;EAAA,GAAgB,yCAAA,CAA0C,6BAAA,IAC9E,OAAA,CAAQ,wCAAA;EAoBE,YAAA,CAAa,aAAA,EAAe,YAAA;IAAgB;EAAA,GAAc,qCAAA,GAAqC,OAAA;EAU/F,WAAA,CACX,aAAA,EAAe,YAAA;IACb,YAAA;IAAc;EAAA,GAAmB,yCAAA,CAA0C,6BAAA,IAC5E,OAAA,CAAQ,mCAAA;EAlC4B;;;;;;;EAwD1B,aAAA,CACX,aAAA,EAAe,YAAA;IACb;EAAA,GAAqB,2CAAA,CAA4C,6BAAA,IAClE,OAAA,CAAQ,mCAAA;EAmBE,cAAA,CACX,aAAA,EAAe,YAAA;IACb;EAAA,GAAc,qCAAA,GACf,OAAA;EAWU,aAAA,CACX,YAAA,EAAc,YAAA;IAEZ,iBAAA;IACA,YAAA;IACA;EAAA,GACC,2CAAA,CAA4C,6BAAA,IAC9C,OAAA,CAAQ,mCAAA;EAlEoE;;;;;EAAA,QAiHjE,wBAAA;EAxFuD;;;;;EAqIxD,iBAAA,CACX,YAAA,EAAc,YAAA;IACZ,wBAAA;IAA0B,UAAA;IAAY;EAAA,GAAqB,+CAAA,GAC5D,OAAA;EAAA,QA0BK,sCAAA;EA3IL;;;;;EAAA,QA8LK,gBAAA;EAYD,cAAA,CAAe,MAAA;EAMT,oBAAA,CAAqB,YAAA,EAAc,YAAA,EAAc,kBAAA,WAA6B,OAAA;EAMpF,mBAAA,GAAuB,QAAA,EAAU,iBAAA,EAAmB,QAAA,EAAU,iBAAA;EAOxD,2BAAA,CACX,aAAA,EAAe,YAAA;IACb,eAAA;IAAiB;EAAA,GAAsB,iDAAA,GAAiD,OAAA;EAK/E,wBAAA,CACX,aAAA,EAAe,YAAA;IACb,eAAA;IAAiB;EAAA,GAAsB,8CAAA,GAA8C,OAAA;EAK5E,0BAAA,CACX,aAAA,EAAe,YAAA;IACb,eAAA;IAAiB;EAAA,GAAqB,gDAAA,GAAgD,OAAA;EAK7E,6BAAA,CACX,YAAA,EAAc,YAAA;IACZ,iBAAA;IAAmB;EAAA,GAAwB,mDAAA,GAAmD,OAAA;EApInC;;;;;;;EAAA,QA4JvD,aAAA;AAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DidCommAttachment, DidCommAttachmentData } from "../../../../decorators/attachment/DidCommAttachment.mjs";
|
|
2
2
|
import { DidCommCredentialFormatSpec } from "../../models/DidCommCredentialFormatSpec.mjs";
|
|
3
3
|
import { DidCommJsonLdCredentialDetail } from "./DidCommJsonLdCredentialDetail.mjs";
|
|
4
|
-
import { ClaimFormat, CredoError, DidResolverService, JsonEncoder, JsonTransformer, W3cCredential, W3cCredentialRecord, W3cCredentialService, W3cJsonLdCredentialService, W3cJsonLdVerifiableCredential, utils } from "@credo-ts/core";
|
|
4
|
+
import { ClaimFormat, CredoError, DidResolverService, JsonEncoder, JsonTransformer, SignatureSuiteRegistry, W3cCredential, W3cCredentialRecord, W3cCredentialService, W3cJsonLdCredentialService, W3cJsonLdVerifiableCredential, utils } from "@credo-ts/core";
|
|
5
5
|
|
|
6
6
|
//#region src/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.ts
|
|
7
7
|
const JSONLD_VC_DETAIL = "aries/ld-proof-vc-detail@v1.0";
|
|
@@ -171,7 +171,7 @@ var DidCommJsonLdCredentialFormatService = class {
|
|
|
171
171
|
const credentialAsJson = attachment.getDataAsJson();
|
|
172
172
|
const credential = JsonTransformer.fromJSON(credentialAsJson, W3cJsonLdVerifiableCredential);
|
|
173
173
|
const requestAsJson = requestAttachment.getDataAsJson();
|
|
174
|
-
this.verifyReceivedCredentialMatchesRequest(credential, requestAsJson);
|
|
174
|
+
this.verifyReceivedCredentialMatchesRequest(agentContext, credential, requestAsJson);
|
|
175
175
|
const result = await w3cCredentialService.verifyCredential(agentContext, { credential });
|
|
176
176
|
if (result && !result.isValid) throw new CredoError(`Failed to validate credential, error = ${result.error}`);
|
|
177
177
|
const verifiableCredential = await w3cCredentialService.storeCredential(agentContext, { record: W3cCredentialRecord.fromCredential(credential) });
|
|
@@ -180,7 +180,7 @@ var DidCommJsonLdCredentialFormatService = class {
|
|
|
180
180
|
credentialRecordId: verifiableCredential.id
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
verifyReceivedCredentialMatchesRequest(credential, request) {
|
|
183
|
+
verifyReceivedCredentialMatchesRequest(agentContext, credential, request) {
|
|
184
184
|
const jsonCredential = JsonTransformer.toJSON(credential);
|
|
185
185
|
jsonCredential.proof = void 0;
|
|
186
186
|
if (Array.isArray(credential.proof)) throw new CredoError("Credential proof arrays are not supported");
|
|
@@ -189,7 +189,21 @@ var DidCommJsonLdCredentialFormatService = class {
|
|
|
189
189
|
if (credential.proof.challenge !== request.options.challenge) throw new CredoError("Received credential proof challenge does not match challenge from credential request");
|
|
190
190
|
if (credential.proof.type !== request.options.proofType) throw new CredoError("Received credential proof type does not match proof type from credential request");
|
|
191
191
|
if (credential.proof.proofPurpose !== request.options.proofPurpose) throw new CredoError("Received credential proof purpose does not match proof purpose from credential request");
|
|
192
|
-
if (!utils.areObjectsEqual(jsonCredential, request.credential)) throw new CredoError("Received credential does not match credential request");
|
|
192
|
+
if (!utils.areObjectsEqual(jsonCredential, request.credential) && !utils.areObjectsEqual(jsonCredential, this.withSuiteContext(agentContext, request))) throw new CredoError("Received credential does not match credential request");
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Returns the requested credential with the `@context` of the agreed proof type's signature suite
|
|
196
|
+
* appended, mirroring what the issuer's suite does when signing. Returns the requested credential
|
|
197
|
+
* unchanged if the context is already present or the suite declares no context url.
|
|
198
|
+
*/
|
|
199
|
+
withSuiteContext(agentContext, request) {
|
|
200
|
+
const suiteContextUrl = agentContext.dependencyManager.resolve(SignatureSuiteRegistry).findContextUrlByProofType(request.options.proofType);
|
|
201
|
+
const existingContext = request.credential["@context"];
|
|
202
|
+
if (!suiteContextUrl || !Array.isArray(existingContext) || existingContext.includes(suiteContextUrl)) return request.credential;
|
|
203
|
+
return {
|
|
204
|
+
...request.credential,
|
|
205
|
+
"@context": [...existingContext, suiteContextUrl]
|
|
206
|
+
};
|
|
193
207
|
}
|
|
194
208
|
supportsFormat(format) {
|
|
195
209
|
return [JSONLD_VC_DETAIL, JSONLD_VC].includes(format);
|
|
@@ -206,12 +220,12 @@ var DidCommJsonLdCredentialFormatService = class {
|
|
|
206
220
|
async shouldAutoRespondToRequest(_agentContext, { offerAttachment, requestAttachment }) {
|
|
207
221
|
return this.areCredentialsEqual(offerAttachment, requestAttachment);
|
|
208
222
|
}
|
|
209
|
-
async shouldAutoRespondToCredential(
|
|
223
|
+
async shouldAutoRespondToCredential(agentContext, { requestAttachment, credentialAttachment }) {
|
|
210
224
|
const credentialJson = credentialAttachment.getDataAsJson();
|
|
211
225
|
const w3cCredential = JsonTransformer.fromJSON(credentialJson, W3cJsonLdVerifiableCredential);
|
|
212
226
|
const request = requestAttachment.getDataAsJson();
|
|
213
227
|
try {
|
|
214
|
-
this.verifyReceivedCredentialMatchesRequest(w3cCredential, request);
|
|
228
|
+
this.verifyReceivedCredentialMatchesRequest(agentContext, w3cCredential, request);
|
|
215
229
|
return true;
|
|
216
230
|
} catch (_error) {
|
|
217
231
|
return false;
|
package/build/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DidCommJsonLdCredentialFormatService.mjs","names":[],"sources":["../../../../../src/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport {\n ClaimFormat,\n CredoError,\n DidResolverService,\n JsonEncoder,\n JsonTransformer,\n utils,\n W3cCredential,\n W3cCredentialRecord,\n W3cCredentialService,\n W3cJsonLdCredentialService,\n W3cJsonLdVerifiableCredential,\n} from '@credo-ts/core'\nimport { DidCommAttachment, DidCommAttachmentData } from '../../../../decorators/attachment/DidCommAttachment'\nimport { DidCommCredentialFormatSpec } from '../../models/DidCommCredentialFormatSpec'\nimport type { DidCommCredentialFormatService } from '../DidCommCredentialFormatService'\nimport type {\n DidCommCredentialFormatAcceptOfferOptions,\n DidCommCredentialFormatAcceptProposalOptions,\n DidCommCredentialFormatAcceptRequestOptions,\n DidCommCredentialFormatAutoRespondCredentialOptions,\n DidCommCredentialFormatAutoRespondOfferOptions,\n DidCommCredentialFormatAutoRespondProposalOptions,\n DidCommCredentialFormatAutoRespondRequestOptions,\n DidCommCredentialFormatCreateOfferOptions,\n DidCommCredentialFormatCreateOfferReturn,\n DidCommCredentialFormatCreateProposalOptions,\n DidCommCredentialFormatCreateProposalReturn,\n DidCommCredentialFormatCreateRequestOptions,\n DidCommCredentialFormatCreateReturn,\n DidCommCredentialFormatProcessCredentialOptions,\n DidCommCredentialFormatProcessOptions,\n} from '../DidCommCredentialFormatServiceOptions'\nimport { DidCommJsonLdCredentialDetail } from './DidCommJsonLdCredentialDetail'\nimport type {\n DidCommJsonLdCredentialFormat,\n JsonCredential,\n JsonLdFormatDataCredentialDetail,\n JsonLdFormatDataVerifiableCredential,\n} from './DidCommJsonLdCredentialFormat'\n\nconst JSONLD_VC_DETAIL = 'aries/ld-proof-vc-detail@v1.0'\nconst JSONLD_VC = 'aries/ld-proof-vc@v1.0'\n\nexport class DidCommJsonLdCredentialFormatService\n implements DidCommCredentialFormatService<DidCommJsonLdCredentialFormat>\n{\n public readonly formatKey = 'jsonld' as const\n public readonly credentialRecordType = 'w3c' as const\n\n /**\n * Create a {@link AttachmentFormats} object dependent on the message type.\n *\n * @param options The object containing all the options for the proposed credential\n * @returns object containing associated attachment, formats and filtersAttach elements\n *\n */\n public async createProposal(\n _agentContext: AgentContext,\n { credentialFormats }: DidCommCredentialFormatCreateProposalOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateProposalReturn> {\n const format = new DidCommCredentialFormatSpec({\n format: JSONLD_VC_DETAIL,\n })\n\n const jsonLdFormat = credentialFormats.jsonld\n if (!jsonLdFormat) {\n throw new CredoError('Missing jsonld payload in createProposal')\n }\n\n // this does the validation\n JsonTransformer.fromJSON(jsonLdFormat.credential, DidCommJsonLdCredentialDetail)\n\n // jsonLdFormat is now of type JsonLdFormatDataCredentialDetail\n const attachment = this.getFormatData(jsonLdFormat, format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Method called on reception of a propose credential message\n * @param options the options needed to accept the proposal\n */\n public async processProposal(\n _agentContext: AgentContext,\n { attachment }: DidCommCredentialFormatProcessOptions\n ): Promise<void> {\n const credProposalJson = attachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n if (!credProposalJson) {\n throw new CredoError('Missing jsonld credential proposal data payload')\n }\n\n // validation is done in here\n JsonTransformer.fromJSON(credProposalJson, DidCommJsonLdCredentialDetail)\n }\n\n public async acceptProposal(\n _agentContext: AgentContext,\n { attachmentId, proposalAttachment }: DidCommCredentialFormatAcceptProposalOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n // if the offer has an attachment Id use that, otherwise the generated id of the formats object\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC_DETAIL,\n })\n\n const credentialProposal = proposalAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n JsonTransformer.fromJSON(credentialProposal, DidCommJsonLdCredentialDetail)\n\n const offerData = credentialProposal\n\n const attachment = this.getFormatData(offerData, format.attachmentId)\n\n return { format, attachment }\n }\n\n /**\n * Create a {@link AttachmentFormats} object dependent on the message type.\n *\n * @param options The object containing all the options for the credential offer\n * @returns object containing associated attachment, formats and offersAttach elements\n *\n */\n public async createOffer(\n _agentContext: AgentContext,\n { credentialFormats, attachmentId }: DidCommCredentialFormatCreateOfferOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n // if the offer has an attachment Id use that, otherwise the generated id of the formats object\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC_DETAIL,\n })\n\n const jsonLdFormat = credentialFormats?.jsonld\n if (!jsonLdFormat) {\n throw new CredoError('Missing jsonld payload in createOffer')\n }\n\n // validate\n JsonTransformer.fromJSON(jsonLdFormat.credential, DidCommJsonLdCredentialDetail)\n\n const attachment = this.getFormatData(jsonLdFormat, format.attachmentId)\n\n return { format, attachment }\n }\n\n public async processOffer(_agentContext: AgentContext, { attachment }: DidCommCredentialFormatProcessOptions) {\n const credentialOfferJson = attachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n if (!credentialOfferJson) {\n throw new CredoError('Missing jsonld credential offer data payload')\n }\n\n JsonTransformer.fromJSON(credentialOfferJson, DidCommJsonLdCredentialDetail)\n }\n\n public async acceptOffer(\n _agentContext: AgentContext,\n { attachmentId, offerAttachment }: DidCommCredentialFormatAcceptOfferOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n const credentialOffer = offerAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n // validate\n JsonTransformer.fromJSON(credentialOffer, DidCommJsonLdCredentialDetail)\n\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC_DETAIL,\n })\n\n const attachment = this.getFormatData(credentialOffer, format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Create a credential attachment format for a credential request.\n *\n * @param options The object containing all the options for the credential request is derived\n * @returns object containing associated attachment, formats and requestAttach elements\n *\n */\n public async createRequest(\n _agentContext: AgentContext,\n { credentialFormats }: DidCommCredentialFormatCreateRequestOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n const jsonLdFormat = credentialFormats?.jsonld\n\n const format = new DidCommCredentialFormatSpec({\n format: JSONLD_VC_DETAIL,\n })\n\n if (!jsonLdFormat) {\n throw new CredoError('Missing jsonld payload in createRequest')\n }\n\n // this does the validation\n JsonTransformer.fromJSON(jsonLdFormat.credential, DidCommJsonLdCredentialDetail)\n\n const attachment = this.getFormatData(jsonLdFormat, format.attachmentId)\n\n return { format, attachment }\n }\n\n public async processRequest(\n _agentContext: AgentContext,\n { attachment }: DidCommCredentialFormatProcessOptions\n ): Promise<void> {\n const requestJson = attachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n if (!requestJson) {\n throw new CredoError('Missing jsonld credential request data payload')\n }\n\n // validate\n JsonTransformer.fromJSON(requestJson, DidCommJsonLdCredentialDetail)\n }\n\n public async acceptRequest(\n agentContext: AgentContext,\n {\n credentialFormats,\n attachmentId,\n requestAttachment,\n }: DidCommCredentialFormatAcceptRequestOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n const w3cJsonLdCredentialService = agentContext.dependencyManager.resolve(W3cJsonLdCredentialService)\n\n // sign credential here. credential to be signed is received as the request attachment\n // (attachment in the request message from holder to issuer)\n const credentialRequest = requestAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n const verificationMethod =\n credentialFormats?.jsonld?.verificationMethod ??\n (await this.deriveVerificationMethod(agentContext, credentialRequest.credential, credentialRequest))\n\n if (!verificationMethod) {\n throw new CredoError('Missing verification method in credential data')\n }\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC,\n })\n\n const options = credentialRequest.options\n\n // Get a list of fields found in the options that are not supported at the moment\n const unsupportedFields = ['challenge', 'domain', 'credentialStatus', 'created'] as const\n const foundFields = unsupportedFields.filter((field) => options[field] !== undefined)\n\n if (foundFields.length > 0) {\n throw new CredoError(`Some fields are not currently supported in credential options: ${foundFields.join(', ')}`)\n }\n\n const credential = JsonTransformer.fromJSON(credentialRequest.credential, W3cCredential)\n\n const verifiableCredential = await w3cJsonLdCredentialService.signCredential(agentContext, {\n format: ClaimFormat.LdpVc,\n credential,\n proofType: credentialRequest.options.proofType,\n verificationMethod: verificationMethod,\n })\n\n const attachment = this.getFormatData(JsonTransformer.toJSON(verifiableCredential), format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Derive a verification method using the issuer from the given verifiable credential\n * @param credentialAsJson the verifiable credential we want to sign\n * @return the verification method derived from this credential and its associated issuer did, keys etc.\n */\n private async deriveVerificationMethod(\n agentContext: AgentContext,\n credentialAsJson: JsonCredential,\n credentialRequest: JsonLdFormatDataCredentialDetail\n ): Promise<string> {\n const didResolver = agentContext.dependencyManager.resolve(DidResolverService)\n const w3cJsonLdCredentialService = agentContext.dependencyManager.resolve(W3cJsonLdCredentialService)\n\n const credential = JsonTransformer.fromJSON(credentialAsJson, W3cCredential)\n\n // extract issuer from vc (can be string or Issuer)\n let issuerDid = credential.issuer\n\n if (typeof issuerDid !== 'string') {\n issuerDid = issuerDid.id\n }\n // this will throw an error if the issuer did is invalid\n const issuerDidDocument = await didResolver.resolveDidDocument(agentContext, issuerDid)\n\n // find first key which matches proof type\n const proofType = credentialRequest.options.proofType\n\n // actually gets the key type(s)\n const keyType = w3cJsonLdCredentialService.getVerificationMethodTypesByProofType(proofType)\n\n if (!keyType || keyType.length === 0) {\n throw new CredoError(`No Key Type found for proofType ${proofType}`)\n }\n\n const verificationMethod = issuerDidDocument.findVerificationMethodsByTypeAndPurpose(keyType, [\n 'assertionMethod',\n 'verificationMethod',\n ])[0]\n\n if (!verificationMethod) {\n throw new CredoError(`Missing verification method for key type ${keyType}`)\n }\n\n return verificationMethod.id\n }\n /**\n * Processes an incoming credential - retrieve metadata, retrieve payload and store it in the Indy wallet\n * @param options the issue credential message wrapped inside this object\n * @param credentialExchangeRecord the credential exchange record for this credential\n */\n public async processCredential(\n agentContext: AgentContext,\n { credentialExchangeRecord, attachment, requestAttachment }: DidCommCredentialFormatProcessCredentialOptions\n ): Promise<void> {\n const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService)\n\n const credentialAsJson = attachment.getDataAsJson()\n const credential = JsonTransformer.fromJSON(credentialAsJson, W3cJsonLdVerifiableCredential)\n const requestAsJson = requestAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n // Verify the credential request matches the credential\n this.verifyReceivedCredentialMatchesRequest(credential, requestAsJson)\n\n // verify signatures of the credential\n const result = await w3cCredentialService.verifyCredential(agentContext, { credential })\n if (result && !result.isValid) {\n throw new CredoError(`Failed to validate credential, error = ${result.error}`)\n }\n\n const verifiableCredential = await w3cCredentialService.storeCredential(agentContext, {\n record: W3cCredentialRecord.fromCredential(credential),\n })\n\n credentialExchangeRecord.credentials.push({\n credentialRecordType: this.credentialRecordType,\n credentialRecordId: verifiableCredential.id,\n })\n }\n\n private verifyReceivedCredentialMatchesRequest(\n credential: W3cJsonLdVerifiableCredential,\n request: JsonLdFormatDataCredentialDetail\n ): void {\n const jsonCredential = JsonTransformer.toJSON(credential)\n jsonCredential.proof = undefined\n\n if (Array.isArray(credential.proof)) {\n throw new CredoError('Credential proof arrays are not supported')\n }\n\n if (request.options.created && credential.proof.created !== request.options.created) {\n throw new CredoError('Received credential proof created does not match created from credential request')\n }\n\n if (credential.proof.domain !== request.options.domain) {\n throw new CredoError('Received credential proof domain does not match domain from credential request')\n }\n\n if (credential.proof.challenge !== request.options.challenge) {\n throw new CredoError('Received credential proof challenge does not match challenge from credential request')\n }\n\n if (credential.proof.type !== request.options.proofType) {\n throw new CredoError('Received credential proof type does not match proof type from credential request')\n }\n\n if (credential.proof.proofPurpose !== request.options.proofPurpose) {\n throw new CredoError('Received credential proof purpose does not match proof purpose from credential request')\n }\n\n // Check whether the received credential (minus the proof) matches the credential request\n if (!utils.areObjectsEqual(jsonCredential, request.credential)) {\n throw new CredoError('Received credential does not match credential request')\n }\n\n // TODO: add check for the credentialStatus once this is supported in Credo\n }\n\n public supportsFormat(format: string): boolean {\n const supportedFormats = [JSONLD_VC_DETAIL, JSONLD_VC]\n\n return supportedFormats.includes(format)\n }\n\n public async deleteCredentialById(agentContext: AgentContext, credentialRecordId: string): Promise<void> {\n const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService)\n\n await w3cCredentialService.removeCredentialRecord(agentContext, credentialRecordId)\n }\n\n public areCredentialsEqual = (message1: DidCommAttachment, message2: DidCommAttachment): boolean => {\n const obj1 = message1.getDataAsJson()\n const obj2 = message2.getDataAsJson()\n\n return utils.areObjectsEqual(obj1, obj2)\n }\n\n public async shouldAutoRespondToProposal(\n _agentContext: AgentContext,\n { offerAttachment, proposalAttachment }: DidCommCredentialFormatAutoRespondProposalOptions\n ) {\n return this.areCredentialsEqual(proposalAttachment, offerAttachment)\n }\n\n public async shouldAutoRespondToOffer(\n _agentContext: AgentContext,\n { offerAttachment, proposalAttachment }: DidCommCredentialFormatAutoRespondOfferOptions\n ) {\n return this.areCredentialsEqual(proposalAttachment, offerAttachment)\n }\n\n public async shouldAutoRespondToRequest(\n _agentContext: AgentContext,\n { offerAttachment, requestAttachment }: DidCommCredentialFormatAutoRespondRequestOptions\n ) {\n return this.areCredentialsEqual(offerAttachment, requestAttachment)\n }\n\n public async shouldAutoRespondToCredential(\n _agentContext: AgentContext,\n { requestAttachment, credentialAttachment }: DidCommCredentialFormatAutoRespondCredentialOptions\n ) {\n const credentialJson = credentialAttachment.getDataAsJson<JsonLdFormatDataVerifiableCredential>()\n const w3cCredential = JsonTransformer.fromJSON(credentialJson, W3cJsonLdVerifiableCredential)\n const request = requestAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n try {\n // This check is also done in the processCredential method, but we do it here as well\n // to be certain we don't skip the check\n this.verifyReceivedCredentialMatchesRequest(w3cCredential, request)\n\n return true\n } catch (_error) {\n return false\n }\n }\n\n /**\n * Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.\n * It looks up the correct format identifier and encodes the data as a base64 attachment.\n *\n * @param data The data to include in the attach object\n * @param id the attach id from the formats component of the message\n */\n private getFormatData(data: unknown, id: string): DidCommAttachment {\n const attachment = new DidCommAttachment({\n id,\n mimeType: 'application/json',\n data: new DidCommAttachmentData({\n base64: JsonEncoder.toBase64(data),\n }),\n })\n\n return attachment\n }\n}\n"],"mappings":";;;;;;AA0CA,MAAM,mBAAmB;AACzB,MAAM,YAAY;AAElB,IAAa,uCAAb,MAEA;;OACkB,YAAY;OACZ,uBAAuB;OA4VhC,uBAAuB,UAA6B,aAAyC;GAClG,MAAM,OAAO,SAAS,eAAe;GACrC,MAAM,OAAO,SAAS,eAAe;AAErC,UAAO,MAAM,gBAAgB,MAAM,KAAK;;;;;;;;;;CAvV1C,MAAa,eACX,eACA,EAAE,qBACoD;EACtD,MAAM,SAAS,IAAI,4BAA4B,EAC7C,QAAQ,kBACT,CAAC;EAEF,MAAM,eAAe,kBAAkB;AACvC,MAAI,CAAC,aACH,OAAM,IAAI,WAAW,2CAA2C;AAIlE,kBAAgB,SAAS,aAAa,YAAY,8BAA8B;AAIhF,SAAO;GAAE;GAAQ,YADE,KAAK,cAAc,cAA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AI;AAGF,QAAK,uCAAuC,eAAe,QAAQ;AAEnE,UAAO;WACA,QAAQ;AACf,UAAO;;;;;;;;;;CAWX,AAAQ,cAAc,MAAe,IAA+B;AASlE,SARmB,IAAI,kBAAkB;GACvC;GACA,UAAU;GACV,MAAM,IAAI,sBAAsB,EAC9B,QAAQ,YAAY,SAAS,KAAK,EACnC,CAAC;GACH,CAAC"}
|
|
1
|
+
{"version":3,"file":"DidCommJsonLdCredentialFormatService.mjs","names":[],"sources":["../../../../../src/modules/credentials/formats/jsonld/DidCommJsonLdCredentialFormatService.ts"],"sourcesContent":["import type { AgentContext } from '@credo-ts/core'\nimport {\n ClaimFormat,\n CredoError,\n DidResolverService,\n JsonEncoder,\n JsonTransformer,\n SignatureSuiteRegistry,\n utils,\n W3cCredential,\n W3cCredentialRecord,\n W3cCredentialService,\n W3cJsonLdCredentialService,\n W3cJsonLdVerifiableCredential,\n} from '@credo-ts/core'\nimport { DidCommAttachment, DidCommAttachmentData } from '../../../../decorators/attachment/DidCommAttachment'\nimport { DidCommCredentialFormatSpec } from '../../models/DidCommCredentialFormatSpec'\nimport type { DidCommCredentialFormatService } from '../DidCommCredentialFormatService'\nimport type {\n DidCommCredentialFormatAcceptOfferOptions,\n DidCommCredentialFormatAcceptProposalOptions,\n DidCommCredentialFormatAcceptRequestOptions,\n DidCommCredentialFormatAutoRespondCredentialOptions,\n DidCommCredentialFormatAutoRespondOfferOptions,\n DidCommCredentialFormatAutoRespondProposalOptions,\n DidCommCredentialFormatAutoRespondRequestOptions,\n DidCommCredentialFormatCreateOfferOptions,\n DidCommCredentialFormatCreateOfferReturn,\n DidCommCredentialFormatCreateProposalOptions,\n DidCommCredentialFormatCreateProposalReturn,\n DidCommCredentialFormatCreateRequestOptions,\n DidCommCredentialFormatCreateReturn,\n DidCommCredentialFormatProcessCredentialOptions,\n DidCommCredentialFormatProcessOptions,\n} from '../DidCommCredentialFormatServiceOptions'\nimport { DidCommJsonLdCredentialDetail } from './DidCommJsonLdCredentialDetail'\nimport type {\n DidCommJsonLdCredentialFormat,\n JsonCredential,\n JsonLdFormatDataCredentialDetail,\n JsonLdFormatDataVerifiableCredential,\n} from './DidCommJsonLdCredentialFormat'\n\nconst JSONLD_VC_DETAIL = 'aries/ld-proof-vc-detail@v1.0'\nconst JSONLD_VC = 'aries/ld-proof-vc@v1.0'\n\nexport class DidCommJsonLdCredentialFormatService\n implements DidCommCredentialFormatService<DidCommJsonLdCredentialFormat>\n{\n public readonly formatKey = 'jsonld' as const\n public readonly credentialRecordType = 'w3c' as const\n\n /**\n * Create a {@link AttachmentFormats} object dependent on the message type.\n *\n * @param options The object containing all the options for the proposed credential\n * @returns object containing associated attachment, formats and filtersAttach elements\n *\n */\n public async createProposal(\n _agentContext: AgentContext,\n { credentialFormats }: DidCommCredentialFormatCreateProposalOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateProposalReturn> {\n const format = new DidCommCredentialFormatSpec({\n format: JSONLD_VC_DETAIL,\n })\n\n const jsonLdFormat = credentialFormats.jsonld\n if (!jsonLdFormat) {\n throw new CredoError('Missing jsonld payload in createProposal')\n }\n\n // this does the validation\n JsonTransformer.fromJSON(jsonLdFormat.credential, DidCommJsonLdCredentialDetail)\n\n // jsonLdFormat is now of type JsonLdFormatDataCredentialDetail\n const attachment = this.getFormatData(jsonLdFormat, format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Method called on reception of a propose credential message\n * @param options the options needed to accept the proposal\n */\n public async processProposal(\n _agentContext: AgentContext,\n { attachment }: DidCommCredentialFormatProcessOptions\n ): Promise<void> {\n const credProposalJson = attachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n if (!credProposalJson) {\n throw new CredoError('Missing jsonld credential proposal data payload')\n }\n\n // validation is done in here\n JsonTransformer.fromJSON(credProposalJson, DidCommJsonLdCredentialDetail)\n }\n\n public async acceptProposal(\n _agentContext: AgentContext,\n { attachmentId, proposalAttachment }: DidCommCredentialFormatAcceptProposalOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n // if the offer has an attachment Id use that, otherwise the generated id of the formats object\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC_DETAIL,\n })\n\n const credentialProposal = proposalAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n JsonTransformer.fromJSON(credentialProposal, DidCommJsonLdCredentialDetail)\n\n const offerData = credentialProposal\n\n const attachment = this.getFormatData(offerData, format.attachmentId)\n\n return { format, attachment }\n }\n\n /**\n * Create a {@link AttachmentFormats} object dependent on the message type.\n *\n * @param options The object containing all the options for the credential offer\n * @returns object containing associated attachment, formats and offersAttach elements\n *\n */\n public async createOffer(\n _agentContext: AgentContext,\n { credentialFormats, attachmentId }: DidCommCredentialFormatCreateOfferOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateOfferReturn> {\n // if the offer has an attachment Id use that, otherwise the generated id of the formats object\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC_DETAIL,\n })\n\n const jsonLdFormat = credentialFormats?.jsonld\n if (!jsonLdFormat) {\n throw new CredoError('Missing jsonld payload in createOffer')\n }\n\n // validate\n JsonTransformer.fromJSON(jsonLdFormat.credential, DidCommJsonLdCredentialDetail)\n\n const attachment = this.getFormatData(jsonLdFormat, format.attachmentId)\n\n return { format, attachment }\n }\n\n public async processOffer(_agentContext: AgentContext, { attachment }: DidCommCredentialFormatProcessOptions) {\n const credentialOfferJson = attachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n if (!credentialOfferJson) {\n throw new CredoError('Missing jsonld credential offer data payload')\n }\n\n JsonTransformer.fromJSON(credentialOfferJson, DidCommJsonLdCredentialDetail)\n }\n\n public async acceptOffer(\n _agentContext: AgentContext,\n { attachmentId, offerAttachment }: DidCommCredentialFormatAcceptOfferOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n const credentialOffer = offerAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n // validate\n JsonTransformer.fromJSON(credentialOffer, DidCommJsonLdCredentialDetail)\n\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC_DETAIL,\n })\n\n const attachment = this.getFormatData(credentialOffer, format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Create a credential attachment format for a credential request.\n *\n * @param options The object containing all the options for the credential request is derived\n * @returns object containing associated attachment, formats and requestAttach elements\n *\n */\n public async createRequest(\n _agentContext: AgentContext,\n { credentialFormats }: DidCommCredentialFormatCreateRequestOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n const jsonLdFormat = credentialFormats?.jsonld\n\n const format = new DidCommCredentialFormatSpec({\n format: JSONLD_VC_DETAIL,\n })\n\n if (!jsonLdFormat) {\n throw new CredoError('Missing jsonld payload in createRequest')\n }\n\n // this does the validation\n JsonTransformer.fromJSON(jsonLdFormat.credential, DidCommJsonLdCredentialDetail)\n\n const attachment = this.getFormatData(jsonLdFormat, format.attachmentId)\n\n return { format, attachment }\n }\n\n public async processRequest(\n _agentContext: AgentContext,\n { attachment }: DidCommCredentialFormatProcessOptions\n ): Promise<void> {\n const requestJson = attachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n if (!requestJson) {\n throw new CredoError('Missing jsonld credential request data payload')\n }\n\n // validate\n JsonTransformer.fromJSON(requestJson, DidCommJsonLdCredentialDetail)\n }\n\n public async acceptRequest(\n agentContext: AgentContext,\n {\n credentialFormats,\n attachmentId,\n requestAttachment,\n }: DidCommCredentialFormatAcceptRequestOptions<DidCommJsonLdCredentialFormat>\n ): Promise<DidCommCredentialFormatCreateReturn> {\n const w3cJsonLdCredentialService = agentContext.dependencyManager.resolve(W3cJsonLdCredentialService)\n\n // sign credential here. credential to be signed is received as the request attachment\n // (attachment in the request message from holder to issuer)\n const credentialRequest = requestAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n const verificationMethod =\n credentialFormats?.jsonld?.verificationMethod ??\n (await this.deriveVerificationMethod(agentContext, credentialRequest.credential, credentialRequest))\n\n if (!verificationMethod) {\n throw new CredoError('Missing verification method in credential data')\n }\n const format = new DidCommCredentialFormatSpec({\n attachmentId,\n format: JSONLD_VC,\n })\n\n const options = credentialRequest.options\n\n // Get a list of fields found in the options that are not supported at the moment\n const unsupportedFields = ['challenge', 'domain', 'credentialStatus', 'created'] as const\n const foundFields = unsupportedFields.filter((field) => options[field] !== undefined)\n\n if (foundFields.length > 0) {\n throw new CredoError(`Some fields are not currently supported in credential options: ${foundFields.join(', ')}`)\n }\n\n const credential = JsonTransformer.fromJSON(credentialRequest.credential, W3cCredential)\n\n const verifiableCredential = await w3cJsonLdCredentialService.signCredential(agentContext, {\n format: ClaimFormat.LdpVc,\n credential,\n proofType: credentialRequest.options.proofType,\n verificationMethod: verificationMethod,\n })\n\n const attachment = this.getFormatData(JsonTransformer.toJSON(verifiableCredential), format.attachmentId)\n return { format, attachment }\n }\n\n /**\n * Derive a verification method using the issuer from the given verifiable credential\n * @param credentialAsJson the verifiable credential we want to sign\n * @return the verification method derived from this credential and its associated issuer did, keys etc.\n */\n private async deriveVerificationMethod(\n agentContext: AgentContext,\n credentialAsJson: JsonCredential,\n credentialRequest: JsonLdFormatDataCredentialDetail\n ): Promise<string> {\n const didResolver = agentContext.dependencyManager.resolve(DidResolverService)\n const w3cJsonLdCredentialService = agentContext.dependencyManager.resolve(W3cJsonLdCredentialService)\n\n const credential = JsonTransformer.fromJSON(credentialAsJson, W3cCredential)\n\n // extract issuer from vc (can be string or Issuer)\n let issuerDid = credential.issuer\n\n if (typeof issuerDid !== 'string') {\n issuerDid = issuerDid.id\n }\n // this will throw an error if the issuer did is invalid\n const issuerDidDocument = await didResolver.resolveDidDocument(agentContext, issuerDid)\n\n // find first key which matches proof type\n const proofType = credentialRequest.options.proofType\n\n // actually gets the key type(s)\n const keyType = w3cJsonLdCredentialService.getVerificationMethodTypesByProofType(proofType)\n\n if (!keyType || keyType.length === 0) {\n throw new CredoError(`No Key Type found for proofType ${proofType}`)\n }\n\n const verificationMethod = issuerDidDocument.findVerificationMethodsByTypeAndPurpose(keyType, [\n 'assertionMethod',\n 'verificationMethod',\n ])[0]\n\n if (!verificationMethod) {\n throw new CredoError(`Missing verification method for key type ${keyType}`)\n }\n\n return verificationMethod.id\n }\n /**\n * Processes an incoming credential - retrieve metadata, retrieve payload and store it in the Indy wallet\n * @param options the issue credential message wrapped inside this object\n * @param credentialExchangeRecord the credential exchange record for this credential\n */\n public async processCredential(\n agentContext: AgentContext,\n { credentialExchangeRecord, attachment, requestAttachment }: DidCommCredentialFormatProcessCredentialOptions\n ): Promise<void> {\n const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService)\n\n const credentialAsJson = attachment.getDataAsJson()\n const credential = JsonTransformer.fromJSON(credentialAsJson, W3cJsonLdVerifiableCredential)\n const requestAsJson = requestAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n // Verify the credential request matches the credential\n this.verifyReceivedCredentialMatchesRequest(agentContext, credential, requestAsJson)\n\n // verify signatures of the credential\n const result = await w3cCredentialService.verifyCredential(agentContext, { credential })\n if (result && !result.isValid) {\n throw new CredoError(`Failed to validate credential, error = ${result.error}`)\n }\n\n const verifiableCredential = await w3cCredentialService.storeCredential(agentContext, {\n record: W3cCredentialRecord.fromCredential(credential),\n })\n\n credentialExchangeRecord.credentials.push({\n credentialRecordType: this.credentialRecordType,\n credentialRecordId: verifiableCredential.id,\n })\n }\n\n private verifyReceivedCredentialMatchesRequest(\n agentContext: AgentContext,\n credential: W3cJsonLdVerifiableCredential,\n request: JsonLdFormatDataCredentialDetail\n ): void {\n const jsonCredential = JsonTransformer.toJSON(credential)\n jsonCredential.proof = undefined\n\n if (Array.isArray(credential.proof)) {\n throw new CredoError('Credential proof arrays are not supported')\n }\n\n if (request.options.created && credential.proof.created !== request.options.created) {\n throw new CredoError('Received credential proof created does not match created from credential request')\n }\n\n if (credential.proof.domain !== request.options.domain) {\n throw new CredoError('Received credential proof domain does not match domain from credential request')\n }\n\n if (credential.proof.challenge !== request.options.challenge) {\n throw new CredoError('Received credential proof challenge does not match challenge from credential request')\n }\n\n if (credential.proof.type !== request.options.proofType) {\n throw new CredoError('Received credential proof type does not match proof type from credential request')\n }\n\n if (credential.proof.proofPurpose !== request.options.proofPurpose) {\n throw new CredoError('Received credential proof purpose does not match proof purpose from credential request')\n }\n\n // Check whether the received credential (minus the proof) matches the credential request. A\n // signature suite is required to add its own `@context` to the document it signs when the\n // document does not already carry a compatible one, so the issuer adding exactly that context\n // url is an expected difference rather than a mismatch.\n if (\n !utils.areObjectsEqual(jsonCredential, request.credential) &&\n !utils.areObjectsEqual(jsonCredential, this.withSuiteContext(agentContext, request))\n ) {\n throw new CredoError('Received credential does not match credential request')\n }\n\n // TODO: add check for the credentialStatus once this is supported in Credo\n }\n\n /**\n * Returns the requested credential with the `@context` of the agreed proof type's signature suite\n * appended, mirroring what the issuer's suite does when signing. Returns the requested credential\n * unchanged if the context is already present or the suite declares no context url.\n */\n private withSuiteContext(agentContext: AgentContext, request: JsonLdFormatDataCredentialDetail): JsonCredential {\n const signatureSuiteRegistry = agentContext.dependencyManager.resolve(SignatureSuiteRegistry)\n const suiteContextUrl = signatureSuiteRegistry.findContextUrlByProofType(request.options.proofType)\n\n const existingContext = request.credential['@context']\n if (!suiteContextUrl || !Array.isArray(existingContext) || existingContext.includes(suiteContextUrl)) {\n return request.credential\n }\n\n return { ...request.credential, '@context': [...existingContext, suiteContextUrl] }\n }\n\n public supportsFormat(format: string): boolean {\n const supportedFormats = [JSONLD_VC_DETAIL, JSONLD_VC]\n\n return supportedFormats.includes(format)\n }\n\n public async deleteCredentialById(agentContext: AgentContext, credentialRecordId: string): Promise<void> {\n const w3cCredentialService = agentContext.dependencyManager.resolve(W3cCredentialService)\n\n await w3cCredentialService.removeCredentialRecord(agentContext, credentialRecordId)\n }\n\n public areCredentialsEqual = (message1: DidCommAttachment, message2: DidCommAttachment): boolean => {\n const obj1 = message1.getDataAsJson()\n const obj2 = message2.getDataAsJson()\n\n return utils.areObjectsEqual(obj1, obj2)\n }\n\n public async shouldAutoRespondToProposal(\n _agentContext: AgentContext,\n { offerAttachment, proposalAttachment }: DidCommCredentialFormatAutoRespondProposalOptions\n ) {\n return this.areCredentialsEqual(proposalAttachment, offerAttachment)\n }\n\n public async shouldAutoRespondToOffer(\n _agentContext: AgentContext,\n { offerAttachment, proposalAttachment }: DidCommCredentialFormatAutoRespondOfferOptions\n ) {\n return this.areCredentialsEqual(proposalAttachment, offerAttachment)\n }\n\n public async shouldAutoRespondToRequest(\n _agentContext: AgentContext,\n { offerAttachment, requestAttachment }: DidCommCredentialFormatAutoRespondRequestOptions\n ) {\n return this.areCredentialsEqual(offerAttachment, requestAttachment)\n }\n\n public async shouldAutoRespondToCredential(\n agentContext: AgentContext,\n { requestAttachment, credentialAttachment }: DidCommCredentialFormatAutoRespondCredentialOptions\n ) {\n const credentialJson = credentialAttachment.getDataAsJson<JsonLdFormatDataVerifiableCredential>()\n const w3cCredential = JsonTransformer.fromJSON(credentialJson, W3cJsonLdVerifiableCredential)\n const request = requestAttachment.getDataAsJson<JsonLdFormatDataCredentialDetail>()\n\n try {\n // This check is also done in the processCredential method, but we do it here as well\n // to be certain we don't skip the check\n this.verifyReceivedCredentialMatchesRequest(agentContext, w3cCredential, request)\n\n return true\n } catch (_error) {\n return false\n }\n }\n\n /**\n * Returns an object of type {@link DidCommAttachment} for use in credential exchange messages.\n * It looks up the correct format identifier and encodes the data as a base64 attachment.\n *\n * @param data The data to include in the attach object\n * @param id the attach id from the formats component of the message\n */\n private getFormatData(data: unknown, id: string): DidCommAttachment {\n const attachment = new DidCommAttachment({\n id,\n mimeType: 'application/json',\n data: new DidCommAttachmentData({\n base64: JsonEncoder.toBase64(data),\n }),\n })\n\n return attachment\n }\n}\n"],"mappings":";;;;;;AA2CA,MAAM,mBAAmB;AACzB,MAAM,YAAY;A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6
6
|
},
|
|
7
|
-
"version": "0.7.
|
|
7
|
+
"version": "0.7.2-alpha-20260918180656",
|
|
8
8
|
"files": [
|
|
9
9
|
"build"
|
|
10
10
|
],
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"luxon": "^3.7.2",
|
|
25
25
|
"query-string": "^9.3.1",
|
|
26
26
|
"rxjs": "^7.8.2",
|
|
27
|
-
"@credo-ts/core": "0.7.
|
|
27
|
+
"@credo-ts/core": "0.7.2-alpha-20260918180656"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@animo-id/pex": "^6.1.1",
|