Skip to content

Commit

Permalink
change VC ids to urns that work with status list
Browse files Browse the repository at this point in the history
  • Loading branch information
jchartrand committed Sep 12, 2024
1 parent 39d9112 commit d1a3e59
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,5 @@ build
.DS_Store

# End of https://www.toptal.com/developers/gitignore/api/node,visualstudiocode

compose-test.yaml
2 changes: 1 addition & 1 deletion src/endpoints/getCredentialLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions src/endpoints/revokeCredential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' }],
}),
});
Expand Down

0 comments on commit d1a3e59

Please sign in to comment.