@sphereon/ssi-sdk.ebsi-support 0.34.1-next.29 → 0.34.1-next.299

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sphereon/ssi-sdk.ebsi-support",
3
- "version": "0.34.1-next.29+2593a430",
3
+ "version": "0.34.1-next.299+9e9f5a50",
4
4
  "source": "src/index.ts",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -27,43 +27,44 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@ethersproject/random": "^5.7.0",
30
- "@sphereon/did-auth-siop": "0.19.1-next.2",
31
- "@sphereon/did-auth-siop-adapter": "0.19.1-next.2",
30
+ "@sphereon/did-auth-siop": "0.19.1-next.220",
31
+ "@sphereon/did-auth-siop-adapter": "0.19.1-next.220",
32
32
  "@sphereon/pex": "5.0.0-unstable.28",
33
33
  "@sphereon/pex-models": "^2.3.2",
34
- "@sphereon/ssi-sdk-ext.did-resolver-ebsi": "0.29.1-next.3",
35
- "@sphereon/ssi-sdk-ext.did-utils": "0.29.1-next.3",
36
- "@sphereon/ssi-sdk-ext.identifier-resolution": "0.29.1-next.3",
37
- "@sphereon/ssi-sdk-ext.jwt-service": "0.29.1-next.3",
38
- "@sphereon/ssi-sdk-ext.key-utils": "0.29.1-next.3",
39
- "@sphereon/ssi-sdk.contact-manager": "0.34.1-next.29+2593a430",
40
- "@sphereon/ssi-sdk.core": "0.34.1-next.29+2593a430",
41
- "@sphereon/ssi-sdk.oid4vci-holder": "0.34.1-next.29+2593a430",
42
- "@sphereon/ssi-sdk.presentation-exchange": "0.34.1-next.29+2593a430",
43
- "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-next.29+2593a430",
44
- "@sphereon/ssi-types": "0.34.1-next.29+2593a430",
34
+ "@sphereon/ssi-sdk-ext.did-resolver-ebsi": "0.34.1-next.299+9e9f5a50",
35
+ "@sphereon/ssi-sdk-ext.did-utils": "0.34.1-next.299+9e9f5a50",
36
+ "@sphereon/ssi-sdk-ext.identifier-resolution": "0.34.1-next.299+9e9f5a50",
37
+ "@sphereon/ssi-sdk-ext.jwt-service": "0.34.1-next.299+9e9f5a50",
38
+ "@sphereon/ssi-sdk-ext.key-utils": "0.34.1-next.299+9e9f5a50",
39
+ "@sphereon/ssi-sdk.contact-manager": "0.34.1-next.299+9e9f5a50",
40
+ "@sphereon/ssi-sdk.core": "0.34.1-next.299+9e9f5a50",
41
+ "@sphereon/ssi-sdk.oid4vci-holder": "0.34.1-next.299+9e9f5a50",
42
+ "@sphereon/ssi-sdk.presentation-exchange": "0.34.1-next.299+9e9f5a50",
43
+ "@sphereon/ssi-sdk.siopv2-oid4vp-op-auth": "0.34.1-next.299+9e9f5a50",
44
+ "@sphereon/ssi-types": "0.34.1-next.299+9e9f5a50",
45
45
  "@veramo/core": "4.2.0",
46
46
  "@veramo/did-manager": "4.2.0",
47
47
  "@veramo/utils": "4.2.0",
48
- "cross-fetch": "^3.1.8",
48
+ "cross-fetch": "^4.1.0",
49
49
  "debug": "^4.3.5",
50
50
  "did-resolver": "^4.1.0",
51
51
  "ethers": "^6.13.1",
52
52
  "multiformats": "9.9.0",
53
53
  "qs": "^6.12.3",
54
- "uint8arrays": "^3.1.1",
54
+ "uint8arrays": "3.1.1",
55
55
  "uuid": "^9.0.1",
56
56
  "xstate": "^4.38.3"
57
57
  },
