forked from Mirrors/keyoxide-web
Merge branch 'dev' into redesign
This commit is contained in:
commit
1bc447ddf0
4 changed files with 21 additions and 13 deletions
|
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [2.4.2] - 2021-03-02
|
||||||
|
### Fixed
|
||||||
|
- Twitter claim verification
|
||||||
|
|
||||||
## [2.4.1] - 2021-01-13
|
## [2.4.1] - 2021-01-13
|
||||||
### Added
|
### Added
|
||||||
- Owncast service provider
|
- Owncast service provider
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "keyoxide-web",
|
"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",
|
"description": "A modern, secure and privacy-friendly platform to establish your decentralized online identity",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bent": "^7.3.12",
|
"bent": "^7.3.12",
|
||||||
"doipjs": "^0.10.0",
|
"doipjs": "^0.10.5",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-validator": "^6.8.0",
|
"express-validator": "^6.8.0",
|
||||||
|
|
|
@ -288,7 +288,7 @@ async function displayProfile(opts) {
|
||||||
const generateProfileUserIdHTML = (userId, claims, opts) => {
|
const generateProfileUserIdHTML = (userId, claims, opts) => {
|
||||||
// Init output
|
// Init output
|
||||||
let output = '';
|
let output = '';
|
||||||
|
|
||||||
// Add claim header to output
|
// Add claim header to output
|
||||||
output += `<h2>${userId.email}${opts.isPrimary ? ' <small class="primary">primary</small>' : ''}</h2>`;
|
output += `<h2>${userId.email}${opts.isPrimary ? ' <small class="primary">primary</small>' : ''}</h2>`;
|
||||||
|
|
||||||
|
@ -320,16 +320,16 @@ async function displayProfile(opts) {
|
||||||
`;
|
`;
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
claims = sortClaims(claims);
|
claims = sortClaims(claims);
|
||||||
|
|
||||||
// Generate output for each claim
|
// Generate output for each claim
|
||||||
claims.forEach((claim, i) => {
|
claims.forEach((claim, i) => {
|
||||||
const claimData = claim.serviceproviderData
|
const claimData = claim.serviceproviderData
|
||||||
if (!claimData.serviceprovider.name) {
|
if (!claimData.serviceprovider.name) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
output += `
|
output += `
|
||||||
<div class="claim">
|
<div class="claim">
|
||||||
<div class="claim__main">
|
<div class="claim__main">
|
||||||
|
@ -361,12 +361,16 @@ async function displayProfile(opts) {
|
||||||
let keyData, keyLink, sigVerification, sigKeyUri, fingerprint, feedback = "", verifications = [];
|
let keyData, keyLink, sigVerification, sigKeyUri, fingerprint, feedback = "", verifications = [];
|
||||||
let icon_qr = '<svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="#ffffff" d="M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z" /></svg>';
|
let icon_qr = '<svg style="width:24px;height:24px" viewBox="0 0 24 24"><path fill="#ffffff" d="M3,11H5V13H3V11M11,5H13V9H11V5M9,11H13V15H11V13H9V11M15,11H17V13H19V11H21V13H19V15H21V19H19V21H17V19H13V21H11V17H15V15H17V13H15V11M19,19V15H17V19H19M15,3H21V9H15V3M17,5V7H19V5H17M3,3H9V9H3V3M5,5V7H7V5H5M3,15H9V21H3V15M5,17V19H7V17H5Z" /></svg>';
|
||||||
|
|
||||||
|
const doipOpts = {
|
||||||
|
proxyPolicy: 'adaptive',
|
||||||
|
}
|
||||||
|
|
||||||
// Reset the avatar
|
// Reset the avatar
|
||||||
document.body.querySelector('#profileHeader').src = generateProfileHeaderHTML(null)
|
document.body.querySelector('#profileHeader').src = generateProfileHeaderHTML(null)
|
||||||
|
|
||||||
if (opts.mode == 'sig') {
|
if (opts.mode == 'sig') {
|
||||||
try {
|
try {
|
||||||
sigVerification = await doip.signatures.verify(opts.input);
|
sigVerification = await doip.signatures.verify(opts.input, doipOpts);
|
||||||
keyData = sigVerification.publicKey.data;
|
keyData = sigVerification.publicKey.data;
|
||||||
fingerprint = sigVerification.publicKey.fingerprint;
|
fingerprint = sigVerification.publicKey.fingerprint;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -418,7 +422,7 @@ async function displayProfile(opts) {
|
||||||
keyUriServer = keyUriMatch[2];
|
keyUriServer = keyUriMatch[2];
|
||||||
keyUriId = keyUriMatch[3];
|
keyUriId = keyUriMatch[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (keyUriMode) {
|
switch (keyUriMode) {
|
||||||
case "wkd":
|
case "wkd":
|
||||||
const [, localPart, domain] = /(.*)@(.*)/.exec(keyUriId);
|
const [, localPart, domain] = /(.*)@(.*)/.exec(keyUriId);
|
||||||
|
@ -480,7 +484,7 @@ async function displayProfile(opts) {
|
||||||
if (sigVerification) {
|
if (sigVerification) {
|
||||||
verifications = sigVerification.claims
|
verifications = sigVerification.claims
|
||||||
} else {
|
} else {
|
||||||
verifications = await doip.claims.verify(keyData, fingerprint, {'proxyPolicy':'adaptive'})
|
verifications = await doip.claims.verify(keyData, fingerprint, doipOpts)
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
feedback += `<p>There was a problem verifying the claims.</p>`;
|
feedback += `<p>There was a problem verifying the claims.</p>`;
|
||||||
|
|
|
@ -872,10 +872,10 @@ doctypes@^1.1.0:
|
||||||
resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9"
|
resolved "https://registry.yarnpkg.com/doctypes/-/doctypes-1.1.0.tgz#ea80b106a87538774e8a3a4a5afe293de489e0a9"
|
||||||
integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=
|
integrity sha1-6oCxBqh1OHdOijpKWv4pPeSJ4Kk=
|
||||||
|
|
||||||
doipjs@^0.10.0:
|
doipjs@^0.10.5:
|
||||||
version "0.10.0"
|
version "0.10.5"
|
||||||
resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.10.0.tgz#d4547121aabba9c59abde690596e59e64237cd14"
|
resolved "https://registry.yarnpkg.com/doipjs/-/doipjs-0.10.5.tgz#df82dd70aff2903eddd7262e63f4e80ef4a9eb49"
|
||||||
integrity sha512-vPdFZMbIQWPIHNDO2CFcqpCs2h4HgcQOO7eIYVIC7yfxpFZ3DIFCW68Bv1aCqRel9W/3YpN9p7ccgzHN/f113A==
|
integrity sha512-uFgt7rL5Olq2ByTDhjWNBlnWFsQAx6x5pJfDicnioJVNPFXcSdT2PFejfZGUTAfyI/1q3NWpSDn+vuPiR5udHg==
|
||||||
dependencies:
|
dependencies:
|
||||||
bent "^7.3.12"
|
bent "^7.3.12"
|
||||||
browserify "^17.0.0"
|
browserify "^17.0.0"
|
||||||
|
|
Loading…
Reference in a new issue