@sphereon/ssi-sdk.ebsi-support 0.34.1-feature.SSISDK.47.42 → 0.34.1-feature.SSISDK.50.100
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 +21 -71
- 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 +15 -65
- 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/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) => {
|
|
@@ -2555,12 +2555,12 @@ var EBSI_DID_SPEC_INFOS = {
|
|
|
2555
2555
|
method: "did:key:"
|
|
2556
2556
|
}
|
|
2557
2557
|
};
|
|
2558
|
-
var EbsiPublicKeyPurpose = /* @__PURE__ */
|
|
2558
|
+
var EbsiPublicKeyPurpose = /* @__PURE__ */ function(EbsiPublicKeyPurpose2) {
|
|
2559
2559
|
EbsiPublicKeyPurpose2["Authentication"] = "authentication";
|
|
2560
2560
|
EbsiPublicKeyPurpose2["AssertionMethod"] = "assertionMethod";
|
|
2561
2561
|
EbsiPublicKeyPurpose2["CapabilityInvocation"] = "capabilityInvocation";
|
|
2562
2562
|
return EbsiPublicKeyPurpose2;
|
|
2563
|
-
}
|
|
2563
|
+
}({});
|
|
2564
2564
|
var JSON_RPC_VERSION = "2.0";
|
|
2565
2565
|
var BASE_CONTEXT_DOC = JSON.stringify({
|
|
2566
2566
|
"@context": [
|
|
@@ -2568,7 +2568,7 @@ var BASE_CONTEXT_DOC = JSON.stringify({
|
|
|
2568
2568
|
"https://w3id.org/security/suites/jws-2020/v1"
|
|
2569
2569
|
]
|
|
2570
2570
|
});
|
|
2571
|
-
var EbsiRpcMethod = /* @__PURE__ */
|
|
2571
|
+
var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
|
|
2572
2572
|
EbsiRpcMethod2["INSERT_DID_DOCUMENT"] = "insertDidDocument";
|
|
2573
2573
|
EbsiRpcMethod2["UPDATE_DID_DOCUMENT"] = "updateBaseDocument";
|
|
2574
2574
|
EbsiRpcMethod2["ADD_VERIFICATION_METHOD"] = "addVerificationMethod";
|
|
@@ -2576,7 +2576,7 @@ var EbsiRpcMethod = /* @__PURE__ */ (function(EbsiRpcMethod2) {
|
|
|
2576
2576
|
EbsiRpcMethod2["ADD_SERVICE"] = "addService";
|
|
2577
2577
|
EbsiRpcMethod2["SEND_SIGNED_TRANSACTION"] = "sendSignedTransaction";
|
|
2578
2578
|
return EbsiRpcMethod2;
|
|
2579
|
-
}
|
|
2579
|
+
}({});
|
|
2580
2580
|
|
|
2581
2581
|
// src/did/services/EbsiRPCService.ts
|
|
2582
2582
|
var callRpcMethod = /* @__PURE__ */ __name(async (args) => {
|
|
@@ -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: {
|
|
@@ -3347,10 +3297,10 @@ ${JSON.stringify(accessTokenResponse)}`);
|
|
|
3347
3297
|
};
|
|
3348
3298
|
|
|
3349
3299
|
// src/types/IEbsiSupport.ts
|
|
3350
|
-
var TokenType = /* @__PURE__ */
|
|
3300
|
+
var TokenType = /* @__PURE__ */ function(TokenType2) {
|
|
3351
3301
|
TokenType2["BEARER"] = "Bearer";
|
|
3352
3302
|
return TokenType2;
|
|
3353
|
-
}
|
|
3303
|
+
}({});
|
|
3354
3304
|
|
|
3355
3305
|
// src/did/EbsiDidProvider.ts
|
|
3356
3306
|
import { getControllerKey as getControllerKey2, getEthereumAddressFromKey as getEthereumAddressFromKey2 } from "@sphereon/ssi-sdk-ext.did-utils";
|