From 1740d245f4a2e0f0612ff6dc3c1d6a7ecfae5e52 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 2 Mar 2021 15:26:13 +0100 Subject: [PATCH 1/2] Fix Twitter verification --- package.json | 2 +- static/scripts.js | 12 ++++++++---- yarn.lock | 8 ++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 1bda2af..f864d2c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "index.js", "dependencies": { "bent": "^7.3.12", - "doipjs": "^0.10.0", + "doipjs": "^0.10.5", "dotenv": "^8.2.0", "express": "^4.17.1", "express-validator": "^6.8.0", diff --git a/static/scripts.js b/static/scripts.js index 5e6a14c..94bd9b7 100644 --- a/static/scripts.js +++ b/static/scripts.js @@ -234,13 +234,17 @@ async function displayProfile(opts) { let keyData, keyLink, sigVerification, sigKeyUri, fingerprint, feedback = "", verifications = []; let icon_qr = ''; + const doipOpts = { + proxyPolicy: 'adaptive', + } + // Reset the avatar document.body.querySelector('#profileAvatar').style = 'display: none'; document.body.querySelector('#profileAvatar').src = '/static/img/avatar_placeholder.png'; if (opts.mode == 'sig') { try { - sigVerification = await doip.signatures.verify(opts.input); + sigVerification = await doip.signatures.verify(opts.input, doipOpts); keyData = sigVerification.publicKey.data; fingerprint = sigVerification.publicKey.fingerprint; } catch (e) { @@ -290,7 +294,7 @@ async function displayProfile(opts) { keyUriServer = keyUriMatch[2]; keyUriId = keyUriMatch[3]; } - + switch (keyUriMode) { case "wkd": const [, localPart, domain] = /(.*)@(.*)/.exec(keyUriId); @@ -383,7 +387,7 @@ async function displayProfile(opts) { if (sigVerification) { verifications = sigVerification.claims } else { - verifications = await doip.claims.verify(keyData, fingerprint, {'proxyPolicy':'adaptive'}) + verifications = await doip.claims.verify(keyData, fingerprint, doipOpts) } } catch (e) { feedback += `

There was a problem verifying the claims.

`; @@ -457,7 +461,7 @@ async function displayProfile(opts) { feedback += ``; return; } - + userId = userId.filter((a) => (a && a.errors.length == 0 && a.serviceproviderData)) userId = userId.sort((a,b) => (a.serviceproviderData.serviceprovider.name > b.serviceproviderData.serviceprovider.name) ? 1 : ((b.serviceproviderData.serviceprovider.name > a.serviceproviderData.serviceprovider.name) ? -1 : 0)); diff --git a/yarn.lock b/yarn.lock index 7466465..276dbe3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -872,10 +872,10 @@ doctypes@^1.1.0: resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9" integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk= -doipjs@^0.10.0: - version "0.10.0" - resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.10.0.tgz#d4547121aabba9c59abde690596e59e64237cd14" - integrity sha512-vPdFZMbIQWPIHNDO2CFcqpCs2h4HgcQOO7eIYVIC7yfxpFZ3DIFCW68Bv1aCqRel9W/3YpN9p7ccgzHN/f113A== +doipjs@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.10.5.tgz#df82dd70aff2903eddd7262e63f4e80ef4a9eb49" + integrity sha512-uFgt7rL5Olq2ByTDhjWNBlnWFsQAx6x5pJfDicnioJVNPFXcSdT2PFejfZGUTAfyI/1q3NWpSDn+vuPiR5udHg== dependencies: bent "^7.3.12" browserify "^17.0.0" From 4cbfea67084dea57cc0bfc073985c90a530455d3 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Tue, 2 Mar 2021 15:40:39 +0100 Subject: [PATCH 2/2] Release 2.4.2 --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 147f13b..6173154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.4.2] - 2021-03-02 +### Fixed +- Twitter claim verification + ## [2.4.1] - 2021-01-13 ### Added - Owncast service provider diff --git a/package.json b/package.json index f864d2c..48a8531 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keyoxide-web", - "version": "2.4.1", + "version": "2.4.2", "description": "A modern, secure and privacy-friendly platform to establish your decentralized online identity", "main": "index.js", "dependencies": {