From a763c767e0319b4046781d31faa1009a837dfc26 Mon Sep 17 00:00:00 2001 From: Dave Longley Date: Sat, 24 Feb 2024 00:03:15 -0500 Subject: [PATCH] Fix `BitstringStatusList` support. --- lib/issue.js | 2 +- lib/slcs.js | 4 ++-- test/mocha/20-status.js | 4 +--- test/package.json | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/issue.js b/lib/issue.js index a135a39..04ddf90 100644 --- a/lib/issue.js +++ b/lib/issue.js @@ -18,7 +18,7 @@ export async function issue({config, credential, updateValidity = true} = {}) { credential.expirationDate = validUntil; } else { credential.validFrom = validFrom; - credential.validFrom = validFrom; + credential.validUntil = validUntil; } // delete existing proof diff --git a/lib/slcs.js b/lib/slcs.js index 58f4735..e5693d9 100644 --- a/lib/slcs.js +++ b/lib/slcs.js @@ -211,8 +211,8 @@ export async function getFresh({config, statusListId} = {}) { return {credential: record.credential}; } // refresh SLC - const doc = await refresh({config, statusListId}); - return {credential: doc.content}; + const {credential} = await refresh({config, statusListId}); + return {credential}; } /** diff --git a/test/mocha/20-status.js b/test/mocha/20-status.js index 4f055fe..79ac629 100644 --- a/test/mocha/20-status.js +++ b/test/mocha/20-status.js @@ -26,9 +26,7 @@ describe('status APIs', () => { `urn:zcap:root:${encodeURIComponent(statusInstanceId)}`; }); describe('/status-lists', () => { - // FIXME: enable `BitstringStatusList` tests once br-vc-status-list is - // updated and imported by bedrock-vc-issuer - it.only('creates a "StatusList2021" status list', async () => { + it('creates a "StatusList2021" status list', async () => { const statusListId = `${statusInstanceId}/status-lists/${uuid()}`; const statusListOptions = { credentialId: statusListId, diff --git a/test/package.json b/test/package.json index 7c1fa8b..639c048 100644 --- a/test/package.json +++ b/test/package.json @@ -13,7 +13,7 @@ "dependencies": { "@bedrock/app-identity": "^4.0.0", "@bedrock/core": "^6.0.1", - "@bedrock/credentials-context": "^4.0.0", + "@bedrock/credentials-context": "digitalbazaar/bedrock-credentials-context#update-vc-2.0", "@bedrock/data-integrity-context": "^3.0.0", "@bedrock/did-context": "^5.0.0", "@bedrock/did-io": "^10.1.0",