Skip to content

Commit

Permalink
fix: Add valid context in jsonld
Browse files Browse the repository at this point in the history
  • Loading branch information
DaevMithran committed Oct 16, 2024
1 parent f71b537 commit 5eddabd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/controllers/api/credential.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export class CredentialController {
public async verify(request: Request, response: Response) {
// Get params from request
const { credential, policies } = request.body as VerifyCredentialRequestBody;
const { verifyStatus, allowDeactivatedDid } = request.query as VerifyCredentialRequestQuery;
const { verifyStatus, allowDeactivatedDid, fetchRemoteContexts } =
request.query as VerifyCredentialRequestQuery;

// Create credential object
const cheqdCredential = new CheqdW3CVerifiableCredential(credential);
Expand All @@ -275,6 +276,7 @@ export class CredentialController {
{
verifyStatus,
policies,
fetchRemoteContexts,
},
response.locals.customer
);
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/parallel/credential/issue-verify-flow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ test(' Issue a jsonLD credential with Ed25519VerificationKey2020', async ({ requ
expect(result.verified).toBe(true);
});

test.skip(' Issue a jsonLD credential with JsonWebKey2020', async ({ request }) => {
test(' Issue a jsonLD credential with JsonWebKey2020', async ({ request }) => {
const credentialData = JSON.parse(
fs.readFileSync(`${PAYLOADS_PATH.CREDENTIAL}/credential-issue-jsonld-jsonwebkey-2020.json`, 'utf-8')
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"issuerDid": "did:cheqd:testnet:11ceabbd-1fdc-46c0-a15d-534c07926d2b",
"subjectDid": "did:key:z6MkqJNR1DHxX2qxqDYx9tNDsXoNRVpaVvJkLPeCYqaARz1n",
"attributes": {
"nothing": "else matters"
"name": "Bob"
},
"@context": ["custom:example.context"],
"@context": ["https://www.w3.org/2018/credentials/v1", "https://veramo.io/contexts/profile/v1"],
"format": "jsonld"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"attributes": {
"name": "Bob"
},
"@context": ["https://www.w3.org/2018/credentials/v1"],
"@context": ["https://www.w3.org/2018/credentials/v1", "https://veramo.io/contexts/profile/v1"],
"format": "jsonld"
}

0 comments on commit 5eddabd

Please sign in to comment.