@bedrock/vc-delivery 7.7.2 → 7.8.0
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 +17 -3
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -4,11 +4,11 @@
|
|
|
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
|
+
import {initializeServiceAgent, refreshZcaps} from '@bedrock/service-agent';
|
|
7
8
|
import {
|
|
8
9
|
MAX_ISSUER_INSTANCES, MAX_OID4VP_CLIENT_PROFILES
|
|
9
10
|
} from './constants.js';
|
|
10
11
|
import {addRoutes} from './http.js';
|
|
11
|
-
import {initializeServiceAgent} from '@bedrock/service-agent';
|
|
12
12
|
import {parseLocalId} from './helpers.js';
|
|
13
13
|
import '@bedrock/express';
|
|
14
14
|
|
|
@@ -44,9 +44,9 @@ async function _initService({serviceType, routePrefix}) {
|
|
|
44
44
|
schema.properties.issuerInstances = issuerInstances;
|
|
45
45
|
// allow zcaps by custom reference ID
|
|
46
46
|
schema.properties.zcaps = structuredClone(schemas.zcaps);
|
|
47
|
-
// max of
|
|
47
|
+
// max of 4 basic zcaps + max issuer instances + max OID4VP client profiles
|
|
48
48
|
schema.properties.zcaps.maxProperties =
|
|
49
|
-
|
|
49
|
+
4 + MAX_ISSUER_INSTANCES + MAX_OID4VP_CLIENT_PROFILES;
|
|
50
50
|
schema.properties.zcaps.additionalProperties = schemas.delegatedZcap;
|
|
51
51
|
// note: credential templates are not required; if any other properties
|
|
52
52
|
// become required, add them here
|
|
@@ -87,8 +87,22 @@ async function _initService({serviceType, routePrefix}) {
|
|
|
87
87
|
}, {
|
|
88
88
|
referenceId: 'verifyPresentation',
|
|
89
89
|
required: false
|
|
90
|
+
}, {
|
|
91
|
+
referenceId: 'refresh',
|
|
92
|
+
required: false
|
|
90
93
|
}]
|
|
91
94
|
},
|
|
95
|
+
async refreshHandler({record, signal}) {
|
|
96
|
+
// refresh zcaps and update record w/results
|
|
97
|
+
const result = await refreshZcaps({
|
|
98
|
+
serviceType, config: record.config, signal
|
|
99
|
+
});
|
|
100
|
+
const config = result.config ?? record.config;
|
|
101
|
+
await service.configStorage.update({
|
|
102
|
+
config: {...config, sequence: config.sequence + 1},
|
|
103
|
+
refresh: result.refresh
|
|
104
|
+
});
|
|
105
|
+
},
|
|
92
106
|
async usageAggregator({meter, signal} = {}) {
|
|
93
107
|
return usageAggregator({meter, signal, service});
|
|
94
108
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bedrock/vc-delivery",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Bedrock Verifiable Credential Delivery",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"@bedrock/https-agent": "^4.1.0",
|
|
60
60
|
"@bedrock/mongodb": "^11.0.0",
|
|
61
61
|
"@bedrock/oauth2-verifier": "^2.3.1",
|
|
62
|
-
"@bedrock/service-agent": "^10.
|
|
63
|
-
"@bedrock/service-core": "^11.
|
|
62
|
+
"@bedrock/service-agent": "^10.3.1",
|
|
63
|
+
"@bedrock/service-core": "^11.4.0",
|
|
64
64
|
"@bedrock/validation": "^7.1.1"
|
|
65
65
|
},
|
|
66
66
|
"directories": {
|