@bedrock/vc-delivery 7.1.0 → 7.1.1
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/lib/index.js +4 -5
- package/lib/oid4/oid4vp.js +2 -2
- package/lib/vcapi.js +1 -2
- package/package.json +2 -3
package/lib/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright (c) 2022-
|
|
2
|
+
* Copyright (c) 2022-2025 Digital Bazaar, Inc. All rights reserved.
|
|
3
3
|
*/
|
|
4
4
|
import * as bedrock from '@bedrock/core';
|
|
5
5
|
import * as workflowSchemas from '../schemas/bedrock-vc-workflow.js';
|
|
6
6
|
import {createService, schemas} from '@bedrock/service-core';
|
|
7
7
|
import {addRoutes} from './http.js';
|
|
8
8
|
import {initializeServiceAgent} from '@bedrock/service-agent';
|
|
9
|
-
import {klona} from 'klona';
|
|
10
9
|
import {MAX_ISSUER_INSTANCES} from './constants.js';
|
|
11
10
|
import {parseLocalId} from './helpers.js';
|
|
12
11
|
import '@bedrock/express';
|
|
@@ -24,8 +23,8 @@ bedrock.events.on('bedrock.init', async () => {
|
|
|
24
23
|
|
|
25
24
|
async function _initService({serviceType, routePrefix}) {
|
|
26
25
|
// add customizations to config validators...
|
|
27
|
-
const createConfigBody =
|
|
28
|
-
const updateConfigBody =
|
|
26
|
+
const createConfigBody = structuredClone(schemas.createConfigBody);
|
|
27
|
+
const updateConfigBody = structuredClone(schemas.updateConfigBody);
|
|
29
28
|
const schemasToUpdate = [createConfigBody, updateConfigBody];
|
|
30
29
|
const {
|
|
31
30
|
credentialTemplates, steps, initialStep, issuerInstances
|
|
@@ -37,7 +36,7 @@ async function _initService({serviceType, routePrefix}) {
|
|
|
37
36
|
schema.properties.initialStep = initialStep;
|
|
38
37
|
schema.properties.issuerInstances = issuerInstances;
|
|
39
38
|
// allow zcaps by custom reference ID
|
|
40
|
-
schema.properties.zcaps =
|
|
39
|
+
schema.properties.zcaps = structuredClone(schemas.zcaps);
|
|
41
40
|
// max of 4 basic zcaps + max issuer instances
|
|
42
41
|
schema.properties.zcaps.maxProperties = 4 + MAX_ISSUER_INSTANCES;
|
|
43
42
|
schema.properties.zcaps.additionalProperties = schemas.delegatedZcap;
|
package/lib/oid4/oid4vp.js
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
verifiablePresentation as verifiablePresentationSchema
|
|
13
13
|
} from '../../schemas/bedrock-vc-workflow.js';
|
|
14
14
|
import {compile} from '@bedrock/validation';
|
|
15
|
-
import {klona} from 'klona';
|
|
16
15
|
import {logger} from '../logger.js';
|
|
17
16
|
import {oid4vp} from '@digitalbazaar/oid4-client';
|
|
18
17
|
import {verify} from '../verify.js';
|
|
@@ -103,7 +102,8 @@ export async function getAuthorizationRequest({req}) {
|
|
|
103
102
|
authorizationRequest.client_id_scheme = 'redirect_uri';
|
|
104
103
|
}
|
|
105
104
|
if(client_metadata) {
|
|
106
|
-
authorizationRequest.client_metadata =
|
|
105
|
+
authorizationRequest.client_metadata = structuredClone(
|
|
106
|
+
client_metadata);
|
|
107
107
|
} else if(client_metadata_uri) {
|
|
108
108
|
authorizationRequest.client_metadata_uri = client_metadata_uri;
|
|
109
109
|
} else {
|
package/lib/vcapi.js
CHANGED
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
import {exportJWK, generateKeyPair, importJWK} from 'jose';
|
|
12
12
|
import {compile} from '@bedrock/validation';
|
|
13
13
|
import {issue} from './issue.js';
|
|
14
|
-
import {klona} from 'klona';
|
|
15
14
|
import {logger} from './logger.js';
|
|
16
15
|
|
|
17
16
|
const {util: {BedrockError}} = bedrock;
|
|
@@ -141,7 +140,7 @@ export async function processExchange({req, res, workflow, exchangeRecord}) {
|
|
|
141
140
|
|
|
142
141
|
// if no presentation was received in the body...
|
|
143
142
|
if(!receivedPresentation) {
|
|
144
|
-
const verifiablePresentationRequest =
|
|
143
|
+
const verifiablePresentationRequest = structuredClone(
|
|
145
144
|
step.verifiablePresentationRequest);
|
|
146
145
|
if(createChallenge) {
|
|
147
146
|
/* Note: When creating a challenge, the initial step always
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock/vc-delivery",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bedrock Verifiable Credential Delivery",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
"cors": "^2.8.5",
|
|
48
48
|
"jose": "^5.10.0",
|
|
49
49
|
"jsonata": "^2.0.6",
|
|
50
|
-
"klona": "^2.0.6",
|
|
51
50
|
"serialize-error": "^12.0.0"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
@@ -72,6 +71,6 @@
|
|
|
72
71
|
"eslint-plugin-unicorn": "^56.0.1"
|
|
73
72
|
},
|
|
74
73
|
"engines": {
|
|
75
|
-
"node": ">=
|
|
74
|
+
"node": ">=20"
|
|
76
75
|
}
|
|
77
76
|
}
|