@sphereon/ssi-sdk.ebsi-support 0.34.1-feature.merge.crypto.extensions.modules.39 → 0.34.1-fix.79
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 +13 -64
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -64
- package/dist/index.js.map +1 -1
- package/package.json +24 -24
- package/src/agent/EbsiSupport.ts +42 -40
- package/src/functions/Attestation.ts +2 -1
package/dist/index.cjs
CHANGED
|
@@ -2081,7 +2081,6 @@ module.exports = __toCommonJS(index_exports);
|
|
|
2081
2081
|
var import_ssi_types2 = require("@sphereon/ssi-types");
|
|
2082
2082
|
|
|
2083
2083
|
// src/agent/EbsiSupport.ts
|
|
2084
|
-
var import_did_auth_siop2 = require("@sphereon/did-auth-siop");
|
|
2085
2084
|
var import_oid4vci_common4 = require("@sphereon/oid4vci-common");
|
|
2086
2085
|
var import_ssi_types = require("@sphereon/ssi-types");
|
|
2087
2086
|
var import_cross_fetch4 = __toESM(require("cross-fetch"), 1);
|
|
@@ -2353,7 +2352,7 @@ var ebsiCreateAttestationAuthRequestURL = /* @__PURE__ */ __name(async ({ client
|
|
|
2353
2352
|
createAuthorizationRequestURL: false,
|
|
2354
2353
|
retrieveServerMetadata: true
|
|
2355
2354
|
});
|
|
2356
|
-
const allMatches =
|
|
2355
|
+
const allMatches = {};
|
|
2357
2356
|
let arrayMatches;
|
|
2358
2357
|
if (Array.isArray(allMatches)) {
|
|
2359
2358
|
arrayMatches = allMatches;
|
|
@@ -2591,12 +2590,12 @@ var EBSI_DID_SPEC_INFOS = {
|
|
|
2591
2590
|
method: "did:key:"
|
|
2592
2591
|
}
|
|
2593
2592
|
};
|
|
2594
|
-
var EbsiPublicKeyPurpose = /* @__PURE__ */
|
|
2593
|
+
var EbsiPublicKeyPurpose = /* @__PURE__ */ function(EbsiPublicKeyPurpose2) {
|
|
2595
2594
|
EbsiPublicKeyPurpose2["Authentication"] = "authentication";
|
|
2596
2595
|
EbsiPublicKeyPurpose2["AssertionMethod"] = "assertionMethod";
|
|
2597
2596
|
EbsiPublicKeyPurpose2["CapabilityInvocation"] = "capabilityInvocation";
|
|
2598
2597
|
return EbsiPublicKeyPurpose2;
|
|
2599
|
-
}
|
|
2598
|
+
}({});
|
|
2600
2599
|
var JSON_RPC_VERSION = "2.0";
|
|
2601
2600
|
var BASE_CONTEXT_DOC = JSON.stringify({
|
|
2602
2601
|
"@context": [
|
|
@@ -2604,7 +2603,7 @@ var BASE_CONTEXT_DOC = JSON.stringify({
|
|
|
2604
2603
|
"https://w3id.org/security/suites/jws-2020/v1"
|
|
2605
2604
|
]
|
|
2606
2605
|
});
|
|
2607
|
-
var EbsiRpcMethod = /* @__PURE__ */
|
|
2606
|
+
var EbsiRpcMethod = /* @__PURE__ */ function(EbsiRpcMethod2) {
|
|
2608
2607
|
EbsiRpcMethod2["INSERT_DID_DOCUMENT"] = "insertDidDocument";
|
|
2609
2608
|
EbsiRpcMethod2["UPDATE_DID_DOCUMENT"] = "updateBaseDocument";
|
|
2610
2609
|
EbsiRpcMethod2["ADD_VERIFICATION_METHOD"] = "addVerificationMethod";
|
|
@@ -2612,7 +2611,7 @@ var EbsiRpcMethod = /* @__PURE__ */ (function(EbsiRpcMethod2) {
|
|
|
2612
2611
|
EbsiRpcMethod2["ADD_SERVICE"] = "addService";
|
|
2613
2612
|
EbsiRpcMethod2["SEND_SIGNED_TRANSACTION"] = "sendSignedTransaction";
|
|
2614
2613
|
return EbsiRpcMethod2;
|
|
2615
|
-
}
|
|
2614
|
+
}({});
|
|
2616
2615
|
|
|
2617
2616
|
// src/did/services/EbsiRPCService.ts
|
|
2618
2617
|
var callRpcMethod = /* @__PURE__ */ __name(async (args) => {
|
|
@@ -3131,7 +3130,6 @@ var ebsiCreateDidOnLedger = /* @__PURE__ */ __name(async (args, context) => {
|
|
|
3131
3130
|
|
|
3132
3131
|
// src/agent/EbsiSupport.ts
|
|
3133
3132
|
var import_uuid = require("uuid");
|
|
3134
|
-
var import_did_auth_siop_adapter = require("@sphereon/did-auth-siop-adapter");
|
|
3135
3133
|
var import_ssi_sdk5 = require("@sphereon/ssi-sdk.core");
|
|
3136
3134
|
var ebsiSupportMethods = [
|
|
3137
3135
|
"ebsiCreateDidOnLedger",
|
|
@@ -3223,15 +3221,15 @@ var EbsiSupport = class {
|
|
|
3223
3221
|
let attestationCredential = args.attestationCredential;
|
|
3224
3222
|
if (hasInputDescriptors && !attestationCredential) {
|
|
3225
3223
|
if (allVerifiableCredentials && allVerifiableCredentials.length > 0) {
|
|
3226
|
-
const
|
|
3224
|
+
const pexResult = await context.agent.pexDefinitionFilterCredentials({
|
|
3227
3225
|
presentationDefinition: definitionResponse,
|
|
3228
3226
|
credentialFilterOpts: {
|
|
3229
3227
|
credentialRole: args.credentialRole,
|
|
3230
3228
|
verifiableCredentials: allVerifiableCredentials
|
|
3231
3229
|
}
|
|
3232
3230
|
});
|
|
3233
|
-
if (
|
|
3234
|
-
const filtered =
|
|
3231
|
+
if (pexResult.filteredCredentials.length > 0) {
|
|
3232
|
+
const filtered = pexResult.filteredCredentials.map((cred) => import_ssi_types.CredentialMapper.toUniformCredential(cred, {
|
|
3235
3233
|
hasher: import_ssi_sdk5.defaultHasher
|
|
3236
3234
|
})).filter((cred) => {
|
|
3237
3235
|
if (!cred.expirationDate) {
|
|
@@ -3276,57 +3274,7 @@ var EbsiSupport = class {
|
|
|
3276
3274
|
attestationCredential = attestationResult.credentials[0].rawVerifiableCredential;
|
|
3277
3275
|
}
|
|
3278
3276
|
}
|
|
3279
|
-
const
|
|
3280
|
-
definition: definitionResponse,
|
|
3281
|
-
location: import_did_auth_siop2.PresentationDefinitionLocation.TOPLEVEL_PRESENTATION_DEF,
|
|
3282
|
-
version: import_did_auth_siop2.SupportedVersion.SIOPv2_D11
|
|
3283
|
-
};
|
|
3284
|
-
const pexResult = hasInputDescriptors ? await context.agent.pexDefinitionFilterCredentials({
|
|
3285
|
-
presentationDefinition: definitionResponse,
|
|
3286
|
-
credentialFilterOpts: {
|
|
3287
|
-
credentialRole: args.credentialRole,
|
|
3288
|
-
verifiableCredentials: [
|
|
3289
|
-
attestationCredential
|
|
3290
|
-
]
|
|
3291
|
-
}
|
|
3292
|
-
}) : {
|
|
3293
|
-
// LOL, let's see whether we can trick PEX to create a VP without VCs
|
|
3294
|
-
filteredCredentials: [],
|
|
3295
|
-
id: definitionResponse.id,
|
|
3296
|
-
selectResults: {
|
|
3297
|
-
verifiableCredential: [],
|
|
3298
|
-
areRequiredCredentialsPresent: "info"
|
|
3299
|
-
}
|
|
3300
|
-
};
|
|
3301
|
-
const opSession = await context.agent.siopRegisterOPSession({
|
|
3302
|
-
requestJwtOrUri: "",
|
|
3303
|
-
op: {
|
|
3304
|
-
checkLinkedDomains: import_did_auth_siop_adapter.CheckLinkedDomain.NEVER
|
|
3305
|
-
},
|
|
3306
|
-
providedPresentationDefinitions: [
|
|
3307
|
-
definition
|
|
3308
|
-
]
|
|
3309
|
-
});
|
|
3310
|
-
const oid4vp = await opSession.getOID4VP({
|
|
3311
|
-
allIdentifiers: [
|
|
3312
|
-
identifier.did
|
|
3313
|
-
]
|
|
3314
|
-
});
|
|
3315
|
-
const vp = await oid4vp.createVerifiablePresentation(args.credentialRole, {
|
|
3316
|
-
definition,
|
|
3317
|
-
credentials: pexResult.filteredCredentials
|
|
3318
|
-
}, {
|
|
3319
|
-
proofOpts: {
|
|
3320
|
-
domain: openIDMetadata.issuer,
|
|
3321
|
-
nonce: (0, import_uuid.v4)(),
|
|
3322
|
-
created: new Date(Date.now() - 12e4).toString()
|
|
3323
|
-
},
|
|
3324
|
-
holder: identifier.did,
|
|
3325
|
-
idOpts,
|
|
3326
|
-
skipDidResolution,
|
|
3327
|
-
forceNoCredentialsInVP: !hasInputDescriptors
|
|
3328
|
-
});
|
|
3329
|
-
const presentationSubmission = hasInputDescriptors ? vp.presentationSubmission : {
|
|
3277
|
+
const presentationSubmission = {
|
|
3330
3278
|
id: (0, import_uuid.v4)(),
|
|
3331
3279
|
definition_id: definitionResponse.id,
|
|
3332
3280
|
descriptor_map: []
|
|
@@ -3334,7 +3282,8 @@ var EbsiSupport = class {
|
|
|
3334
3282
|
console.log(`Presentation submission`, presentationSubmission);
|
|
3335
3283
|
const tokenRequestArgs = {
|
|
3336
3284
|
grant_type: "vp_token",
|
|
3337
|
-
|
|
3285
|
+
// FIXME SSISDK-40
|
|
3286
|
+
vp_token: "",
|
|
3338
3287
|
scope,
|
|
3339
3288
|
presentation_submission: presentationSubmission,
|
|
3340
3289
|
apiOpts: {
|
|
@@ -3383,10 +3332,10 @@ ${JSON.stringify(accessTokenResponse)}`);
|
|
|
3383
3332
|
};
|
|
3384
3333
|
|
|
3385
3334
|
// src/types/IEbsiSupport.ts
|
|
3386
|
-
var TokenType = /* @__PURE__ */
|
|
3335
|
+
var TokenType = /* @__PURE__ */ function(TokenType2) {
|
|
3387
3336
|
TokenType2["BEARER"] = "Bearer";
|
|
3388
3337
|
return TokenType2;
|
|
3389
|
-
}
|
|
3338
|
+
}({});
|
|
3390
3339
|
|
|
3391
3340
|
// src/did/EbsiDidProvider.ts
|
|
3392
3341
|
var import_ssi_sdk_ext5 = require("@sphereon/ssi-sdk-ext.did-utils");
|