From 6ad2a90dbacf9f33502dc63e253fb7af10b2bb5d Mon Sep 17 00:00:00 2001 From: Fritz Ray Date: Fri, 22 Nov 2024 16:58:33 -0800 Subject: [PATCH 1/2] Release 1.5.70 --- src/com/eduworks/ec/promises/helpers.js | 12 ++++++++++++ src/org/cassproject/ebac/repository/EcRepository.js | 3 ++- src/test/EcRepository.l2.test.js | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/com/eduworks/ec/promises/helpers.js b/src/com/eduworks/ec/promises/helpers.js index 2cb48f4e..9ed78e1b 100644 --- a/src/com/eduworks/ec/promises/helpers.js +++ b/src/com/eduworks/ec/promises/helpers.js @@ -9,6 +9,18 @@ module.exports = { p = p.catch(failure); return p; }, + cassReturnNullAsPromise: function (success, failure, error) { + let p = new Promise((resolve, reject) => { + resolve(null); + }); + if (success !== undefined && success != null && failure !== undefined && failure != null) + p = p.then(success, failure); + else if (success !== undefined && success != null) + p = p.then(success); + else if (failure !== undefined && failure != null) + p = p.catch(failure); + return p; + }, cassReturnAsPromise: function (o, success, failure, error) { let p = new Promise((resolve, reject) => { if (o === undefined || o == null) { diff --git a/src/org/cassproject/ebac/repository/EcRepository.js b/src/org/cassproject/ebac/repository/EcRepository.js index 0fb5ea6e..2dcbbacb 100644 --- a/src/org/cassproject/ebac/repository/EcRepository.js +++ b/src/org/cassproject/ebac/repository/EcRepository.js @@ -8,12 +8,13 @@ const EcIdentityManager = require("../identity/EcIdentityManager"); const EcRekeyRequest = require("../identity/EcRekeyRequest"); const EcArray = require("../../../../com/eduworks/ec/array/EcArray"); const EcRemote = require("../../../../com/eduworks/ec/remote/EcRemote"); -const { cassPromisify, cassReturnAsPromise } = require("../../../../com/eduworks/ec/promises/helpers"); +const { cassPromisify, cassReturnAsPromise, cassReturnNullAsPromise } = require("../../../../com/eduworks/ec/promises/helpers"); const EcRemoteLinkedData = require("../../schema/general/EcRemoteLinkedData"); const EcCrypto = require("../../../../com/eduworks/ec/crypto/EcCrypto"); const EcIdentity = require("../identity/EcIdentity"); const EcPpkFacade = require("../../../../com/eduworks/ec/crypto/EcPpkFacade"); const EcPk = require("../../../../com/eduworks/ec/crypto/EcPk"); +const EcLinkedData = require("../../../json/ld/EcLinkedData.js"); require("../../general/AuditLogger.js") /** diff --git a/src/test/EcRepository.l2.test.js b/src/test/EcRepository.l2.test.js index 93b8f1f7..ca9ba8a0 100644 --- a/src/test/EcRepository.l2.test.js +++ b/src/test/EcRepository.l2.test.js @@ -14,6 +14,7 @@ const EcEncryptedValue = require('../org/cassproject/ebac/repository/EcEncrypted const EcIdentityManager = require('../org/cassproject/ebac/identity/EcIdentityManager.js'); const EcIdentity = require('../org/cassproject/ebac/identity/EcIdentity.js'); const EcPpk = require('../com/eduworks/ec/crypto/EcPpk.js'); +const EcLinkedData = require('../org/json/ld/EcLinkedData.js'); let hrtime = function () { try { From 5dc59783fa896150b7b8f0d9962cb184a9b521db Mon Sep 17 00:00:00 2001 From: Fritz Ray Date: Fri, 22 Nov 2024 17:10:43 -0800 Subject: [PATCH 2/2] Release 1.5.70 --- src/test/skyId.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/test/skyId.test.js b/src/test/skyId.test.js index f87f9ae9..d460c111 100644 --- a/src/test/skyId.test.js +++ b/src/test/skyId.test.js @@ -14,10 +14,13 @@ describe('SkyID Adapter', function() { let newPassword = EcAes.newSecret(6); let name = 'Test User'; let ident = null; + if ((typeof Cypress !== 'undefined') && Cypress != null && Cypress.env != null) + process.env.CASS_LOOPBACK = Cypress.env('CASS_LOOPBACK'); + console.log(process.env.CASS_LOOPBACK); it('create user', async () => { let rld = new EcRemoteIdentityManager(); - rld.server = 'http://localhost/api/'; + rld.server = process.env.CASS_LOOPBACK || 'http://localhost/api/'; await rld.configureFromServer(null, null); rld.startLogin(username, password); let im = new EcIdentityManager(); @@ -32,7 +35,7 @@ describe('SkyID Adapter', function() { it('change password', async () => { let rld = new EcRemoteIdentityManager(); - rld.server = 'http://localhost/api/'; + rld.server = process.env.CASS_LOOPBACK || 'http://localhost/api/'; await rld.configureFromServer(null, null); rld.startLogin(username, password); let im = await rld.fetch(); @@ -43,7 +46,7 @@ describe('SkyID Adapter', function() { it('load user', async () => { let rld = new EcRemoteIdentityManager(); - rld.server = 'http://localhost/api/'; + rld.server = process.env.CASS_LOOPBACK || 'http://localhost/api/'; await rld.configureFromServer(null, null); rld.startLogin(username, newPassword); let im = await rld.fetch();