58
58
  "devDependencies": {
59
- "@sphereon/oid4vci-client": "0.19.1-next.2",
60
- "@sphereon/oid4vci-common": "0.19.1-next.2",
61
- "@sphereon/ssi-express-support": "0.34.1-next.29+2593a430",
62
- "@sphereon/ssi-sdk-ext.key-manager": "0.29.1-next.3",
63
- "@sphereon/ssi-sdk-ext.kms-local": "0.29.1-next.3",
64
- "@sphereon/ssi-sdk.agent-config": "0.34.1-next.29+2593a430",
65
- "@sphereon/ssi-sdk.data-store": "0.34.1-next.29+2593a430",
66
- "@sphereon/ssi-sdk.public-key-hosting": "0.34.1-next.29+2593a430",
59
+ "@sphereon/oid4vci-client": "0.19.1-next.220",
60
+ "@sphereon/oid4vci-common": "0.19.1-next.220",
61
+ "@sphereon/ssi-express-support": "0.34.1-next.299+9e9f5a50",
62
+ "@sphereon/ssi-sdk-ext.key-manager": "0.34.1-next.299+9e9f5a50",
63
+ "@sphereon/ssi-sdk-ext.kms-local": "0.34.1-next.299+9e9f5a50",
64
+ "@sphereon/ssi-sdk.agent-config": "0.34.1-next.299+9e9f5a50",
65
+ "@sphereon/ssi-sdk.data-store": "0.34.1-next.299+9e9f5a50",
66
+ "@sphereon/ssi-sdk.data-store-types": "0.34.1-next.299+9e9f5a50",
67
+ "@sphereon/ssi-sdk.public-key-hosting": "0.34.1-next.299+9e9f5a50",
67
68
  "@transmute/json-web-signature": "0.7.0-unstable.81",
68
69
  "@types/cors": "^2.8.17",
69
70
  "@types/express": "^4.17.21",
@@ -98,5 +99,5 @@
98
99
  "EBSI",
99
100
  "EBSI Authorization Client"
100
101
  ],
101
- "gitHead": "2593a430ac4faca47b620a3e12b297899518f2af"
102
+ "gitHead": "9e9f5a50ead9373a078cb5291cbc4fb1e7865dc2"
102
103
  }
@@ -346,7 +346,7 @@
346
346
  "di_vp": {
347
347
  "$ref": "#/components/schemas/DiObject"
348
348
  },
349
- "vc+sd-jwt": {
349
+ "dc+sd-jwt": {
350
350
  "$ref": "#/components/schemas/SdJwtObject"
351
351
  }
352
352
  }
@@ -1,6 +1,4 @@
1
- import { PresentationDefinitionLocation, PresentationDefinitionWithLocation, SupportedVersion } from '@sphereon/did-auth-siop'
2
1
  import { CreateRequestObjectMode } from '@sphereon/oid4vci-common'
3
- import { IPEXFilterResult } from '@sphereon/ssi-sdk.presentation-exchange'
4
2
  import { CredentialMapper, PresentationSubmission } from '@sphereon/ssi-types'
5
3
  import { IAgentPlugin } from '@veramo/core'
6
4
  import fetch from 'cross-fetch'
@@ -29,7 +27,6 @@ import {
29
27
  } from '../types/IEbsiSupport'
30
28
 
31
29
  import { v4 } from 'uuid'
32
- import { CheckLinkedDomain } from '@sphereon/did-auth-siop-adapter'
33
30
  import { defaultHasher } from '@sphereon/ssi-sdk.core'
34
31
 
35
32
  export const ebsiSupportMethods: Array<string> = [
@@ -181,49 +178,54 @@ export class EbsiSupport implements IAgentPlugin {
181
178
  }
182
179
  }
183
180
 
184
- const definition = {
185
- definition: definitionResponse,
186
- location: PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
187
- version: SupportedVersion.SIOPv2_D11,
188
- } satisfies PresentationDefinitionWithLocation
181
+ // FIXME SSISDK-40 should use DCQL
182
+ // const definition = {
183
+ // definition: definitionResponse,
184
+ // location: PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
185
+ // version: SupportedVersion.SIOPv2_D11,
186
+ // } satisfies PresentationDefinitionWithLocation
189
187
 
