Skip to content

Commit f7cc1e7

Browse files
committed
Update dependencies (remove klona, uuid); use node >= 20.
1 parent 6970e8d commit f7cc1e7

20 files changed

+94
-105
lines changed

CHANGELOG.md

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

3+
## 30.0.1 - 2025-04-dd
4+
5+
### Changed
6+
- Update dependencies.
7+
- Support node >= 20.
8+
39
## 30.0.0 - 2025-03-18
410

511
### Changed

lib/IndexAllocationCache.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import assert from 'assert-plus';
55
import {Bitstring} from '@digitalbazaar/bitstring';
6-
import {v4 as uuid} from 'uuid';
6+
import {randomUUID as uuid} from 'node:crypto';
77

88
/* See: ListManager for more design notes.
99

lib/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ import {addRoutes} from './http.js';
1919
import {getEnvelopeParams} from './envelopes.js';
2020
import {getSuiteParams} from './suites.js';
2121
import {initializeServiceAgent} from '@bedrock/service-agent';
22-
import {klona} from 'klona';
23-
import {v4 as uuid} from 'uuid';
22+
import {randomUUID as uuid} from 'node:crypto';
2423

2524
// load config defaults
2625
import './config.js';
@@ -29,8 +28,8 @@ export {issuer};
2928

3029
bedrock.events.on('bedrock.init', async () => {
3130
// add customizations to config validators...
32-
const createConfigBody = klona(schemas.createConfigBody);
33-
const updateConfigBody = klona(schemas.updateConfigBody);
31+
const createConfigBody = structuredClone(schemas.createConfigBody);
32+
const updateConfigBody = structuredClone(schemas.updateConfigBody);
3433
const schemasToUpdate = [createConfigBody, updateConfigBody];
3534
for(const schema of schemasToUpdate) {
3635
// add ability to configure `statusListOptions`; must be present to use
@@ -41,7 +40,7 @@ bedrock.events.on('bedrock.init', async () => {
4140
schema.properties.issueOptions = issueOptions;
4241
// require `zcaps`
4342
schema.required.push('zcaps');
44-
schema.properties.zcaps = klona(schemas.zcaps);
43+
schema.properties.zcaps = structuredClone(schemas.zcaps);
4544
// required zcap reference IDs
4645
// note: `assertionMethod` not required for backwards compatibility
4746
// purposes (as it has used other reference IDs in the past)

lib/issuer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as bedrock from '@bedrock/core';
55
import * as vc from '@digitalbazaar/vc';
@@ -11,7 +11,7 @@ import {createDocumentLoader} from './documentLoader.js';
1111
import {CredentialStatusIssuer} from './CredentialStatusIssuer.js';
1212
import {CredentialStatusWriter} from './CredentialStatusWriter.js';
1313
import jsonld from 'jsonld';
14-
import {v4 as uuid} from 'uuid';
14+
import {randomUUID as uuid} from 'node:crypto';
1515
import {named as vcNamedContexts} from '@bedrock/credentials-context';
1616

1717
const {util: {BedrockError}} = bedrock;

lib/suites.js

Lines changed: 2 additions & 2 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 Bls12381Multikey from '@digitalbazaar/bls12-381-multikey';
@@ -34,7 +34,7 @@ import {
3434
import {
3535
cryptosuite as eddsaRdfc2022CryptoSuite
3636
} from '@digitalbazaar/eddsa-rdfc-2022-cryptosuite';
37-
import {v4 as uuid} from 'uuid';
37+
import {randomUUID as uuid} from 'node:crypto';
3838

3939
const SUPPORTED_SUITES = new Map([
4040
['Ed25519Signature2020', {

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@
5353
"body-parser": "^1.20.3",
5454
"cors": "^2.8.5",
5555
"jsonld": "^8.3.3",
56-
"klona": "^2.0.6",
5756
"lru-cache": "^6.0.0",
58-
"serialize-error": "^12.0.0",
59-
"uuid": "^11.1.0"
57+
"serialize-error": "^12.0.0"
6058
},
6159
"peerDependencies": {
6260
"@bedrock/app-identity": "4.0.0",
@@ -88,6 +86,6 @@
8886
"lib": "./lib"
8987
},
9088
"engines": {
91-
"node": ">=18"
89+
"node": ">=20"
9290
}
9391
}

test/mocha/30-backwards-compatibility.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as helpers from './helpers.js';
55
import {createRequire} from 'node:module';
6-
import {klona} from 'klona';
76

87
const require = createRequire(import.meta.url);
98

@@ -115,7 +114,7 @@ describe('issue APIs - Reference ID `assertionMethod:foo` backwards ' +
115114
}
116115
});
117116
it('issues a valid credential w/no "credentialStatus"', async () => {
118-
const credential = klona(mockCredential);
117+
const credential = structuredClone(mockCredential);
119118
let error;
120119
let result;
121120
try {
@@ -148,7 +147,7 @@ describe('issue APIs - Reference ID `assertionMethod:foo` backwards ' +
148147
});
149148
it('issues a valid credential w/ SL 2021 "credentialStatus" and ' +
150149
'suspension status purpose', async () => {
151-
const credential = klona(mockCredential);
150+
const credential = structuredClone(mockCredential);
152151
let error;
153152
let result;
154153
try {
@@ -182,7 +181,7 @@ describe('issue APIs - Reference ID `assertionMethod:foo` backwards ' +
182181

183182
it('updates a StatusList2021 revocation credential status', async () => {
184183
// first issue VC
185-
const credential = klona(mockCredential);
184+
const credential = structuredClone(mockCredential);
186185
const zcapClient = helpers.createZcapClient({capabilityAgent});
187186
const {data: {verifiableCredential}} = await zcapClient.write({
188187
url: `${sl2021Revocation.issuerId}/credentials/issue`,
@@ -230,7 +229,7 @@ describe('issue APIs - Reference ID `assertionMethod:foo` backwards ' +
230229
});
231230
it('updates a StatusList2021 suspension credential status', async () => {
232231
// first issue VC
233-
const credential = klona(mockCredential);
232+
const credential = structuredClone(mockCredential);
234233
const zcapClient = helpers.createZcapClient({capabilityAgent});
235234
const {data: {verifiableCredential}} = await zcapClient.write({
236235
url: `${sl2021Suspension.issuerId}/credentials/issue`,

test/mocha/40-did-web-issuer.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as bedrock from '@bedrock/core';
55
import * as helpers from './helpers.js';
66
import {createRequire} from 'node:module';
7-
import {klona} from 'klona';
87
import {mockData} from './mock.data.js';
9-
import {v4 as uuid} from 'uuid';
8+
import {randomUUID as uuid} from 'node:crypto';
109

1110
const require = createRequire(import.meta.url);
1211

@@ -109,7 +108,7 @@ describe('issue using "did:web" issuer', () => {
109108
`urn:zcap:root:${encodeURIComponent(noStatusListIssuerId)}`;
110109
});
111110
it('issues a VC 1.1 credential with a proof set', async () => {
112-
const credential = klona(mockCredential);
111+
const credential = structuredClone(mockCredential);
113112
let error;
114113
let result;
115114
try {
@@ -149,7 +148,7 @@ describe('issue using "did:web" issuer', () => {
149148
parsedCryptosuites.should.deep.equal(expectedCryptosuites);
150149
});
151150
it('issues a VC 2.0 credential with a proof set', async () => {
152-
const credential = klona(mockCredentialV2);
151+
const credential = structuredClone(mockCredentialV2);
153152
let error;
154153
let result;
155154
try {

test/mocha/50-vc-jwt-issuer.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as base64url from 'base64url-universal';
55
import * as bedrock from '@bedrock/core';
66
import * as helpers from './helpers.js';
77
import {createRequire} from 'node:module';
8-
import {klona} from 'klona';
98
import {mockData} from './mock.data.js';
10-
import {v4 as uuid} from 'uuid';
9+
import {randomUUID as uuid} from 'node:crypto';
1110

1211
const require = createRequire(import.meta.url);
1312

@@ -82,7 +81,7 @@ describe('issue using VC-JWT format', () => {
8281
`urn:zcap:root:${encodeURIComponent(noStatusListIssuerId)}`;
8382
});
8483
it('issues a VC-JWT VC 1.1 credential', async () => {
85-
const credential = klona(mockCredential);
84+
const credential = structuredClone(mockCredential);
8685
let error;
8786
let result;
8887
try {

test/mocha/60-vc-jwt-issuer-status.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as base64url from 'base64url-universal';
55
import * as bedrock from '@bedrock/core';
66
import * as helpers from './helpers.js';
77
import {createRequire} from 'node:module';
8-
import {klona} from 'klona';
98
import {mockData} from './mock.data.js';
10-
import {v4 as uuid} from 'uuid';
9+
import {randomUUID as uuid} from 'node:crypto';
1110

1211
const require = createRequire(import.meta.url);
1312

@@ -104,7 +103,7 @@ describe('issue using VC-JWT format w/status list support', () => {
104103
statusRootZcap = `urn:zcap:root:${encodeURIComponent(statusConfig.id)}`;
105104
});
106105
it('issues a VC-JWT VC 1.1 credential', async () => {
107-
const credential = klona(mockCredential);
106+
const credential = structuredClone(mockCredential);
108107
let error;
109108
let result;
110109
try {
@@ -166,7 +165,7 @@ describe('issue using VC-JWT format w/status list support', () => {
166165
});
167166
it('updates a BitstringStatusList revocation credential status', async () => {
168167
// first issue VC
169-
const credential = klona(mockCredential);
168+
const credential = structuredClone(mockCredential);
170169
const zcapClient = helpers.createZcapClient({capabilityAgent});
171170
let {data: {verifiableCredential}} = await zcapClient.write({
172171
url: `${issuerId}/credentials/issue`,

test/mocha/70-misc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as bedrock from '@bedrock/core';
55
import * as helpers from './helpers.js';
6-
import {klona} from 'klona';
76
import {mockData} from './mock.data.js';
8-
import {v4 as uuid} from 'uuid';
7+
import {randomUUID as uuid} from 'node:crypto';
98

109
const badCredentials = [
1110
{
@@ -179,7 +178,8 @@ describe('fail for bad credentials', () => {
179178
_it = it;
180179
}
181180
_it(`fails for ${testCred.title}`, async () => {
182-
const credential = klona(testCred.credential);
181+
const credential = structuredClone(
182+
registryEntryFile(testCred.credential));
183183
let error;
184184
let result;
185185
try {

test/mocha/assertions/issueWithOAuth2.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/*!
2-
* Copyright (c) 2020-2024 Digital Bazaar, Inc. All rights reserved.
2+
* Copyright (c) 2020-2025 Digital Bazaar, Inc. All rights reserved.
33
*/
44
import * as helpers from '../helpers.js';
55
import {agent} from '@bedrock/https-agent';
66
import {createRequire} from 'node:module';
77
import {httpClient} from '@digitalbazaar/http-client';
8-
import {klona} from 'klona';
98

