Skip to content

Commit

Permalink
feat: allow instance opts to be set when OID4VCI is running but only …
Browse files Browse the repository at this point in the history
…when having access to the object directly
  • Loading branch information
nklomp committed Jun 24, 2023
1 parent 7142273 commit 51f873e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/oid4vci-issuer-rest-api/__tests__/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { IonPublicKeyPurpose } from '@decentralized-identity/ion-sdk'
import { getUniResolver } from '@sphereon/did-uni-client'
import { CredentialIssuerMetadata } from '@sphereon/oid4vci-common'
import { JwkDIDProvider } from '@sphereon/ssi-sdk-ext.did-provider-jwk'
import {SphereonKeyManager} from "@sphereon/ssi-sdk-ext.key-manager";
import { SphereonKeyManager } from '@sphereon/ssi-sdk-ext.key-manager'
import { /*generatePrivateKeyHex, */ toJwk } from '@sphereon/ssi-sdk-ext.key-utils'
import {SphereonKeyManagementSystem} from "@sphereon/ssi-sdk-ext.kms-local";
import { SphereonKeyManagementSystem } from '@sphereon/ssi-sdk-ext.kms-local'
import { OID4VCIIssuer } from '@sphereon/ssi-sdk.oid4vci-issuer'
import { OID4VCIStore } from '@sphereon/ssi-sdk.oid4vci-issuer-store'
import {
Expand Down
5 changes: 5 additions & 0 deletions packages/oid4vci-issuer-store/src/agent/OID4VCIStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IAgentPlugin } from '@veramo/core'
import {
IIssuerDefaultOpts,
IIssuerOptions,
IIssuerOptsImportArgs,
IIssuerOptsPersistArgs,
IMetadataPersistArgs,
Ioid4vciStoreClearArgs,
Expand Down Expand Up @@ -110,6 +111,10 @@ export class OID4VCIStore implements IAgentPlugin {
)
}

public importIssuerOpts(importOpts: IIssuerOptsImportArgs[]) {
importOpts.forEach((opt) => this.oid4vciStorePersistIssuerOpts(opt))
}

private async oid4vciStoreHasIssuerOpts({ correlationId, storeId, namespace }: Ioid4vciStoreExistsArgs): Promise<boolean> {
return this.store({ stores: this._optionStores, storeId }).has(this.prefix({ namespace, correlationId }))
}
Expand Down

0 comments on commit 51f873e

Please sign in to comment.