From 620a888bea3fbfad74e55a7c18d3575bf1cf26ef Mon Sep 17 00:00:00 2001 From: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:48:37 -0400 Subject: [PATCH 1/2] Allow for objects in context --- tests/10-issuer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/10-issuer.js b/tests/10-issuer.js index 3c69ccf..af42002 100644 --- a/tests/10-issuer.js +++ b/tests/10-issuer.js @@ -74,13 +74,13 @@ describe('Issue Credential - Data Integrity', function() { const {result, error} = await issuer.post({json: body}); shouldThrowInvalidInput({result, error}); }); - it('credential "@context" items MUST be strings.', async function() { + it('credential "@context" items MUST be strings or objects.', async function() { this.test.cell = { columnId: name, rowId: this.test.title }; const body = createRequestBody({issuer}); - const invalidContextTypes = [{foo: true}, 4, false, null]; + const invalidContextTypes = [4, false, null, []]; for(const invalidContextType of invalidContextTypes) { body.credential['@context'] = invalidContextType; const {result, error} = await issuer.post({json: {...body}}); From 4afcf222a1456aeaf99330542b7cc794d61a4079 Mon Sep 17 00:00:00 2001 From: Patrick St-Louis <43082425+PatStLouis@users.noreply.github.com> Date: Tue, 30 Apr 2024 12:49:31 -0400 Subject: [PATCH 2/2] Update 11-issuer-jwt.js --- tests/11-issuer-jwt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/11-issuer-jwt.js b/tests/11-issuer-jwt.js index c76bc15..95d650b 100644 --- a/tests/11-issuer-jwt.js +++ b/tests/11-issuer-jwt.js @@ -71,13 +71,13 @@ describe('Issue Credential - JWT', function() { const {result, error} = await issuer.post({json: body}); shouldThrowInvalidInput({result, error}); }); - it('credential "@context" items MUST be strings.', async function() { + it('credential "@context" items MUST be strings or objects.', async function() { this.test.cell = { columnId: name, rowId: this.test.title }; const body = createRequestBody({issuer}); - const invalidContextTypes = [{foo: true}, 4, false, null]; + const invalidContextTypes = [4, false, null, []]; for(const invalidContextType of invalidContextTypes) { body.credential['@context'] = invalidContextType; const {result, error} = await issuer.post({json: {...body}});