190
- const pexResult = hasInputDescriptors
191
- ? await context.agent.pexDefinitionFilterCredentials({
192
- presentationDefinition: definitionResponse,
193
- credentialFilterOpts: { credentialRole: args.credentialRole, verifiableCredentials: [attestationCredential!] },
194
- })
195
- : ({
196
- // LOL, let's see whether we can trick PEX to create a VP without VCs
197
- filteredCredentials: [],
198
- id: definitionResponse.id,
199
- selectResults: { verifiableCredential: [], areRequiredCredentialsPresent: 'info' },
200
- } satisfies IPEXFilterResult)
201
- const opSession = await context.agent.siopRegisterOPSession({
202
- requestJwtOrUri: '', // Siop assumes we use an auth request, which we don't have in this case
203
- op: { checkLinkedDomains: CheckLinkedDomain.NEVER },
204
- providedPresentationDefinitions: [definition],
205
- })
206
- const oid4vp = await opSession.getOID4VP({ allIdentifiers: [identifier.did] })
207
- const vp = await oid4vp.createVerifiablePresentation(
208
- args.credentialRole,
209
- { definition, credentials: pexResult.filteredCredentials },
210
- {
211
- proofOpts: { domain: openIDMetadata.issuer, nonce: v4(), created: new Date(Date.now() - 120_000).toString() },
212
- holder: identifier.did,
213
- idOpts: idOpts,
214
- skipDidResolution,
215
- forceNoCredentialsInVP: !hasInputDescriptors,
216
- },
217
- )
188
+ // const pexResult = hasInputDescriptors
189
+ // ? await context.agent.pexDefinitionFilterCredentials({
190
+ // presentationDefinition: definitionResponse,
191
+ // credentialFilterOpts: { credentialRole: args.credentialRole, verifiableCredentials: [attestationCredential!] },
192
+ // })
193
+ // : ({
194
+ // // LOL, let's see whether we can trick PEX to create a VP without VCs
195
+ // filteredCredentials: [],
196
+ // id: definitionResponse.id,
197
+ // selectResults: { verifiableCredential: [], areRequiredCredentialsPresent: 'info' },
198
+ // } satisfies IPEXFilterResult)
199
+ // const opSession = await context.agent.siopRegisterOPSession({
200
+ // requestJwtOrUri: '', // Siop assumes we use an auth request, which we don't have in this case
201
+ // op: { checkLinkedDomains: CheckLinkedDomain.NEVER },
202
+ // //providedPresentationDefinitions: [definition],
203
+ // })
204
+
205
+ //const oid4vp = await opSession.getOID4VP({ allIdentifiers: [identifier.did] })
206
+ // const vp = await oid4vp.createVerifiablePresentation(
207
+ // args.credentialRole,
208
+ // { dcqlQuery: definition, credentials: pexResult.filteredCredentials },
209
+ // {
210
+ // proofOpts: { domain: openIDMetadata.issuer, nonce: v4(), created: new Date(Date.now() - 120_000).toString() },
211
+ // holder: identifier.did,
212
+ // idOpts: idOpts,
213
+ // skipDidResolution,
214
+ // forceNoCredentialsInVP: !hasInputDescriptors,
215
+ // },
216
+ // )
218
217
 
219
- const presentationSubmission = hasInputDescriptors
220
- ? vp.presentationSubmission
221
- : ({ id: v4(), definition_id: definitionResponse.id, descriptor_map: [] } satisfies PresentationSubmission)
218
+ const presentationSubmission = { id: v4(), definition_id: definitionResponse.id, descriptor_map: [] } satisfies PresentationSubmission
219
+ // FIXME SSISDK-40
220
+ //hasInputDescriptors
221
+ //? vp.presentationSubmission
222
+ //: ({ id: v4(), definition_id: definitionResponse.id, descriptor_map: [] } satisfies PresentationSubmission)
222
223
 
223
224
  console.log(`Presentation submission`, presentationSubmission)
