@sphereon/ssi-sdk.ebsi-support 0.34.1-feature.SSISDK.46.44 → 0.34.1-feature.SSISDK.47.154
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 +16 -66
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +10 -60
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/plugin.schema.json +1 -1
- package/src/agent/EbsiSupport.ts +42 -40
- package/src/did/types.ts +1 -1
- package/src/functions/Attestation.ts +2 -1
- package/src/functions/AttestationHeadlessCallbacks.ts +1 -1
- package/src/types/IEbsiSupport.ts +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as _sphereon_ssi_types from '@sphereon/ssi-types';
|
|
2
|
-
import { W3CVerifiableCredential, PresentationSubmission } from '@sphereon/ssi-types';
|
|
2
|
+
import { W3CVerifiableCredential, CredentialRole, PresentationSubmission } from '@sphereon/ssi-types';
|
|
3
3
|
import { IIdentifier, MinimalImportableKey, TKeyType, IService, IKey, IAgentContext, IKeyManager, IDIDManager, IPluginMethodMap, IResolver, IAgentPlugin } from '@veramo/core';
|
|
4
4
|
import { DiscoveryMetadataPayload, JWK } from '@sphereon/did-auth-siop';
|
|
5
5
|
import { RequestObjectOpts, OID4VCICredentialFormat } from '@sphereon/oid4vci-common';
|
|
6
6
|
import { PresentationDefinitionV2, Format } from '@sphereon/pex-models';
|
|
7
7
|
import { ManagedIdentifierDidResult, IIdentifierResolution, ManagedIdentifierDidOpts } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
8
8
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
9
|
-
import {
|
|
9
|
+
import { Party, IBasicCredentialLocaleBranding } from '@sphereon/ssi-sdk.data-store';
|
|
10
10
|
import { PrepareStartArgs, IssuanceOpts, IOID4VCIHolder, ErrorDetails, MappedCredentialToAccept } from '@sphereon/ssi-sdk.oid4vci-holder';
|
|
11
11
|
import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange';
|
|
12
12
|
import { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as _sphereon_ssi_types from '@sphereon/ssi-types';
|
|
2
|
-
import { W3CVerifiableCredential, PresentationSubmission } from '@sphereon/ssi-types';
|
|
2
|
+
import { W3CVerifiableCredential, CredentialRole, PresentationSubmission } from '@sphereon/ssi-types';
|
|
3
3
|
import { IIdentifier, MinimalImportableKey, TKeyType, IService, IKey, IAgentContext, IKeyManager, IDIDManager, IPluginMethodMap, IResolver, IAgentPlugin } from '@veramo/core';
|
|
4
4
|
import { DiscoveryMetadataPayload, JWK } from '@sphereon/did-auth-siop';
|
|
5
5
|
import { RequestObjectOpts, OID4VCICredentialFormat } from '@sphereon/oid4vci-common';
|
|
6
6
|
import { PresentationDefinitionV2, Format } from '@sphereon/pex-models';
|
|
7
7
|
import { ManagedIdentifierDidResult, IIdentifierResolution, ManagedIdentifierDidOpts } from '@sphereon/ssi-sdk-ext.identifier-resolution';
|
|
8
8
|
import { IJwtService } from '@sphereon/ssi-sdk-ext.jwt-service';
|
|
9
|
-
import {
|
|
9
|
+
import { Party, IBasicCredentialLocaleBranding } from '@sphereon/ssi-sdk.data-store';
|
|
10
10
|
import { PrepareStartArgs, IssuanceOpts, IOID4VCIHolder, ErrorDetails, MappedCredentialToAccept } from '@sphereon/ssi-sdk.oid4vci-holder';
|
|
11
11
|
import { IPresentationExchange } from '@sphereon/ssi-sdk.presentation-exchange';
|
|
12
12
|
import { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk.siopv2-oid4vp-op-auth';
|
package/dist/index.js
CHANGED
|
@@ -356,7 +356,7 @@ var require_plugin_schema = __commonJS({
|
|
|
356
356
|
di_vp: {
|
|
357
357
|
$ref: "#/components/schemas/DiObject"
|
|
358
358
|
},
|
|
359
|
-
"
|
|
359
|
+
"dc+sd-jwt": {
|
|
360
360
|
$ref: "#/components/schemas/SdJwtObject"
|
|
361
361
|
}
|
|
362
362
|
}
|
|
@@ -2045,7 +2045,6 @@ var require_plugin_schema = __commonJS({
|
|
|
2045
2045
|
import { Loggers, LogLevel, LogMethod } from "@sphereon/ssi-types";
|
|
2046
2046
|
|
|
2047
2047
|
// src/agent/EbsiSupport.ts
|
|
2048
|
-
import { PresentationDefinitionLocation, SupportedVersion } from "@sphereon/did-auth-siop";
|
|
2049
2048
|
import { CreateRequestObjectMode as CreateRequestObjectMode2 } from "@sphereon/oid4vci-common";
|
|
2050
2049
|
import { CredentialMapper } from "@sphereon/ssi-types";
|
|
2051
2050
|
import fetch4 from "cross-fetch";
|
|
@@ -2072,8 +2071,9 @@ import { waitFor } from "xstate/lib/waitFor";
|
|
|
2072
2071
|
// src/functions/AttestationHeadlessCallbacks.ts
|
|
2073
2072
|
import { decodeUriAsJson } from "@sphereon/did-auth-siop";
|
|
2074
2073
|
import { getIssuerName } from "@sphereon/oid4vci-common";
|
|
2075
|
-
import { ConnectionType, CorrelationIdentifierType,
|
|
2074
|
+
import { ConnectionType, CorrelationIdentifierType, IdentityOrigin, PartyOrigin, PartyTypeType } from "@sphereon/ssi-sdk.data-store";
|
|
2076
2075
|
import { OID4VCIMachineEvents } from "@sphereon/ssi-sdk.oid4vci-holder";
|
|
2076
|
+
import { CredentialRole } from "@sphereon/ssi-types";
|
|
2077
2077
|
import fetch from "cross-fetch";
|
|
2078
2078
|
var addContactCallback = /* @__PURE__ */ __name((context) => {
|
|
2079
2079
|
return async (oid4vciMachine, state) => {
|
|
@@ -2317,7 +2317,7 @@ var ebsiCreateAttestationAuthRequestURL = /* @__PURE__ */ __name(async ({ client
|
|
|
2317
2317
|
createAuthorizationRequestURL: false,
|
|
2318
2318
|
retrieveServerMetadata: true
|
|
2319
2319
|
});
|
|
2320
|
-
const allMatches =
|
|
2320
|
+
const allMatches = {};
|
|
2321
2321
|
let arrayMatches;
|
|
2322
2322
|
if (Array.isArray(allMatches)) {
|
|
2323
2323
|
arrayMatches = allMatches;
|
|
@@ -3095,7 +3095,6 @@ var ebsiCreateDidOnLedger = /* @__PURE__ */ __name(async (args, context) => {
|
|
|
3095
3095
|
|
|
3096
3096
|
// src/agent/EbsiSupport.ts
|
|
3097
3097
|
import { v4 } from "uuid";
|
|
3098
|
-
import { CheckLinkedDomain } from "@sphereon/did-auth-siop-adapter";
|
|
3099
3098
|
import { defaultHasher } from "@sphereon/ssi-sdk.core";
|
|
3100
3099
|
var ebsiSupportMethods = [
|
|
3101
3100
|
"ebsiCreateDidOnLedger",
|
|
@@ -3187,15 +3186,15 @@ var EbsiSupport = class {
|
|
|
3187
3186
|
let attestationCredential = args.attestationCredential;
|
|
3188
3187
|
if (hasInputDescriptors && !attestationCredential) {
|
|
3189
3188
|
if (allVerifiableCredentials && allVerifiableCredentials.length > 0) {
|
|
3190
|
-
const
|
|
3189
|
+
const pexResult = await context.agent.pexDefinitionFilterCredentials({
|
|
3191
3190
|
presentationDefinition: definitionResponse,
|
|
3192
3191
|
credentialFilterOpts: {
|
|
3193
3192
|
credentialRole: args.credentialRole,
|
|
3194
3193
|
verifiableCredentials: allVerifiableCredentials
|
|
3195
3194
|
}
|
|
3196
3195
|
});
|
|
3197
|
-
if (
|
|
3198
|
-
const filtered =
|
|
3196
|
+
if (pexResult.filteredCredentials.length > 0) {
|
|
3197
|
+
const filtered = pexResult.filteredCredentials.map((cred) => CredentialMapper.toUniformCredential(cred, {
|
|
3199
3198
|
hasher: defaultHasher
|
|
3200
3199
|
})).filter((cred) => {
|
|
3201
3200
|
if (!cred.expirationDate) {
|
|
@@ -3240,57 +3239,7 @@ var EbsiSupport = class {
|
|
|
3240
3239
|
attestationCredential = attestationResult.credentials[0].rawVerifiableCredential;
|
|
3241
3240
|
}
|
|
3242
3241
|
}
|
|
3243
|
-
const
|
|
3244
|
-
definition: definitionResponse,
|
|
3245
|
-
location: PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
|
|
3246
|
-
version: SupportedVersion.SIOPv2_D11
|
|
3247
|
-
};
|
|
3248
|
-
const pexResult = hasInputDescriptors ? await context.agent.pexDefinitionFilterCredentials({
|
|
3249
|
-
presentationDefinition: definitionResponse,
|
|
3250
|
-
credentialFilterOpts: {
|
|
3251
|
-
credentialRole: args.credentialRole,
|
|
3252
|
-
verifiableCredentials: [
|
|
3253
|
-
attestationCredential
|
|
3254
|
-
]
|
|
3255
|
-
}
|
|
3256
|
-
}) : {
|
|
3257
|
-
// LOL, let's see whether we can trick PEX to create a VP without VCs
|
|
3258
|
-
filteredCredentials: [],
|
|
3259
|
-
id: definitionResponse.id,
|
|
3260
|
-
selectResults: {
|
|
3261
|
-
verifiableCredential: [],
|
|
3262
|
-
areRequiredCredentialsPresent: "info"
|
|
3263
|
-
}
|
|
3264
|
-
};
|
|
3265
|
-
const opSession = await context.agent.siopRegisterOPSession({
|
|
3266
|
-
requestJwtOrUri: "",
|
|
3267
|
-
op: {
|
|
3268
|
-
checkLinkedDomains: CheckLinkedDomain.NEVER
|
|
3269
|
-
},
|
|
3270
|
-
providedPresentationDefinitions: [
|
|
3271
|
-
definition
|
|
3272
|
-
]
|
|
3273
|
-
});
|
|
3274
|
-
const oid4vp = await opSession.getOID4VP({
|
|
3275
|
-
allIdentifiers: [
|
|
3276
|
-
identifier.did
|
|
3277
|
-
]
|
|
3278
|
-
});
|
|
3279
|
-
const vp = await oid4vp.createVerifiablePresentation(args.credentialRole, {
|
|
3280
|
-
definition,
|
|
3281
|
-
credentials: pexResult.filteredCredentials
|
|
3282
|
-
}, {
|
|
3283
|
-
proofOpts: {
|
|
3284
|
-
domain: openIDMetadata.issuer,
|
|
3285
|
-
nonce: v4(),
|
|
3286
|
-
created: new Date(Date.now() - 12e4).toString()
|
|
3287
|
-
},
|
|
3288
|
-
holder: identifier.did,
|
|
3289
|
-
idOpts,
|
|
3290
|
-
skipDidResolution,
|
|
3291
|
-
forceNoCredentialsInVP: !hasInputDescriptors
|
|
3292
|
-
});
|
|
3293
|
-
const presentationSubmission = hasInputDescriptors ? vp.presentationSubmission : {
|
|
3242
|
+
const presentationSubmission = {
|
|
3294
3243
|
id: v4(),
|
|
3295
3244
|
definition_id: definitionResponse.id,
|
|
3296
3245
|
descriptor_map: []
|
|
@@ -3298,7 +3247,8 @@ var EbsiSupport = class {
|
|
|
3298
3247
|
console.log(`Presentation submission`, presentationSubmission);
|
|
3299
3248
|
const tokenRequestArgs = {
|
|
3300
3249
|
grant_type: "vp_token",
|
|
3301
|
-
|
|
3250
|
+
// FIXME SSISDK-40
|
|
3251
|
+
vp_token: "",
|
|
3302
3252
|
scope,
|
|
3303
3253
|
presentation_submission: presentationSubmission,
|
|
3304
3254
|
apiOpts: {
|