@sphereon/ssi-sdk.oid4vci-holder 0.34.1-fix.182 → 0.34.1-fix.223
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 +14 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +17 -10
- package/src/services/OID4VCIHolderService.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.oid4vci-holder",
|
|
3
|
-
"version": "0.34.1-fix.
|
|
3
|
+
"version": "0.34.1-fix.223+9c86d039",
|
|
4
4
|
"source": "src/index.ts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
"build": "tsup --config ../../tsup.config.ts --tsconfig ../../tsconfig.tsup.json"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@sphereon/did-auth-siop": "0.19.1-feature.DIIPv4.
|
|
29
|
+
"@sphereon/did-auth-siop": "0.19.1-feature.DIIPv4.170",
|
|
30
30
|
"@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
|
|
31
|
-
"@sphereon/oid4vci-client": "0.19.1-feature.DIIPv4.
|
|
32
|
-
"@sphereon/oid4vci-common": "0.19.1-feature.DIIPv4.
|
|
33
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-fix.
|
|
34
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-fix.
|
|
35
|
-
"@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-fix.
|
|
36
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-fix.
|
|
37
|
-
"@sphereon/ssi-sdk.contact-manager": "0.34.1-fix.
|
|
38
|
-
"@sphereon/ssi-sdk.core": "0.34.1-fix.
|
|
39
|
-
"@sphereon/ssi-sdk.credential-store": "0.34.1-fix.
|
|
40
|
-
"@sphereon/ssi-sdk.credential-validation": "0.34.1-fix.
|
|
41
|
-
"@sphereon/ssi-sdk.data-store": "0.34.1-fix.
|
|
42
|
-
"@sphereon/ssi-sdk.issuance-branding": "0.34.1-fix.
|
|
43
|
-
"@sphereon/ssi-sdk.mdl-mdoc": "0.34.1-fix.
|
|
44
|
-
"@sphereon/ssi-sdk.oidf-client": "0.34.1-fix.
|
|
45
|
-
"@sphereon/ssi-sdk.sd-jwt": "0.34.1-fix.
|
|
46
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.34.1-fix.
|
|
47
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-fix.
|
|
48
|
-
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.34.1-fix.
|
|
49
|
-
"@sphereon/ssi-types": "0.34.1-fix.
|
|
31
|
+
"@sphereon/oid4vci-client": "0.19.1-feature.DIIPv4.170",
|
|
32
|
+
"@sphereon/oid4vci-common": "0.19.1-feature.DIIPv4.170",
|
|
33
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-fix.223+9c86d039",
|
|
34
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-fix.223+9c86d039",
|
|
35
|
+
"@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-fix.223+9c86d039",
|
|
36
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-fix.223+9c86d039",
|
|
37
|
+
"@sphereon/ssi-sdk.contact-manager": "0.34.1-fix.223+9c86d039",
|
|
38
|
+
"@sphereon/ssi-sdk.core": "0.34.1-fix.223+9c86d039",
|
|
39
|
+
"@sphereon/ssi-sdk.credential-store": "0.34.1-fix.223+9c86d039",
|
|
40
|
+
"@sphereon/ssi-sdk.credential-validation": "0.34.1-fix.223+9c86d039",
|
|
41
|
+
"@sphereon/ssi-sdk.data-store": "0.34.1-fix.223+9c86d039",
|
|
42
|
+
"@sphereon/ssi-sdk.issuance-branding": "0.34.1-fix.223+9c86d039",
|
|
43
|
+
"@sphereon/ssi-sdk.mdl-mdoc": "0.34.1-fix.223+9c86d039",
|
|
44
|
+
"@sphereon/ssi-sdk.oidf-client": "0.34.1-fix.223+9c86d039",
|
|
45
|
+
"@sphereon/ssi-sdk.sd-jwt": "0.34.1-fix.223+9c86d039",
|
|
46
|
+
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.34.1-fix.223+9c86d039",
|
|
47
|
+
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-fix.223+9c86d039",
|
|
48
|
+
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.34.1-fix.223+9c86d039",
|
|
49
|
+
"@sphereon/ssi-types": "0.34.1-fix.223+9c86d039",
|
|
50
50
|
"@veramo/core": "4.2.0",
|
|
51
51
|
"@veramo/data-store": "4.2.0",
|
|
52
52
|
"@veramo/utils": "4.2.0",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"xstate": "^4.38.3"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@sphereon/oid4vc-common": "0.19.1-feature.DIIPv4.
|
|
63
|
-
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.34.1-fix.
|
|
62
|
+
"@sphereon/oid4vc-common": "0.19.1-feature.DIIPv4.170",
|
|
63
|
+
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.34.1-fix.223+9c86d039",
|
|
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": "9c86d03951f1267495e456d1fbfd9eb380f27e78"
|
|
94
94
|
}
|
|
@@ -4,11 +4,14 @@ import {
|
|
|
4
4
|
AuthorizationRequestOpts,
|
|
5
5
|
AuthorizationServerClientOpts,
|
|
6
6
|
AuthorizationServerOpts,
|
|
7
|
+
CredentialConfigurationSupported,
|
|
7
8
|
CredentialConfigurationSupportedJwtVcJsonLdAndLdpVcV1_0_15,
|
|
8
9
|
CredentialDefinitionJwtVcJsonLdAndLdpVcV1_0_15,
|
|
9
10
|
CredentialOfferRequestWithBaseUrl,
|
|
10
11
|
DefaultURISchemes,
|
|
11
12
|
EndpointMetadataResult,
|
|
13
|
+
getTypesFromAuthorizationDetails,
|
|
14
|
+
getTypesFromCredentialSupported,
|
|
12
15
|
getTypesFromObject,
|
|
13
16
|
Jwt,
|
|
14
17
|
NotificationRequest,
|
|
@@ -46,7 +49,6 @@ import {
|
|
|
46
49
|
import {
|
|
47
50
|
CredentialMapper,
|
|
48
51
|
type CredentialProofFormat,
|
|
49
|
-
CredentialRole,
|
|
50
52
|
HasherSync,
|
|
51
53
|
IVerifiableCredential,
|
|
52
54
|
JoseSignatureAlgorithm,
|
|
@@ -56,6 +58,7 @@ import {
|
|
|
56
58
|
parseDid,
|
|
57
59
|
SdJwtDecodedVerifiableCredentialPayload,
|
|
58
60
|
WrappedW3CVerifiableCredential,
|
|
61
|
+
CredentialRole,
|
|
59
62
|
} from '@sphereon/ssi-types'
|
|
60
63
|
import {
|
|
61
64
|
CredentialPayload,
|
|
@@ -398,6 +401,7 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
398
401
|
formats = Array.from(new Set(authFormats))
|
|
399
402
|
}
|
|
400
403
|
let oid4vciClient: OpenID4VCIClient
|
|
404
|
+
let types: string[][] | undefined = undefined
|
|
401
405
|
let offer: CredentialOfferRequestWithBaseUrl | undefined
|
|
402
406
|
if (requestData.existingClientState) {
|
|
403
407
|
oid4vciClient = await OpenID4VCIClient.fromState({ state: requestData.existingClientState })
|
|
@@ -439,23 +443,26 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
439
443
|
}
|
|
440
444
|
}
|
|
441
445
|
|
|
442
|
-
let configurationIds: Array<string> = []
|
|
443
446
|
if (offer) {
|
|
444
|
-
|
|
447
|
+
const credentialsSupported: CredentialConfigurationSupported[] = offer.original_credential_offer.credential_configuration_ids.flatMap(
|
|
448
|
+
(configId) => {
|
|
449
|
+
const config = oid4vciClient.endpointMetadata.credentialIssuerMetadata?.credential_configurations_supported[configId]
|
|
450
|
+
return config ? [config as CredentialConfigurationSupported] : []
|
|
451
|
+
},
|
|
452
|
+
)
|
|
453
|
+
types = credentialsSupported.map((credentialSupported) => getTypesFromCredentialSupported(credentialSupported))
|
|
445
454
|
} else {
|
|
446
|
-
|
|
447
|
-
.
|
|
448
|
-
.
|
|
449
|
-
.filter((id): id is string => !!id)
|
|
455
|
+
types = asArray(authorizationRequestOpts.authorizationDetails)
|
|
456
|
+
.map((authReqOpts) => getTypesFromAuthorizationDetails(authReqOpts) ?? [])
|
|
457
|
+
.filter((inner) => inner.length > 0)
|
|
450
458
|
}
|
|
451
459
|
|
|
460
|
+
const serverMetadata = await oid4vciClient.retrieveServerMetadata()
|
|
452
461
|
const credentialsSupported = await getCredentialConfigsSupportedMerged({
|
|
453
462
|
client: oid4vciClient,
|
|
454
463
|
vcFormatPreferences: formats,
|
|
455
|
-
|
|
464
|
+
types,
|
|
456
465
|
})
|
|
457
|
-
|
|
458
|
-
const serverMetadata = await oid4vciClient.retrieveServerMetadata()
|
|
459
466
|
const credentialBranding = await getCredentialBranding({ credentialsSupported, context })
|
|
460
467
|
const authorizationCodeURL = oid4vciClient.authorizationURL
|
|
461
468
|
if (authorizationCodeURL) {
|
|
@@ -384,6 +384,9 @@ export const getCredentialConfigsSupportedBySingleTypeOrId = async (
|
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
if (configurationId) {
|
|
387
|
+
if (!format) {
|
|
388
|
+
return Promise.reject(Error('format parameter missing from input'))
|
|
389
|
+
}
|
|
387
390
|
const allSupported = client.getCredentialsSupported(format)
|
|
388
391
|
return Object.fromEntries(
|
|
389
392
|
Object.entries(allSupported).filter(
|