@sphereon/ssi-sdk.oid4vci-holder 0.36.1-feature.fides.fixes.111 → 0.36.1-feature.fides.fixes.119
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/dist/index.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/package.json +20 -20
- package/src/agent/OID4VCIHolder.ts +4 -1
- package/src/services/OID4VCIHolderService.ts +7 -1
- package/src/types/IOID4VCIHolder.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.oid4vci-holder",
|
|
3
|
-
"version": "0.36.1-feature.fides.fixes.
|
|
3
|
+
"version": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -30,23 +30,23 @@
|
|
|
30
30
|
"@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
|
|
31
31
|
"@sphereon/oid4vci-client": "0.20.1-next.8",
|
|
32
32
|
"@sphereon/oid4vci-common": "0.20.1-next.8",
|
|
33
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.36.1-feature.fides.fixes.
|
|
34
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.36.1-feature.fides.fixes.
|
|
35
|
-
"@sphereon/ssi-sdk-ext.jwt-service": "0.36.1-feature.fides.fixes.
|
|
36
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.36.1-feature.fides.fixes.
|
|
37
|
-
"@sphereon/ssi-sdk.contact-manager": "0.36.1-feature.fides.fixes.
|
|
38
|
-
"@sphereon/ssi-sdk.core": "0.36.1-feature.fides.fixes.
|
|
39
|
-
"@sphereon/ssi-sdk.credential-store": "0.36.1-feature.fides.fixes.
|
|
40
|
-
"@sphereon/ssi-sdk.credential-validation": "0.36.1-feature.fides.fixes.
|
|
41
|
-
"@sphereon/ssi-sdk.data-store-types": "0.36.1-feature.fides.fixes.
|
|
42
|
-
"@sphereon/ssi-sdk.issuance-branding": "0.36.1-feature.fides.fixes.
|
|
43
|
-
"@sphereon/ssi-sdk.mdl-mdoc": "0.36.1-feature.fides.fixes.
|
|
44
|
-
"@sphereon/ssi-sdk.oidf-client": "0.36.1-feature.fides.fixes.
|
|
45
|
-
"@sphereon/ssi-sdk.sd-jwt": "0.36.1-feature.fides.fixes.
|
|
46
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.36.1-feature.fides.fixes.
|
|
47
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.36.1-feature.fides.fixes.
|
|
48
|
-
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.36.1-feature.fides.fixes.
|
|
49
|
-
"@sphereon/ssi-types": "0.36.1-feature.fides.fixes.
|
|
33
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
34
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
35
|
+
"@sphereon/ssi-sdk-ext.jwt-service": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
36
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
37
|
+
"@sphereon/ssi-sdk.contact-manager": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
38
|
+
"@sphereon/ssi-sdk.core": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
39
|
+
"@sphereon/ssi-sdk.credential-store": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
40
|
+
"@sphereon/ssi-sdk.credential-validation": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
41
|
+
"@sphereon/ssi-sdk.data-store-types": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
42
|
+
"@sphereon/ssi-sdk.issuance-branding": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
43
|
+
"@sphereon/ssi-sdk.mdl-mdoc": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
44
|
+
"@sphereon/ssi-sdk.oidf-client": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
45
|
+
"@sphereon/ssi-sdk.sd-jwt": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
46
|
+
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
47
|
+
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
48
|
+
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
49
|
+
"@sphereon/ssi-types": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
50
50
|
"@veramo/core": "4.2.0",
|
|
51
51
|
"@veramo/data-store": "4.2.0",
|
|
52
52
|
"@veramo/utils": "4.2.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@sphereon/oid4vc-common": "0.20.1-feat.SSISDK.83.1",
|
|
63
|
-
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.36.1-feature.fides.fixes.
|
|
63
|
+
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.36.1-feature.fides.fixes.119+f6c5cf4a",
|
|
64
64
|
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "workspace:*",
|
|
65
65
|
"@types/i18n-js": "^3.8.9",
|
|
66
66
|
"@types/lodash.memoize": "^4.1.9",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"OID4VCI",
|
|
91
91
|
"State Machine"
|
|
92
92
|
],
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "f6c5cf4a7506f73d77e9db4f868fbcc243ac7702"
|
|
94
94
|
}
|
|
@@ -207,6 +207,7 @@ export async function verifyEBSICredentialIssuer(args: VerifyEBSICredentialIssue
|
|
|
207
207
|
|
|
208
208
|
export class OID4VCIHolder implements IAgentPlugin {
|
|
209
209
|
private readonly hasher?: HasherSync
|
|
210
|
+
private readonly defaultHolderIdentifier?: string
|
|
210
211
|
readonly eventTypes: Array<OID4VCIHolderEvent> = [
|
|
211
212
|
OID4VCIHolderEvent.CONTACT_IDENTITY_CREATED,
|
|
212
213
|
OID4VCIHolderEvent.CREDENTIAL_STORED,
|
|
@@ -270,9 +271,11 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
270
271
|
jwtCryptographicSuitePreferences,
|
|
271
272
|
defaultAuthorizationRequestOptions,
|
|
272
273
|
hasher = defaultHasher,
|
|
274
|
+
defaultHolderIdentifier,
|
|
273
275
|
} = { ...options }
|
|
274
276
|
|
|
275
277
|
this.hasher = hasher
|
|
278
|
+
this.defaultHolderIdentifier = defaultHolderIdentifier
|
|
276
279
|
if (vcFormatPreferences !== undefined && vcFormatPreferences.length > 0) {
|
|
277
280
|
this.vcFormatPreferences = vcFormatPreferences
|
|
278
281
|
}
|
|
@@ -679,7 +682,7 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
679
682
|
return Promise.reject(Error(`Cannot get credential issuance options`))
|
|
680
683
|
}
|
|
681
684
|
|
|
682
|
-
const identifier = await getIdentifierOpts({ issuanceOpt, context })
|
|
685
|
+
const identifier = await getIdentifierOpts({ issuanceOpt, context, defaultHolderIdentifier: this.defaultHolderIdentifier })
|
|
683
686
|
issuanceOpt.identifier = identifier
|
|
684
687
|
logger.info(`ID opts`, identifier)
|
|
685
688
|
const alg: JoseSignatureAlgorithm | JoseSignatureAlgorithmString = await signatureAlgorithmFromKey({ key: identifier.key })
|
|
@@ -263,7 +263,7 @@ export const extractCredentialFromResponse = (credentialResponse: CredentialResp
|
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
export const getIdentifierOpts = async (args: GetIdentifierArgs): Promise<ManagedIdentifierResult> => {
|
|
266
|
-
const { issuanceOpt, context } = args
|
|
266
|
+
const { issuanceOpt, context, defaultHolderIdentifier } = args
|
|
267
267
|
const { identifier: identifierArg } = issuanceOpt
|
|
268
268
|
if (identifierArg && isManagedIdentifierResult(identifierArg)) {
|
|
269
269
|
return identifierArg
|
|
@@ -295,6 +295,11 @@ export const getIdentifierOpts = async (args: GetIdentifierArgs): Promise<Manage
|
|
|
295
295
|
(!supportedBindingMethods || supportedBindingMethods.length === 0 || supportedBindingMethods.filter((method) => method.startsWith('did')))
|
|
296
296
|
) {
|
|
297
297
|
// previous code for managing DIDs only
|
|
298
|
+
const identifierFilter = defaultHolderIdentifier
|
|
299
|
+
? defaultHolderIdentifier.startsWith('did:')
|
|
300
|
+
? { did: defaultHolderIdentifier }
|
|
301
|
+
: { alias: defaultHolderIdentifier }
|
|
302
|
+
: {}
|
|
298
303
|
const { result, created } = await getOrCreatePrimaryIdentifier(agentContext, {
|
|
299
304
|
method: supportedPreferredDidMethod,
|
|
300
305
|
createOpts: {
|
|
@@ -303,6 +308,7 @@ export const getIdentifierOpts = async (args: GetIdentifierArgs): Promise<Manage
|
|
|
303
308
|
use: KeyUse.Signature,
|
|
304
309
|
codecName: issuanceOpt.codecName,
|
|
305
310
|
kms: issuanceOpt.kms,
|
|
311
|
+
...identifierFilter,
|
|
306
312
|
},
|
|
307
313
|
},
|
|
308
314
|
})
|
|
@@ -113,6 +113,7 @@ export type OID4VCIHolderOptions = {
|
|
|
113
113
|
didMethodPreferences?: Array<SupportedDidMethodEnum>
|
|
114
114
|
jwtCryptographicSuitePreferences?: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString>
|
|
115
115
|
hasher?: HasherSync
|
|
116
|
+
defaultHolderIdentifier?: string
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
export type OnContactIdentityCreatedArgs = {
|
|
@@ -571,6 +572,7 @@ export type DefaultIssuanceOpts = {
|
|
|
571
572
|
export type GetIdentifierArgs = {
|
|
572
573
|
issuanceOpt: IssuanceOpts
|
|
573
574
|
context: RequiredContext
|
|
575
|
+
defaultHolderIdentifier?: string
|
|
574
576
|
}
|
|
575
577
|
|
|
576
578
|
export type GetAuthenticationKeyArgs = {
|