Skip to content

Commit dbf45d6

Browse files
committed
Use @bedrock/[email protected].
1 parent 5dbc639 commit dbf45d6

File tree

4 files changed

+10
-41
lines changed

4 files changed

+10
-41
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# bedrock-kms-http ChangeLog
22

3+
## 22.1.0 - 2025-mm-dd
4+
5+
### Changed
6+
- Update peer dependencies:
7+
- `@bedrock/[email protected]`.
8+
39
## 22.0.0 - 2025-03-07
410

511
### Changed

lib/middleware.js

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright (c) 2019-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2019-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as bedrock from '@bedrock/core';
55
import * as brZCapStorage from '@bedrock/zcap-storage';
@@ -20,6 +20,7 @@ import {defaultModuleManager as moduleManager} from '@bedrock/kms';
2020
import {reportOperationUsage} from './metering.js';
2121

2222
const {config, util: {BedrockError}} = bedrock;
23+
const {helpers: {inspectCapabilityChain}} = brZCapStorage;
2324

2425
const FIVE_MINUTES = 1000 * 60 * 5;
2526

@@ -200,44 +201,6 @@ async function getVerifier({keyId, documentLoader}) {
200201
return {verifier, verificationMethod};
201202
}
202203

203-
async function inspectCapabilityChain({
204-
capabilityChain, capabilityChainMeta
205-
}) {
206-
// if capability chain has only root, there's nothing to check as root
207-
// zcaps cannot be revoked
208-
if(capabilityChain.length === 1) {
209-
return {valid: true};
210-
}
211-
212-
// collect capability IDs and delegators for all delegated capabilities in
213-
// chain (skip root) so they can be checked for revocation
214-
const capabilities = [];
215-
for(const [i, capability] of capabilityChain.entries()) {
216-
// skip root zcap, it cannot be revoked
217-
if(i === 0) {
218-
continue;
219-
}
220-
const [{purposeResult}] = capabilityChainMeta[i].verifyResult.results;
221-
if(purposeResult && purposeResult.delegator) {
222-
capabilities.push({
223-
capabilityId: capability.id,
224-
delegator: purposeResult.delegator.id,
225-
});
226-
}
227-
}
228-
229-
const revoked = await brZCapStorage.revocations.isRevoked({capabilities});
230-
if(revoked) {
231-
return {
232-
valid: false,
233-
error: new Error(
234-
'One or more capabilities in the chain have been revoked.')
235-
};
236-
}
237-
238-
return {valid: true};
239-
}
240-
241204
function onError({error}) {
242205
if(!(error instanceof BedrockError)) {
243206
// always expose cause message and name; expose cause details as

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@bedrock/security-context": "^9.0.0",
5050
"@bedrock/validation": "^7.1.1",
5151
"@bedrock/veres-one-context": "^16.0.0",
52-
"@bedrock/zcap-storage": "^9.0.0"
52+
"@bedrock/zcap-storage": "^9.3.0"
5353
},
5454
"directories": {
5555
"lib": "./lib"

test/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@bedrock/test": "^8.2.0",
3737
"@bedrock/validation": "^7.1.1",
3838
"@bedrock/veres-one-context": "^16.0.0",
39-
"@bedrock/zcap-storage": "^9.0.0",
39+
"@bedrock/zcap-storage": "^9.3.0",
4040
"@digitalbazaar/did-method-key": "^4.0.0",
4141
"@digitalbazaar/ed25519-signature-2020": "^5.4.0",
4242
"@digitalbazaar/ezcap": "^4.1.0",

0 commit comments

Comments
 (0)