diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 9adbdf9..5ad9460 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,7 +1,7 @@ module.exports = { - "env": { - "node": true, - "mocha": true + env: { + node: true, + mocha: true }, extends: [ 'standard' diff --git a/package.json b/package.json index 755f194..76587cb 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "start": "node -r dotenv/config server.js", "dev": "nodemon -r dotenv/config server.js", "dev-noenv": "nodemon server.js", - "lint": "eslint . --ext .js", - "lint-fix": "eslint --fix . --ext .js", + "lint": "eslint . --ext .js", + "lint-fix": "eslint --fix . --ext .js", "test": "NODE_OPTIONS=--experimental-vm-modules npx mocha --timeout 10000 -r dotenv/config dotenv_config_path=src/test-fixtures/.env.testing src/app.test.js " }, "dependencies": { diff --git a/src/app.js b/src/app.js index dbde463..01f441d 100644 --- a/src/app.js +++ b/src/app.js @@ -9,7 +9,7 @@ import verifyAuthHeader from './verifyAuthHeader.js' import { getConfig } from './config.js' class IssuingException extends Error { - constructor(code, message, error = null) { + constructor (code, message, error = null) { super(message) this.code = code this.error = error diff --git a/src/test-fixtures/nocks/protected_status_signing.js b/src/test-fixtures/nocks/protected_status_signing.js index a912e9f..8616393 100644 --- a/src/test-fixtures/nocks/protected_status_signing.js +++ b/src/test-fixtures/nocks/protected_status_signing.js @@ -1,152 +1,152 @@ -import nock from 'nock'; +import nock from 'nock' const signedVcWithStatus = { - "@context": [ - "https://www.w3.org/ns/credentials/v2", - "https://purl.imsglobal.org/spec/ob/v3p0/context.json", - "https://w3id.org/security/suites/ed25519-2020/v1" + '@context': [ + 'https://www.w3.org/ns/credentials/v2', + 'https://purl.imsglobal.org/spec/ob/v3p0/context.json', + 'https://w3id.org/security/suites/ed25519-2020/v1' ], - "type": [ - "VerifiableCredential", - "OpenBadgeCredential" + type: [ + 'VerifiableCredential', + 'OpenBadgeCredential' ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "name": "Introduction to Computer Science - CS50x", - "issuer": { - "description": "Gordon McKay Professor of the Practice of Computer Science, Harvard University", - "id": "did:key:z6MkrDLfZytHX5acEFds6wAYJbvMbT9UuhKhub4qaguDESCF", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - }, - "name": "Dr David Malan", - "type": "Profile", - "url": "https://cs.harvard.edu/malan/" + id: 'urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1', + name: 'Introduction to Computer Science - CS50x', + issuer: { + description: 'Gordon McKay Professor of the Practice of Computer Science, Harvard University', + id: 'did:key:z6MkrDLfZytHX5acEFds6wAYJbvMbT9UuhKhub4qaguDESCF', + image: { + id: 'https://certificates.cs50.io/static/success.jpg', + type: 'Image' + }, + name: 'Dr David Malan', + type: 'Profile', + url: 'https://cs.harvard.edu/malan/' }, - "validFrom": "2020-01-01T00:00:00Z", - "credentialSubject": { - "achievement": { - "criteria": { - "narrative": "Completion of CS50X, including ten problem sets, ten labs, and one final project." - }, - "description": "CS50 congratulates on completion of CS50x.", - "id": "http://cs50.harvard.edu", - "name": "Introduction to Computer Science - CS50x", - "type": "Achievement" - }, - "identifier": { - "hashed": "false", - "identityHash": "jc.chartrand@gmail.com", - "type": "IdentityObject" + validFrom: '2020-01-01T00:00:00Z', + credentialSubject: { + achievement: { + criteria: { + narrative: 'Completion of CS50X, including ten problem sets, ten labs, and one final project.' }, - "type": "AchievementSubject" + description: 'CS50 congratulates on completion of CS50x.', + id: 'http://cs50.harvard.edu', + name: 'Introduction to Computer Science - CS50x', + type: 'Achievement' + }, + identifier: { + hashed: 'false', + identityHash: 'jc.chartrand@gmail.com', + type: 'IdentityObject' + }, + type: 'AchievementSubject' }, - "credentialStatus": { - "id": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1", - "statusListCredential": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB", - "statusListIndex": 1, - "statusPurpose": "revocation", - "type": "BitstringStatusListEntry" + credentialStatus: { + id: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1', + statusListCredential: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB', + statusListIndex: 1, + statusPurpose: 'revocation', + type: 'BitstringStatusListEntry' }, - "proof": { - "created": "2023-08-23T12:44:15Z", - "proofPurpose": "assertionMethod", - "proofValue": "z5QQ12zr5JvEsKvbnEN2EYZ6punR6Pa5wMJzywGJ2dCh6SSA5oQb9hBiGADsNTbs57bopArwdBHE9kEVemMxcu1Fq", - "type": "Ed25519Signature2020", - "verificationMethod": "did:key:z6MkrDLfZytHX5acEFds6wAYJbvMbT9UuhKhub4qaguDESCF#z6MkrDLfZytHX5acEFds6wAYJbvMbT9UuhKhub4qaguDESCF" + proof: { + created: '2023-08-23T12:44:15Z', + proofPurpose: 'assertionMethod', + proofValue: 'z5QQ12zr5JvEsKvbnEN2EYZ6punR6Pa5wMJzywGJ2dCh6SSA5oQb9hBiGADsNTbs57bopArwdBHE9kEVemMxcu1Fq', + type: 'Ed25519Signature2020', + verificationMethod: 'did:key:z6MkrDLfZytHX5acEFds6wAYJbvMbT9UuhKhub4qaguDESCF#z6MkrDLfZytHX5acEFds6wAYJbvMbT9UuhKhub4qaguDESCF' } -}; +} const unsignedVcWithoutStatus = { - "@context": [ - "https://www.w3.org/ns/credentials/v2", - "https://purl.imsglobal.org/spec/ob/v3p0/context.json" + '@context': [ + 'https://www.w3.org/ns/credentials/v2', + 'https://purl.imsglobal.org/spec/ob/v3p0/context.json' ], - "type": [ - "VerifiableCredential", - "OpenBadgeCredential" + type: [ + 'VerifiableCredential', + 'OpenBadgeCredential' ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "name": "Introduction to Computer Science - CS50x", - "issuer": { - "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", - "type": "Profile", - "name": "Dr David Malan", - "description": "Gordon McKay Professor of the Practice of Computer Science, Harvard University", - "url": "https://cs.harvard.edu/malan/", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + id: 'urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1', + name: 'Introduction to Computer Science - CS50x', + issuer: { + id: 'did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC', + type: 'Profile', + name: 'Dr David Malan', + description: 'Gordon McKay Professor of the Practice of Computer Science, Harvard University', + url: 'https://cs.harvard.edu/malan/', + image: { + id: 'https://certificates.cs50.io/static/success.jpg', + type: 'Image' + } }, - "validFrom": "2020-01-01T00:00:00Z", - "credentialSubject": { - "type": "AchievementSubject", - "identifier": { - "type": "IdentityObject", - "identityHash": "jc.chartrand@gmail.com", - "hashed": "false" + validFrom: '2020-01-01T00:00:00Z', + credentialSubject: { + type: 'AchievementSubject', + identifier: { + type: 'IdentityObject', + identityHash: 'jc.chartrand@gmail.com', + hashed: 'false' + }, + achievement: { + id: 'http://cs50.harvard.edu', + type: 'Achievement', + criteria: { + narrative: 'Completion of CS50X, including ten problem sets, ten labs, and one final project.' }, - "achievement": { - "id": "http://cs50.harvard.edu", - "type": "Achievement", - "criteria": { - "narrative": "Completion of CS50X, including ten problem sets, ten labs, and one final project." - }, - "description": "CS50 congratulates on completion of CS50x.", - "name": "Introduction to Computer Science - CS50x" - } + description: 'CS50 congratulates on completion of CS50x.', + name: 'Introduction to Computer Science - CS50x' + } } -}; +} const unsignedVcWithStatus = { - "@context": [ - "https://www.w3.org/ns/credentials/v2", - "https://purl.imsglobal.org/spec/ob/v3p0/context.json" + '@context': [ + 'https://www.w3.org/ns/credentials/v2', + 'https://purl.imsglobal.org/spec/ob/v3p0/context.json' ], - "type": [ - "VerifiableCredential", - "OpenBadgeCredential" + type: [ + 'VerifiableCredential', + 'OpenBadgeCredential' ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "name": "Introduction to Computer Science - CS50x", - "issuer": { - "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", - "type": "Profile", - "name": "Dr David Malan", - "description": "Gordon McKay Professor of the Practice of Computer Science, Harvard University", - "url": "https://cs.harvard.edu/malan/", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + id: 'urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1', + name: 'Introduction to Computer Science - CS50x', + issuer: { + id: 'did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC', + type: 'Profile', + name: 'Dr David Malan', + description: 'Gordon McKay Professor of the Practice of Computer Science, Harvard University', + url: 'https://cs.harvard.edu/malan/', + image: { + id: 'https://certificates.cs50.io/static/success.jpg', + type: 'Image' + } }, - "validFrom": "2020-01-01T00:00:00Z", - "credentialSubject": { - "type": "AchievementSubject", - "identifier": { - "type": "IdentityObject", - "identityHash": "jc.chartrand@gmail.com", - "hashed": "false" + validFrom: '2020-01-01T00:00:00Z', + credentialSubject: { + type: 'AchievementSubject', + identifier: { + type: 'IdentityObject', + identityHash: 'jc.chartrand@gmail.com', + hashed: 'false' + }, + achievement: { + id: 'http://cs50.harvard.edu', + type: 'Achievement', + criteria: { + narrative: 'Completion of CS50X, including ten problem sets, ten labs, and one final project.' }, - "achievement": { - "id": "http://cs50.harvard.edu", - "type": "Achievement", - "criteria": { - "narrative": "Completion of CS50X, including ten problem sets, ten labs, and one final project." - }, - "description": "CS50 congratulates on completion of CS50x.", - "name": "Introduction to Computer Science - CS50x" - } + description: 'CS50 congratulates on completion of CS50x.', + name: 'Introduction to Computer Science - CS50x' + } }, - "credentialStatus": { - "id": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1", - "type": "BitstringStatusListEntry", - "statusPurpose": "revocation", - "statusListIndex": 1, - "statusListCredential": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB" + credentialStatus: { + id: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1', + type: 'BitstringStatusListEntry', + statusPurpose: 'revocation', + statusListIndex: 1, + statusListCredential: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB' } -}; +} export default () => { nock('http://localhost:4008', { encodedQueryParams: true }) @@ -168,7 +168,7 @@ export default () => { 'keep-alive', 'Keep-Alive', 'timeout=5' - ]); + ]) nock('http://localhost:4006', { encodedQueryParams: true }) .post('/instance/protected_test/credentials/sign', unsignedVcWithStatus) @@ -189,24 +189,24 @@ export default () => { 'keep-alive', 'Keep-Alive', 'timeout=5' - ]); + ]) - /* nock('http://127.0.0.1:55225', { encodedQueryParams: true }) - .post('/instance/un_protected_test/credentials/issue', unsignedVcWithoutStatus) - .reply(200, signedVcWithStatus, [ - 'X-Powered-By', - 'Express', - 'Access-Control-Allow-Origin', - '*', - 'Content-Type', - 'application/json; charset=utf-8', - 'Content-Length', - '1810', - 'ETag', - 'W/"712-fUBsd5PM46QPKrivsShMP8gvwtc"', - 'Date', - 'Tue, 22 Aug 2023 20:11:09 GMT', - 'Connection', - 'close' - ]); */ -}; + /* nock('http://127.0.0.1:55225', { encodedQueryParams: true }) + .post('/instance/un_protected_test/credentials/issue', unsignedVcWithoutStatus) + .reply(200, signedVcWithStatus, [ + 'X-Powered-By', + 'Express', + 'Access-Control-Allow-Origin', + '*', + 'Content-Type', + 'application/json; charset=utf-8', + 'Content-Length', + '1810', + 'ETag', + 'W/"712-fUBsd5PM46QPKrivsShMP8gvwtc"', + 'Date', + 'Tue, 22 Aug 2023 20:11:09 GMT', + 'Connection', + 'close' + ]) */ +} diff --git a/src/test-fixtures/nocks/unprotected_status_signing.js b/src/test-fixtures/nocks/unprotected_status_signing.js index 4c642e6..9b50bd6 100644 --- a/src/test-fixtures/nocks/unprotected_status_signing.js +++ b/src/test-fixtures/nocks/unprotected_status_signing.js @@ -1,152 +1,152 @@ -import nock from 'nock'; +import nock from 'nock' const signedVcWithStatus = { - "@context": [ - "https://www.w3.org/ns/credentials/v2", - "https://purl.imsglobal.org/spec/ob/v3p0/context.json", - "https://w3id.org/security/suites/ed25519-2020/v1" + '@context': [ + 'https://www.w3.org/ns/credentials/v2', + 'https://purl.imsglobal.org/spec/ob/v3p0/context.json', + 'https://w3id.org/security/suites/ed25519-2020/v1' ], - "type": [ - "VerifiableCredential", - "OpenBadgeCredential" + type: [ + 'VerifiableCredential', + 'OpenBadgeCredential' ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "name": "Introduction to Computer Science - CS50x", - "issuer": { - "id": "did:key:z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy", - "type": "Profile", - "name": "Dr David Malan", - "description": "Gordon McKay Professor of the Practice of Computer Science, Harvard University", - "url": "https://cs.harvard.edu/malan/", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + id: 'urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1', + name: 'Introduction to Computer Science - CS50x', + issuer: { + id: 'did:key:z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy', + type: 'Profile', + name: 'Dr David Malan', + description: 'Gordon McKay Professor of the Practice of Computer Science, Harvard University', + url: 'https://cs.harvard.edu/malan/', + image: { + id: 'https://certificates.cs50.io/static/success.jpg', + type: 'Image' + } }, - "validFrom": "2020-01-01T00:00:00Z", - "credentialSubject": { - "type": "AchievementSubject", - "identifier": { - "type": "IdentityObject", - "identityHash": "jc.chartrand@gmail.com", - "hashed": "false" + validFrom: '2020-01-01T00:00:00Z', + credentialSubject: { + type: 'AchievementSubject', + identifier: { + type: 'IdentityObject', + identityHash: 'jc.chartrand@gmail.com', + hashed: 'false' + }, + achievement: { + id: 'http://cs50.harvard.edu', + type: 'Achievement', + criteria: { + narrative: 'Completion of CS50X, including ten problem sets, ten labs, and one final project.' }, - "achievement": { - "id": "http://cs50.harvard.edu", - "type": "Achievement", - "criteria": { - "narrative": "Completion of CS50X, including ten problem sets, ten labs, and one final project." - }, - "description": "CS50 congratulates on completion of CS50x.", - "name": "Introduction to Computer Science - CS50x" - } + description: 'CS50 congratulates on completion of CS50x.', + name: 'Introduction to Computer Science - CS50x' + } }, - "credentialStatus": { - "id": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1", - "type": "BitstringStatusListEntry", - "statusPurpose": "revocation", - "statusListIndex": 1, - "statusListCredential": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB" + credentialStatus: { + id: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1', + type: 'BitstringStatusListEntry', + statusPurpose: 'revocation', + statusListIndex: 1, + statusListCredential: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB' }, - "proof": { - "type": "Ed25519Signature2020", - "created": "2023-08-22T20:11:09Z", - "verificationMethod": "did:key:z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy#z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy", - "proofPurpose": "assertionMethod", - "proofValue": "z51uH32BFx2mNntaGE55MeHwespoAjetxDkTHBMKtbgGDdc5XiGSTaEGrRgANtT8DV5a6rTNnhT8FKRD4oVnhnxtG" + proof: { + type: 'Ed25519Signature2020', + created: '2023-08-22T20:11:09Z', + verificationMethod: 'did:key:z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy#z6Mkf2rgv7ef8FmLJ5Py87LMa7nofQgv6AstdkgsXiiCUJEy', + proofPurpose: 'assertionMethod', + proofValue: 'z51uH32BFx2mNntaGE55MeHwespoAjetxDkTHBMKtbgGDdc5XiGSTaEGrRgANtT8DV5a6rTNnhT8FKRD4oVnhnxtG' } -}; +} const unsignedVcWithoutStatus = { - "@context": [ - "https://www.w3.org/ns/credentials/v2", - "https://purl.imsglobal.org/spec/ob/v3p0/context.json" + '@context': [ + 'https://www.w3.org/ns/credentials/v2', + 'https://purl.imsglobal.org/spec/ob/v3p0/context.json' ], - "type": [ - "VerifiableCredential", - "OpenBadgeCredential" + type: [ + 'VerifiableCredential', + 'OpenBadgeCredential' ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "name": "Introduction to Computer Science - CS50x", - "issuer": { - "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", - "type": "Profile", - "name": "Dr David Malan", - "description": "Gordon McKay Professor of the Practice of Computer Science, Harvard University", - "url": "https://cs.harvard.edu/malan/", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + id: 'urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1', + name: 'Introduction to Computer Science - CS50x', + issuer: { + id: 'did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC', + type: 'Profile', + name: 'Dr David Malan', + description: 'Gordon McKay Professor of the Practice of Computer Science, Harvard University', + url: 'https://cs.harvard.edu/malan/', + image: { + id: 'https://certificates.cs50.io/static/success.jpg', + type: 'Image' + } }, - "validFrom": "2020-01-01T00:00:00Z", - "credentialSubject": { - "type": "AchievementSubject", - "identifier": { - "type": "IdentityObject", - "identityHash": "jc.chartrand@gmail.com", - "hashed": "false" + validFrom: '2020-01-01T00:00:00Z', + credentialSubject: { + type: 'AchievementSubject', + identifier: { + type: 'IdentityObject', + identityHash: 'jc.chartrand@gmail.com', + hashed: 'false' + }, + achievement: { + id: 'http://cs50.harvard.edu', + type: 'Achievement', + criteria: { + narrative: 'Completion of CS50X, including ten problem sets, ten labs, and one final project.' }, - "achievement": { - "id": "http://cs50.harvard.edu", - "type": "Achievement", - "criteria": { - "narrative": "Completion of CS50X, including ten problem sets, ten labs, and one final project." - }, - "description": "CS50 congratulates on completion of CS50x.", - "name": "Introduction to Computer Science - CS50x" - } + description: 'CS50 congratulates on completion of CS50x.', + name: 'Introduction to Computer Science - CS50x' + } } -}; +} const unsignedVcWithStatus = { - "@context": [ - "https://www.w3.org/ns/credentials/v2", - "https://purl.imsglobal.org/spec/ob/v3p0/context.json" + '@context': [ + 'https://www.w3.org/ns/credentials/v2', + 'https://purl.imsglobal.org/spec/ob/v3p0/context.json' ], - "type": [ - "VerifiableCredential", - "OpenBadgeCredential" + type: [ + 'VerifiableCredential', + 'OpenBadgeCredential' ], - "id": "urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1", - "name": "Introduction to Computer Science - CS50x", - "issuer": { - "id": "did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC", - "type": "Profile", - "name": "Dr David Malan", - "description": "Gordon McKay Professor of the Practice of Computer Science, Harvard University", - "url": "https://cs.harvard.edu/malan/", - "image": { - "id": "https://certificates.cs50.io/static/success.jpg", - "type": "Image" - } + id: 'urn:uuid:951b475e-b795-43bc-ba8f-a2d01efd2eb1', + name: 'Introduction to Computer Science - CS50x', + issuer: { + id: 'did:key:z6MkhVTX9BF3NGYX6cc7jWpbNnR7cAjH8LUffabZP8Qu4ysC', + type: 'Profile', + name: 'Dr David Malan', + description: 'Gordon McKay Professor of the Practice of Computer Science, Harvard University', + url: 'https://cs.harvard.edu/malan/', + image: { + id: 'https://certificates.cs50.io/static/success.jpg', + type: 'Image' + } }, - "validFrom": "2020-01-01T00:00:00Z", - "credentialSubject": { - "type": "AchievementSubject", - "identifier": { - "type": "IdentityObject", - "identityHash": "jc.chartrand@gmail.com", - "hashed": "false" + validFrom: '2020-01-01T00:00:00Z', + credentialSubject: { + type: 'AchievementSubject', + identifier: { + type: 'IdentityObject', + identityHash: 'jc.chartrand@gmail.com', + hashed: 'false' + }, + achievement: { + id: 'http://cs50.harvard.edu', + type: 'Achievement', + criteria: { + narrative: 'Completion of CS50X, including ten problem sets, ten labs, and one final project.' }, - "achievement": { - "id": "http://cs50.harvard.edu", - "type": "Achievement", - "criteria": { - "narrative": "Completion of CS50X, including ten problem sets, ten labs, and one final project." - }, - "description": "CS50 congratulates on completion of CS50x.", - "name": "Introduction to Computer Science - CS50x" - } + description: 'CS50 congratulates on completion of CS50x.', + name: 'Introduction to Computer Science - CS50x' + } }, - "credentialStatus": { - "id": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1", - "type": "BitstringStatusListEntry", - "statusPurpose": "revocation", - "statusListIndex": 1, - "statusListCredential": "https://jchartrand.github.io/status-test-three/DKSPRCX9WB" + credentialStatus: { + id: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB#1', + type: 'BitstringStatusListEntry', + statusPurpose: 'revocation', + statusListIndex: 1, + statusListCredential: 'https://jchartrand.github.io/status-test-three/DKSPRCX9WB' } -}; +} export default () => { nock('http://localhost:4006', { encodedQueryParams: true }) @@ -168,7 +168,7 @@ export default () => { 'keep-alive', 'Keep-Alive', 'timeout=5' - ]); + ]) nock('http://localhost:4008', { encodedQueryParams: true }) .post('/credentials/status/allocate', unsignedVcWithoutStatus) .reply(200, unsignedVcWithStatus, [ @@ -188,7 +188,7 @@ export default () => { 'keep-alive', 'Keep-Alive', 'timeout=5' - ]); + ]) /* nock('http://127.0.0.1:55225', { encodedQueryParams: true }) .post('/instance/un_protected_test/credentials/issue', unsignedVcWithoutStatus) @@ -207,8 +207,8 @@ export default () => { 'Tue, 22 Aug 2023 20:11:09 GMT', 'Connection', 'close' - ]); */ -}; + ]) */ +} /* export default () => { nock('http://localhost:4006', { encodedQueryParams: true }) @@ -230,5 +230,5 @@ export default () => { 'keep-alive', 'Keep-Alive', 'timeout=5' - ]); -}; */ + ]) +} */ diff --git a/src/test-fixtures/vc.js b/src/test-fixtures/vc.js index c1918c3..94689a3 100644 --- a/src/test-fixtures/vc.js +++ b/src/test-fixtures/vc.js @@ -72,4 +72,4 @@ export { getUnsignedVCWithoutSuiteContext, getCredentialStatus, getUnsignedVCWithStatus -}; +}