224
225
  const tokenRequestArgs = {
225
226
  grant_type: 'vp_token',
226
- vp_token: CredentialMapper.toCompactJWT(vp.verifiablePresentations[0]), // FIXME How are we going to send multiple presentations in a vp_token?
227
+ // FIXME SSISDK-40
228
+ vp_token: '',//CredentialMapper.toCompactJWT(vp.verifiablePresentations[0]), // FIXME How are we going to send multiple presentations in a vp_token?
227
229
  scope,
228
230
  presentation_submission: presentationSubmission,
229
231
  apiOpts: { environment, version: 'v4' },
@@ -236,7 +236,7 @@ export const toMinimalImportableKey = async (args: { key?: IKeyOpts; type: EbsiK
236
236
  }
237
237
 
238
238
  minimalImportableKey.meta = {
239
- purposes: assertedPurposes({ key }) ?? setDefaultPurposes({ key, type }),
239
+ purposes: assertedPurposes({ key }) ?? setPurposes({ key, type }),
240
240
  jwkThumbprint: calculateJwkThumbprintForKey({
241
241
  key: minimalImportableKey as MinimalImportableKey,
242
242
  digestAlgorithm: 'sha256',
@@ -275,7 +275,7 @@ export const assertedPurposes = (args: { key?: IKeyOpts }): EbsiPublicKeyPurpose
275
275
  return key?.purposes
276
276
  }
277
277
 
278
- export const setDefaultPurposes = (args: { key?: IKeyOpts; type: EbsiKeyType }): EbsiPublicKeyPurpose[] => {
278
+ export const setPurposes = (args: { key?: IKeyOpts; type: EbsiKeyType }): EbsiPublicKeyPurpose[] => {
279
279
  const { key, type } = args
280
280
  if (!key?.purposes || key.purposes.length === 0) {
281
281
  switch (type) {
package/src/did/index.ts CHANGED
@@ -3,3 +3,4 @@ export { getDidEbsiResolver } from './EbsiDidResolver'
3
3
  export { ebsiCreateDidOnLedger, randomRpcId, ebsiSignAndSendTransaction, ebsiGetRegistryAPIUrls } from './functions'
4
4
  export * from './services/EbsiRestService'
5
5
  export * from './types'
6
+ export * from './functions'
package/src/did/types.ts CHANGED
@@ -4,7 +4,7 @@ import { IService } from '@veramo/core'
4
4
  import { DIDDocument } from 'did-resolver'
5
5
  import { AccessListish, BigNumberish, BytesLike } from 'ethers'
6
6
  import { ApiOpts, EbsiEnvironment } from '../types/IEbsiSupport'
7
- import { CredentialRole } from '@sphereon/ssi-sdk.data-store'
7
+ import { CredentialRole } from '@sphereon/ssi-types'
8
8
 
9
9
  export type IContext = IAgentContext<IKeyManager>
10
10
 
@@ -5,6 +5,7 @@ import {
5
5
  AuthorizationRequestOpts,
6
6
  AuthzFlowType,
7
7
  CredentialConfigurationSupported,
8
+ CredentialConfigurationSupportedV1_0_15,
8
9
  getJson,
9
10
  getTypesFromCredentialSupported,
10
11
  ProofOfPossessionCallbacks,
@@ -29,7 +30,7 @@ import {
29
30
  Siopv2OID4VPLinkHandler,
30
31
  } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth'
31
32
  import { _ExtendedIKey } from '@veramo/utils'
32
- import { waitFor } from 'xstate/lib/waitFor'
33
+ import { waitFor } from 'xstate/lib/waitFor.js'
33
34
  import { logger } from '../index'
34
35
  import { AttestationResult, CreateAttestationAuthRequestURLArgs, EbsiEnvironment, GetAttestationArgs, IRequiredContext } from '../types/IEbsiSupport'
35
36
  import {
@@ -101,7 +102,7 @@ export const ebsiCreateAttestationAuthRequestURL = async (
101
102
  retrieveServerMetadata: true,
102
103
  })
103
104
 
104
- const allMatches = vciClient.getCredentialsSupported(false)
105
+ const allMatches = {} as Record<string, CredentialConfigurationSupportedV1_0_15> | Array<CredentialConfigurationSupported> // vciClient.getCredentialsSupported(format) FIXME SSISDK-40
105
106
  let arrayMatches: Array<CredentialConfigurationSupported>
106
107
  if (Array.isArray(allMatches)) {
107
108
  arrayMatches = allMatches
@@ -3,15 +3,15 @@ import { getIssuerName } from '@sphereon/oid4vci-common'
3
3
  import {
4
4
  ConnectionType,
5
5
  CorrelationIdentifierType,
6
- CredentialRole,
7
6
  IdentityOrigin,
8
7
  NonPersistedParty,
9
8
  Party,
10
9
  PartyOrigin,
11
10
  PartyTypeType,
12
- } from '@sphereon/ssi-sdk.data-store'
11
+ } from '@sphereon/ssi-sdk.data-store-types'
13
12
  import { OID4VCIMachine, OID4VCIMachineEvents, OID4VCIMachineInterpreter, OID4VCIMachineState } from '@sphereon/ssi-sdk.oid4vci-holder'
14
13
  import { Siopv2MachineInterpreter, Siopv2MachineState, Siopv2OID4VPLinkHandler } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth'
14
+ import { CredentialRole } from '@sphereon/ssi-types'
15
15
  import fetch from 'cross-fetch'
16
16
  import { logger } from '../index'
17
17
  import { IRequiredContext } from '../types/IEbsiSupport'
package/src/index.ts CHANGED
@@ -8,4 +8,4 @@ const schema = require('../plugin.schema.json')
8
8
  export { schema }
9
9
  export { EbsiSupport, ebsiSupportMethods } from './agent/EbsiSupport'
10
10
  export * from './types/IEbsiSupport'
11
- export { EbsiDidProvider } from './did'
11
+ export * from './did'
@@ -3,7 +3,8 @@ import { OID4VCICredentialFormat, RequestObjectOpts } from '@sphereon/oid4vci-co
3
3
  import { Format, PresentationDefinitionV2 } from '@sphereon/pex-models'
4
4
  import { IIdentifierResolution, ManagedIdentifierDidOpts, ManagedIdentifierDidResult } from '@sphereon/ssi-sdk-ext.identifier-resolution'
5
5
  import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service'
6
- import { CredentialRole, IBasicCredentialLocaleBranding, Party } from '@sphereon/ssi-sdk.data-store'
6
+ import { IBasicCredentialLocaleBranding, Party } from '@sphereon/ssi-sdk.data-store-types'
7
+ import { CredentialRole } from '@sphereon/ssi-types'
7
8
  import { ErrorDetails, IOID4VCIHolder, MappedCredentialToAccept } from '@sphereon/ssi-sdk.oid4vci-holder'
8
9
  import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange'
9
10
  import { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth'