Skip to content

Commit

Permalink
chore: delete json ld credentials
Browse files Browse the repository at this point in the history
Signed-off-by: ryankoch13 <[email protected]>
  • Loading branch information
ryankoch13 committed Jul 23, 2024
1 parent f7e8812 commit 230cf67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
6 changes: 6 additions & 0 deletions packages/core/src/modules/credentials/CredentialsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,12 @@ export class CredentialsApi<CPs extends CredentialProtocol[]> implements Credent
return protocol.delete(this.agentContext, credentialRecord, options)
}

async deleteByIdLd(credentialId: string, options?: DeleteCredentialOptions) {
const credentialRecord = await this.getById(credentialId)
const protocol = await this.getServiceForCredentialExchangeId(credentialId)
return protocol.delete(this.agentContext, credentialRecord, options)
}

/**
* Update a credential exchange record
*
Expand Down
15 changes: 0 additions & 15 deletions packages/core/src/modules/oob/OutOfBandApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,21 +426,6 @@ export class OutOfBandApi {
throw new CredoError('One or both of handshake_protocols and requests~attach MUST be included in the message.')
}

// Make sure we haven't received this invitation before
// It's fine if we created it (means that we are connecting to ourselves) or if it's an implicit
// invitation (it allows to connect multiple times to the same public did)
if (!config.isImplicit) {
const existingOobRecordsFromThisId = await this.outOfBandService.findAllByQuery(this.agentContext, {
invitationId: outOfBandInvitation.id,
role: OutOfBandRole.Receiver,
})
if (existingOobRecordsFromThisId.length > 0) {
throw new CredoError(
`An out of band record with invitation ${outOfBandInvitation.id} has already been received. Invitations should have a unique id.`
)
}
}

const recipientKeyFingerprints = await this.resolveInvitationRecipientKeyFingerprints(outOfBandInvitation)
const outOfBandRecord = new OutOfBandRecord({
role: OutOfBandRole.Receiver,
Expand Down

0 comments on commit 230cf67

Please sign in to comment.