Skip to content

Commit 230cf67

Browse files
committed
chore: delete json ld credentials
Signed-off-by: ryankoch13 <[email protected]>
1 parent f7e8812 commit 230cf67

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

packages/core/src/modules/credentials/CredentialsApi.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,12 @@ export class CredentialsApi<CPs extends CredentialProtocol[]> implements Credent
661661
return protocol.delete(this.agentContext, credentialRecord, options)
662662
}
663663

664+
async deleteByIdLd(credentialId: string, options?: DeleteCredentialOptions) {
665+
const credentialRecord = await this.getById(credentialId)
666+
const protocol = await this.getServiceForCredentialExchangeId(credentialId)
667+
return protocol.delete(this.agentContext, credentialRecord, options)
668+
}
669+
664670
/**
665671
* Update a credential exchange record
666672
*

packages/core/src/modules/oob/OutOfBandApi.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -426,21 +426,6 @@ export class OutOfBandApi {
426426
throw new CredoError('One or both of handshake_protocols and requests~attach MUST be included in the message.')
427427
}
428428

429-
// Make sure we haven't received this invitation before
430-
// It's fine if we created it (means that we are connecting to ourselves) or if it's an implicit
431-
// invitation (it allows to connect multiple times to the same public did)
432-
if (!config.isImplicit) {
433-
const existingOobRecordsFromThisId = await this.outOfBandService.findAllByQuery(this.agentContext, {
434-
invitationId: outOfBandInvitation.id,
435-
role: OutOfBandRole.Receiver,
436-
})
437-
if (existingOobRecordsFromThisId.length > 0) {
438-
throw new CredoError(
439-
`An out of band record with invitation ${outOfBandInvitation.id} has already been received. Invitations should have a unique id.`
440-
)
441-
}
442-
}
443-
444429
const recipientKeyFingerprints = await this.resolveInvitationRecipientKeyFingerprints(outOfBandInvitation)
445430
const outOfBandRecord = new OutOfBandRecord({
446431
role: OutOfBandRole.Receiver,

0 commit comments

Comments
 (0)