109
const require = createRequire(import.meta.url);
1110

@@ -39,7 +38,7 @@ export function testIssueWithOAuth2({suiteName, algorithm, issueOptions}) {
3938
{capabilityAgent, zcaps, oauth2: true, suiteName});
4039
});
4140
it('issues a valid credential w/oauth2 w/root scope', async () => {
42-
const credential = klona(mockCredential);
41+
const credential = structuredClone(mockCredential);
4342
let error;
4443
let result;
4544
try {
@@ -73,7 +72,7 @@ export function testIssueWithOAuth2({suiteName, algorithm, issueOptions}) {
7372
});
7473
it('issues a valid credential w/oauth2 w/credentials scope',
7574
async () => {
76-
const credential = klona(mockCredential);
75+
const credential = structuredClone(mockCredential);
7776
let error;
7877
let result;
7978
try {
@@ -106,7 +105,7 @@ export function testIssueWithOAuth2({suiteName, algorithm, issueOptions}) {
106105
verifiableCredential.proof.should.be.an('object');
107106
});
108107
it('issues a valid credential w/oauth2 w/targeted scope', async () => {
109-
const credential = klona(mockCredential);
108+
const credential = structuredClone(mockCredential);
110109
let error;
111110
let result;
112111
try {
@@ -139,7 +138,7 @@ export function testIssueWithOAuth2({suiteName, algorithm, issueOptions}) {
139138
verifiableCredential.proof.should.be.an('object');
140139
});
141140
it('fails to issue a valid credential w/bad action scope', async () => {
142-
const credential = klona(mockCredential);
141+
const credential = structuredClone(mockCredential);
143142
let error;
144143
let result;
145144
try {
@@ -169,7 +168,7 @@ export function testIssueWithOAuth2({suiteName, algorithm, issueOptions}) {
169168
error.data.cause.details.claim.should.equal('scope');
170169
});
171170
it('fails to issue a valid credential w/bad path scope', async () => {
172-
const credential = klona(mockCredential);
171+
const credential = structuredClone(mockCredential);
173172
let error;
174173
let result;
175174
try {

0 commit comments

Comments
 (0)