From 0334cf52085d5fd97d64d0fb5e0668187dd7c0fb Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Fri, 17 May 2024 10:23:02 +0300 Subject: [PATCH 01/10] cleanup and bug fixing for my account page --- .../my-account-page/my-account-page.html | 6 --- .../pages/my-account-page/my-account-page.js | 45 +++---------------- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.html b/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.html index ef777d9a..bde92011 100644 --- a/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.html +++ b/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.html @@ -16,12 +16,6 @@ -
- -
-

Wallet settings: (build version - $$appVersion)

diff --git a/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.js b/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.js index f3977c6f..5961f212 100644 --- a/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.js +++ b/apihub-root/dsu-fabric/web-components/pages/my-account-page/my-account-page.js @@ -1,14 +1,17 @@ -import constants from "../../../constants.js"; import {changeSidebarFromURL, copyToClipboard} from "../../../utils/utils.js"; const openDSU = require("opendsu"); const config = openDSU.loadAPI("config"); -const credentialsAPI = openDSU.loadAPI("credentials"); const scAPI = openDSU.loadAPI("sc"); export class MyAccountPage { constructor(element, invalidate) { this.invalidate = invalidate; + + this.did = ""; + this.envData = {"in-progress": "Environment data is being read..."}; + this.appVersion = "version data is loading..."; + this.invalidate(async () => { await this.fetchAccountData(); }); @@ -19,7 +22,6 @@ export class MyAccountPage { afterRender() { changeSidebarFromURL(); - this.renderCredentialContainer(this.credential && this.readableCredential); this.renderSettingsContainer(); } @@ -78,28 +80,6 @@ export class MyAccountPage { return version; } - renderCredentialContainer(validCredential) { - if (!validCredential) { - try{ - document.querySelector('.invalid-credential').classList.toggle("hidden"); - }catch(err){ - console.log(err); - } - return - } - const readableContainer = document.querySelector('#readableContainer'); - let readableCredentialElement = readableContainer.querySelector('#readableCredential'); - if (readableCredentialElement) { - readableCredentialElement.remove(); - } - - readableCredentialElement = document.createElement('div'); - readableCredentialElement.id = "readableCredential"; - readableCredentialElement.language = "json"; - readableCredentialElement.innerHTML = `
 ${this.readableCredential} 
`; - readableContainer.appendChild(readableCredentialElement); - } - renderSettingsContainer() { const environmentContainer = document.querySelector('#environmentContainer'); let environmentDataElement = environmentContainer.querySelector('#environmentData'); @@ -116,19 +96,8 @@ export class MyAccountPage { async fetchAccountData() { try { - let mainEnclave = await scAPI.getMainEnclave(); let did = await scAPI.getMainDIDAsync(); this.did = did; - this.credential = await $$.promisify(mainEnclave.readKey)(constants.CREDENTIAL_KEY); - if (this.credential) { - try { - let jwtContent = await $$.promisify(credentialsAPI.parseJWTSegments)(this.credential.token) - const {jwtHeader, jwtPayload} = jwtContent; - this.readableCredential = JSON.stringify({jwtHeader, jwtPayload}, null, 4); - } catch (e) { - this.readableCredential = null; - } - } let envFile = await $$.promisify(config.readEnvFile)(); //hide keySSI properties from display in ui @@ -140,11 +109,9 @@ export class MyAccountPage { const response = await fetch(environmentJsPath); const appEnvContent = await response.text(); this.envData = envFile; - this.appVersion = this.getAppBuildVersion(appEnvContent) + this.appVersion = this.getAppBuildVersion(appEnvContent); } catch (err) { webSkel.notificationHandler.reportUserRelevantError("Failed to get wallet data", err); } - - } } From 33f67a9598f2c55edfdc86136a1e17f955388460 Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Fri, 17 May 2024 10:26:15 +0300 Subject: [PATCH 02/10] Update octopus-freeze.json --- octopus-freeze.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octopus-freeze.json b/octopus-freeze.json index 20e6803c..fc6ce058 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -1,4 +1,4 @@ -{ +{ "workDir": ".", "dependencies": [ { From 702f8fa891e1f1e433b710b1e4526395d7f7faac Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Fri, 17 May 2024 16:27:47 +0300 Subject: [PATCH 03/10] Update octopus-freeze.json --- octopus-freeze.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octopus-freeze.json b/octopus-freeze.json index fc6ce058..6a70711e 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -26,8 +26,8 @@ "type": "smartClone", "target": ".", "collectLog": false, - "commit": "e4d54ab64a8af71cb0d8d4cd34d7b97a47165cdf", - "tag": "v2.0.8" + "commit": "b6af25151f8689b57c2702c7ca8f0e9d2d906f81", + "tag": "v2.0.9" }, { "type": "execute", From d9341ef63b3b28f019c443f704a81bfbf4bcdf13 Mon Sep 17 00:00:00 2001 From: skutner Date: Mon, 20 May 2024 09:26:09 +0300 Subject: [PATCH 04/10] ensure DID heals if private key is null or undefined --- .../pages/landing-page/landing-page.js | 16 ++++++++-------- octopus-freeze.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js b/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js index 38a8e4e9..1a0fcd41 100644 --- a/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js +++ b/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js @@ -157,9 +157,9 @@ export class LandingPage { let didDocument; let shouldPersist = false; const mainDID = await scAPI.getMainDIDAsync(); - if (mainDID) { + const healDID = async (didIdentifier)=>{ try { - didDocument = await $$.promisify(w3cDID.resolveDID)(mainDID); + didDocument = await $$.promisify(w3cDID.resolveDID)(didIdentifier); // try to sign with the DID to check if it's valid await $$.promisify(didDocument.sign)("test"); } catch (e) { @@ -175,13 +175,13 @@ export class LandingPage { throw new Error(`Failed to create DID. Error: ${e.message}`); } } + } + if (mainDID) { + await healDID(mainDID); } else { - try { - didDocument = await $$.promisify(w3cDID.createIdentity)("ssi:name", vaultDomain, userId); - shouldPersist = true; - } catch (e) { - throw new Error(`Failed to create DID. Error: ${e.message}`); - } + const didIdentifier = `did:ssi:name:${vaultDomain}:${userId}`; + await healDID(didIdentifier); + shouldPersist = true; } if (shouldPersist) { let batchId; diff --git a/octopus-freeze.json b/octopus-freeze.json index 6a70711e..59268d5f 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -1,4 +1,4 @@ -{ +{ "workDir": ".", "dependencies": [ { From aabe0bdb2b416b1916c3b124c5d8d29611dd2d08 Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Mon, 20 May 2024 12:26:35 +0300 Subject: [PATCH 05/10] Update octopus-freeze.json --- octopus-freeze.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octopus-freeze.json b/octopus-freeze.json index 59268d5f..9021d5b3 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -26,8 +26,8 @@ "type": "smartClone", "target": ".", "collectLog": false, - "commit": "b6af25151f8689b57c2702c7ca8f0e9d2d906f81", - "tag": "v2.0.9" + "commit": "b8fff0e40dbd984b77ca8636e910aa6075787a38", + "tag": "v2.0.10" }, { "type": "execute", From da139395b51267a0d859250c8a09f96d30f5a156 Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Tue, 21 May 2024 11:57:34 +0300 Subject: [PATCH 06/10] update --- .../web-components/pages/landing-page/landing-page.js | 6 ++++++ octopus-freeze.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js b/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js index 1a0fcd41..202deaf6 100644 --- a/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js +++ b/apihub-root/dsu-fabric/web-components/pages/landing-page/landing-page.js @@ -27,6 +27,12 @@ export class LandingPage { alert("Migration is needed. Please access the Demiurge Wallet or ask your administrator to access it then refresh this page."); return; } + + if(migrationStatus === MIGRATION_STATUS.IN_PROGRESS){ + alert("Migration is in progress. Please wait for the process to complete."); + return; + } + try { this.encryptedSSOSecret = await this.getSSOSecret(); } catch (e) { diff --git a/octopus-freeze.json b/octopus-freeze.json index 9021d5b3..78c4af31 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -26,7 +26,7 @@ "type": "smartClone", "target": ".", "collectLog": false, - "commit": "b8fff0e40dbd984b77ca8636e910aa6075787a38", + "commit": "c3d07db5807dbe08371c5ab8f44e347af00c5b6e", "tag": "v2.0.10" }, { From affb2c886bda0628ac52fcbae3566c18ff10ea6e Mon Sep 17 00:00:00 2001 From: Sava Daniel <35995331+skutner@users.noreply.github.com> Date: Tue, 21 May 2024 13:37:30 +0300 Subject: [PATCH 07/10] Update octopus-freeze.json --- octopus-freeze.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octopus-freeze.json b/octopus-freeze.json index 78c4af31..880d135e 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -26,8 +26,8 @@ "type": "smartClone", "target": ".", "collectLog": false, - "commit": "c3d07db5807dbe08371c5ab8f44e347af00c5b6e", - "tag": "v2.0.10" + "commit": "5c90203648a2478e962e66f995584acde1f94948", + "tag": "v2.0.12" }, { "type": "execute", From 24247cae474b45488db378828a91dfe0eb963726 Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Wed, 22 May 2024 16:07:44 +0300 Subject: [PATCH 08/10] Update octopus-freeze.json --- octopus-freeze.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octopus-freeze.json b/octopus-freeze.json index 880d135e..ed2049f4 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -26,8 +26,8 @@ "type": "smartClone", "target": ".", "collectLog": false, - "commit": "5c90203648a2478e962e66f995584acde1f94948", - "tag": "v2.0.12" + "commit": "960acc476a43dc2e8fc6b2f552a5f22de9c9474f", + "tag": "v2.0.13" }, { "type": "execute", From d95d508c1957dd26b1fdaa405d0811832a651526 Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Thu, 23 May 2024 15:05:04 +0300 Subject: [PATCH 09/10] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fb77c06a..82b921c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ePI-workspace", - "version": "v3.0.0", + "version": "v3.0.2", "description": "", "scripts": { "dev-install": "node ./bin/mkDevEnv.js", From 4832a835e806b988652864528ab148ce0e47755e Mon Sep 17 00:00:00 2001 From: Nicu-Cosmin Ursache Date: Thu, 23 May 2024 15:05:17 +0300 Subject: [PATCH 10/10] Update octopus-freeze.json --- octopus-freeze.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octopus-freeze.json b/octopus-freeze.json index ed2049f4..4dd7db0d 100644 --- a/octopus-freeze.json +++ b/octopus-freeze.json @@ -1,4 +1,4 @@ -{ +{ "workDir": ".", "dependencies": [ {