@sphereon/ssi-sdk.oid4vci-holder 0.34.1-feature.SSISDK.17.bitstring.sl.9 → 0.34.1-feature.SSISDK.26.48
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 +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/OID4VCIHolder.ts +26 -7
- package/src/services/OID4VCIHolderService.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sphereon/ssi-sdk.oid4vci-holder",
|
|
3
|
-
"version": "0.34.1-feature.SSISDK.
|
|
3
|
+
"version": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
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.
|
|
29
|
+
"@sphereon/did-auth-siop": "0.19.1-feature.SSISDK.26.23",
|
|
30
30
|
"@sphereon/kmp-mdoc-core": "0.2.0-SNAPSHOT.26",
|
|
31
|
-
"@sphereon/oid4vci-client": "0.19.
|
|
32
|
-
"@sphereon/oid4vci-common": "0.19.
|
|
33
|
-
"@sphereon/ssi-sdk-ext.did-utils": "0.
|
|
34
|
-
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.
|
|
35
|
-
"@sphereon/ssi-sdk-ext.jwt-service": "0.
|
|
36
|
-
"@sphereon/ssi-sdk-ext.key-utils": "0.
|
|
37
|
-
"@sphereon/ssi-sdk.contact-manager": "0.34.1-feature.SSISDK.
|
|
38
|
-
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.
|
|
39
|
-
"@sphereon/ssi-sdk.credential-store": "0.34.1-feature.SSISDK.
|
|
40
|
-
"@sphereon/ssi-sdk.credential-validation": "0.34.1-feature.SSISDK.
|
|
41
|
-
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.
|
|
42
|
-
"@sphereon/ssi-sdk.issuance-branding": "0.34.1-feature.SSISDK.
|
|
43
|
-
"@sphereon/ssi-sdk.mdl-mdoc": "0.34.1-feature.SSISDK.
|
|
44
|
-
"@sphereon/ssi-sdk.oidf-client": "0.34.1-feature.SSISDK.
|
|
45
|
-
"@sphereon/ssi-sdk.sd-jwt": "0.34.1-feature.SSISDK.
|
|
46
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.34.1-feature.SSISDK.
|
|
47
|
-
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-feature.SSISDK.
|
|
48
|
-
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.34.1-feature.SSISDK.
|
|
49
|
-
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.
|
|
31
|
+
"@sphereon/oid4vci-client": "0.19.1-feature.SSISDK.26.23",
|
|
32
|
+
"@sphereon/oid4vci-common": "0.19.1-feature.SSISDK.26.23",
|
|
33
|
+
"@sphereon/ssi-sdk-ext.did-utils": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
34
|
+
"@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
35
|
+
"@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
36
|
+
"@sphereon/ssi-sdk-ext.key-utils": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
37
|
+
"@sphereon/ssi-sdk.contact-manager": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
38
|
+
"@sphereon/ssi-sdk.core": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
39
|
+
"@sphereon/ssi-sdk.credential-store": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
40
|
+
"@sphereon/ssi-sdk.credential-validation": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
41
|
+
"@sphereon/ssi-sdk.data-store": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
42
|
+
"@sphereon/ssi-sdk.issuance-branding": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
43
|
+
"@sphereon/ssi-sdk.mdl-mdoc": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
44
|
+
"@sphereon/ssi-sdk.oidf-client": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
45
|
+
"@sphereon/ssi-sdk.sd-jwt": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
46
|
+
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
47
|
+
"@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
48
|
+
"@sphereon/ssi-sdk.xstate-machine-persistence": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
49
|
+
"@sphereon/ssi-types": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
50
50
|
"@veramo/core": "4.2.0",
|
|
51
51
|
"@veramo/data-store": "4.2.0",
|
|
52
52
|
"@veramo/utils": "4.2.0",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"xstate": "^4.38.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@sphereon/oid4vc-common": "0.19.
|
|
62
|
-
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.
|
|
61
|
+
"@sphereon/oid4vc-common": "0.19.1-feature.SSISDK.26.23",
|
|
62
|
+
"@sphereon/ssi-sdk-ext.did-resolver-jwk": "0.34.1-feature.SSISDK.26.48+3a1355b4",
|
|
63
63
|
"@sphereon/ssi-sdk.siopv2-oid4vp-common": "workspace:*",
|
|
64
64
|
"@types/i18n-js": "^3.8.9",
|
|
65
65
|
"@types/lodash.memoize": "^4.1.9",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"OID4VCI",
|
|
90
90
|
"State Machine"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "3a1355b4d72e107aaff8562dfe0fdf4296323589"
|
|
93
93
|
}
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
AuthorizationRequestOpts,
|
|
5
5
|
AuthorizationServerClientOpts,
|
|
6
6
|
AuthorizationServerOpts,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
CredentialConfigurationSupportedJwtVcJsonLdAndLdpVcV1_0_15,
|
|
8
|
+
CredentialDefinitionJwtVcJsonLdAndLdpVcV1_0_15,
|
|
9
9
|
CredentialOfferRequestWithBaseUrl,
|
|
10
10
|
DefaultURISchemes,
|
|
11
11
|
EndpointMetadataResult,
|
|
@@ -229,7 +229,7 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
229
229
|
oid4vciHolderStoreIssuerBranding: this.oid4vciHolderStoreIssuerBranding.bind(this),
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
private readonly vcFormatPreferences: Array<string> = ['
|
|
232
|
+
private readonly vcFormatPreferences: Array<string> = ['dc+sd-jwt', 'mso_mdoc', 'jwt_vc_json', 'jwt_vc', 'ldp_vc']
|
|
233
233
|
private readonly jsonldCryptographicSuitePreferences: Array<string> = [
|
|
234
234
|
'Ed25519Signature2018',
|
|
235
235
|
'EcdsaSecp256k1Signature2019',
|
|
@@ -849,11 +849,30 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
849
849
|
|
|
850
850
|
let counter = 0
|
|
851
851
|
for (const credentialId of selectedCredentials) {
|
|
852
|
-
|
|
852
|
+
// The selectedCredential from context is the configurationId, whilst we store the branding by type. We need to map
|
|
853
|
+
const configId = credentialId
|
|
854
|
+
const types =
|
|
855
|
+
credentialsToAccept
|
|
856
|
+
.find((ac) => ac.correlationId === configId || ac.credentialToAccept.id === configId || ac.types.includes(configId))
|
|
857
|
+
?.types?.filter((type) => type != 'VerifiableCredential') ?? []
|
|
858
|
+
|
|
859
|
+
const localeBranding: Array<IBasicCredentialLocaleBranding> = credentialBranding?.[configId] ?? []
|
|
860
|
+
if (localeBranding.length === 0) {
|
|
861
|
+
for (const type of types) {
|
|
862
|
+
const branding = credentialBranding?.[type] ?? []
|
|
863
|
+
if (branding.length > 0) {
|
|
864
|
+
localeBranding.push(...branding)
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
|
|
853
869
|
if (localeBranding && localeBranding.length > 0) {
|
|
854
870
|
const credential = credentialsToAccept.find(
|
|
855
871
|
(credAccept) =>
|
|
856
|
-
credAccept.credentialToAccept.id === credentialId ||
|
|
872
|
+
credAccept.credentialToAccept.id === credentialId ||
|
|
873
|
+
JSON.stringify(credAccept.types) === credentialId ||
|
|
874
|
+
JSON.stringify(credAccept.types.filter((cred) => cred !== 'VerifiableCredential')) === JSON.stringify(types) ||
|
|
875
|
+
credentialsToAccept[counter],
|
|
857
876
|
)!
|
|
858
877
|
counter++
|
|
859
878
|
await context.agent.ibAddCredentialBranding({
|
|
@@ -1150,9 +1169,9 @@ export class OID4VCIHolder implements IAgentPlugin {
|
|
|
1150
1169
|
return undefined
|
|
1151
1170
|
}
|
|
1152
1171
|
|
|
1153
|
-
private getCredentialDefinition(issuanceOpt: IssuanceOpts):
|
|
1172
|
+
private getCredentialDefinition(issuanceOpt: IssuanceOpts): CredentialDefinitionJwtVcJsonLdAndLdpVcV1_0_15 | undefined {
|
|
1154
1173
|
if (issuanceOpt.format == 'ldp_vc' || issuanceOpt.format == 'jwt_vc_json-ld') {
|
|
1155
|
-
return (issuanceOpt as
|
|
1174
|
+
return (issuanceOpt as CredentialConfigurationSupportedJwtVcJsonLdAndLdpVcV1_0_15).credential_definition
|
|
1156
1175
|
}
|
|
1157
1176
|
return undefined
|
|
1158
1177
|
}
|
|
@@ -2,7 +2,7 @@ import { LOG } from '@sphereon/oid4vci-client'
|
|
|
2
2
|
import {
|
|
3
3
|
CredentialConfigurationSupported,
|
|
4
4
|
CredentialSupportedSdJwtVc,
|
|
5
|
-
|
|
5
|
+
CredentialConfigurationSupportedSdJwtVcV1_0_15,
|
|
6
6
|
CredentialOfferFormatV1_0_11,
|
|
7
7
|
CredentialResponse,
|
|
8
8
|
getSupportedCredentials,
|
|
@@ -72,8 +72,8 @@ export const getCredentialBranding = async (args: GetCredentialBrandingArgs): Pr
|
|
|
72
72
|
await Promise.all(
|
|
73
73
|
Object.entries(credentialsSupported).map(async ([configId, credentialsConfigSupported]): Promise<void> => {
|
|
74
74
|
let sdJwtTypeMetadata: SdJwtTypeMetadata | undefined
|
|
75
|
-
if (credentialsConfigSupported.format === '
|
|
76
|
-
const vct = (<CredentialSupportedSdJwtVc |
|
|
75
|
+
if (credentialsConfigSupported.format === 'dc+sd-jwt') {
|
|
76
|
+
const vct = (<CredentialSupportedSdJwtVc | CredentialConfigurationSupportedSdJwtVcV1_0_15>credentialsConfigSupported).vct
|
|
77
77
|
if (vct.startsWith('http')) {
|
|
78
78
|
try {
|
|
79
79
|
sdJwtTypeMetadata = await context.agent.fetchSdJwtTypeMetadataFromVctUrl({ vct })
|
|
@@ -580,7 +580,7 @@ export const getIssuanceCryptoSuite = async (opts: GetIssuanceCryptoSuiteArgs):
|
|
|
580
580
|
case 'jwt':
|
|
581
581
|
case 'jwt_vc_json':
|
|
582
582
|
case 'jwt_vc':
|
|
583
|
-
case '
|
|
583
|
+
case 'dc+sd-jwt':
|
|
584
584
|
case 'mso_mdoc': {
|
|
585
585
|
const supportedPreferences: Array<JoseSignatureAlgorithm | JoseSignatureAlgorithmString> = jwtCryptographicSuitePreferences.filter(
|
|
586
586
|
(suite: JoseSignatureAlgorithm | JoseSignatureAlgorithmString) => signing_algs_supported.includes(suite),
|