From d1a3e598b715217a10af1610533089ad34339f77 Mon Sep 17 00:00:00 2001 From: James Chartrand Date: Thu, 12 Sep 2024 14:03:23 -0400 Subject: [PATCH] change VC ids to urns that work with status list --- .DS_Store | Bin 8196 -> 8196 bytes .gitignore | 2 ++ src/endpoints/getCredentialLinks.ts | 2 +- src/endpoints/revokeCredential.ts | 6 +++--- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.DS_Store b/.DS_Store index 8bf6fad886e11b52321342b3277c0de53f161974..4b0b844364a1f72c6942476f0bf5356c3ebb5621 100644 GIT binary patch delta 45 zcmV+|0Mh@2K!iY$PXQ9KP`eKS60-~tPy&;V64sLz6m*li6rr<648Q}k2N?GRv3Ujq DVL}go delta 235 zcmZp1XmOa}&nUhzU^hRb_+}n~048BhhD?TBhD3&RhExVUh608>hV;oh1mq{j2wn5# z0P+(Vk{Pn0^2MGx`N>H+`AG~63<3-c%+5es?>`s-Squz(VEqL^^K=<<81lh7^%yFF zx^o$FCQAv(s|zEkC*Hypjn3d_OwW diff --git a/.gitignore b/.gitignore index bafb6d2..9c86ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -168,3 +168,5 @@ build .DS_Store # End of https://www.toptal.com/developers/gitignore/api/node,visualstudiocode + +compose-test.yaml \ No newline at end of file diff --git a/src/endpoints/getCredentialLinks.ts b/src/endpoints/getCredentialLinks.ts index 98032a1..33e1d5a 100644 --- a/src/endpoints/getCredentialLinks.ts +++ b/src/endpoints/getCredentialLinks.ts @@ -49,7 +49,7 @@ export const getCredentialLinks: PayloadHandler = async (req, res) => { ) as any as UnsignedVC; // Prep for sending to signing service - builtCredential.id = id; + builtCredential.id = `urn:uuid:${id}`; if (typeof builtCredential?.issuer === 'string') builtCredential.issuer = {}; if ('id' in (builtCredential?.issuer ?? {})) delete builtCredential.issuer.id; diff --git a/src/endpoints/revokeCredential.ts b/src/endpoints/revokeCredential.ts index 6aac6b6..5d35b0a 100644 --- a/src/endpoints/revokeCredential.ts +++ b/src/endpoints/revokeCredential.ts @@ -10,13 +10,13 @@ export const revokeCredential: PayloadHandler = async (req, res) => { const { id } = req.params; const { reason } = req.body; - + const credentialId = `urn:uuid:${id}` try { - const fetchResponse = await fetch(`${coordinatorUrl}/instance/:tenantName/credentials/status`, { + const fetchResponse = await fetch(`${coordinatorUrl}/instance/${tenantName}/credentials/status`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ - credentialId: id, + credentialId, credentialStatus: [{ type: 'BitstringStatusListCredential', status: 'revoked' }], }), });