From 04933f27053a47fe115231fe814642b8b2315764 Mon Sep 17 00:00:00 2001 From: TanelOrumaa Date: Sun, 12 Dec 2021 20:22:27 +0200 Subject: [PATCH] web-eid.js is now fetched from git, fixed a small problem related to authentication --- demoBackend/.gitignore | 3 ++ .../src/demo-website/package-lock.json | 38 +++++++++---------- demoBackend/src/demo-website/package.json | 2 +- demoBackend/src/demo-website/src/web-eid.js | 3 -- .../demobackend/config/SessionManager.kt | 2 +- 5 files changed, 22 insertions(+), 26 deletions(-) diff --git a/demoBackend/.gitignore b/demoBackend/.gitignore index 549e00a..3ec119f 100644 --- a/demoBackend/.gitignore +++ b/demoBackend/.gitignore @@ -31,3 +31,6 @@ build/ ### VS Code ### .vscode/ + +### web-eid.js ### +!**src/demo-website/src/web-eid.js \ No newline at end of file diff --git a/demoBackend/src/demo-website/package-lock.json b/demoBackend/src/demo-website/package-lock.json index 33604b5..d157ab9 100644 --- a/demoBackend/src/demo-website/package-lock.json +++ b/demoBackend/src/demo-website/package-lock.json @@ -8,7 +8,7 @@ "name": "demo-website", "version": "0.1.0", "dependencies": { - "@web-eid/web-eid-library": "../../../../web-eid.js/", + "@web-eid/web-eid-library": "github:TanelOrumaa/web-eid.js#main", "core-js": "^3.6.5", "vue": "^3.0.0", "vue-cookie-next": "^1.3.0", @@ -32,6 +32,7 @@ "../../../../web-eid.js": { "name": "@web-eid/web-eid-library", "version": "1.0.1", + "extraneous": true, "license": "MIT", "dependencies": { "@types/node": "^16.11.11" @@ -1922,10 +1923,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.11.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", - "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==", - "dev": true + "version": "16.11.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz", + "integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -2643,8 +2643,12 @@ "dev": true }, "node_modules/@web-eid/web-eid-library": { - "resolved": "../../../../web-eid.js", - "link": true + "version": "1.0.1", + "resolved": "git+ssh://git@github.com/TanelOrumaa/web-eid.js.git#b9c6f50c78a39b444d5df308826cd3f3476233d1", + "license": "MIT", + "dependencies": { + "@types/node": "^16.11.11" + } }, "node_modules/@webassemblyjs/ast": { "version": "1.9.0", @@ -16598,10 +16602,9 @@ "dev": true }, "@types/node": { - "version": "16.11.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.10.tgz", - "integrity": "sha512-3aRnHa1KlOEEhJ6+CvyHKK5vE9BcLGjtUpwvqYLRvYNQKMfabu3BwfJaA/SLW8dxe28LsNDjtHwePTuzn3gmOA==", - "dev": true + "version": "16.11.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.12.tgz", + "integrity": "sha512-+2Iggwg7PxoO5Kyhvsq9VarmPbIelXP070HMImEpbtGCoyWNINQj4wzjbQCXzdHTRXnqufutJb5KAURZANNBAw==" }, "@types/normalize-package-data": { "version": "2.4.1", @@ -17209,17 +17212,10 @@ "dev": true }, "@web-eid/web-eid-library": { - "version": "file:../../../../web-eid.js", + "version": "git+ssh://git@github.com/TanelOrumaa/web-eid.js.git#b9c6f50c78a39b444d5df308826cd3f3476233d1", + "from": "@web-eid/web-eid-library@github:TanelOrumaa/web-eid.js#main", "requires": { - "@types/node": "^16.11.11", - "@typescript-eslint/eslint-plugin": "^4.31.2", - "@typescript-eslint/parser": "^4.31.2", - "eslint": "^7.25.0", - "rimraf": "^3.0.2", - "rollup": "^2.26.11", - "rollup-plugin-polyfill-node": "^0.8.0", - "rollup-plugin-terser": "^5.3.1", - "typescript": "^3.8.3" + "@types/node": "^16.11.11" } }, "@webassemblyjs/ast": { diff --git a/demoBackend/src/demo-website/package.json b/demoBackend/src/demo-website/package.json index 3ea1cec..4982059 100644 --- a/demoBackend/src/demo-website/package.json +++ b/demoBackend/src/demo-website/package.json @@ -8,7 +8,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@web-eid/web-eid-library": "../../../../web-eid.js/", + "@web-eid/web-eid-library": "github:TanelOrumaa/web-eid.js#main", "core-js": "^3.6.5", "vue": "^3.0.0", "vue-cookie-next": "^1.3.0", diff --git a/demoBackend/src/demo-website/src/web-eid.js b/demoBackend/src/demo-website/src/web-eid.js index 344bcfa..0ecfae7 100644 --- a/demoBackend/src/demo-website/src/web-eid.js +++ b/demoBackend/src/demo-website/src/web-eid.js @@ -8673,9 +8673,6 @@ class WebExtensionService { if (res.statusCode == 200) { console.log(res.statusCode); window.postMessage({ action: this.getRelevantSuccessAction(message) }, location.origin); - res.on("data", (data) => { - console.log("HERE WE GOOO:" + data); - }); } else { this.removeFromQueue(message.action); diff --git a/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/SessionManager.kt b/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/SessionManager.kt index 75c0bcc..2dfd120 100644 --- a/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/SessionManager.kt +++ b/demoBackend/src/main/kotlin/com/tarkvaratehnika/demobackend/config/SessionManager.kt @@ -58,7 +58,7 @@ class SessionManager { // Fallback to when for some reason session object doesn't have sessionId attached. sessionId = getSessionId(headers) } - sessionRegistry[sessionId]!!.roles = arrayListOf() + sessionRegistry[sessionId]?.roles = arrayListOf() val authentication = UsernamePasswordAuthenticationToken(null, sessionId, listOf()) securityContext.authentication = authentication }