From 29ccb63bf1fe428c1f916f466f1dc45fef6cdead Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sun, 17 Oct 2021 09:08:56 +0200 Subject: [PATCH] Add openpgp4fpr to keyData object --- api/v0/index.js | 3 +++ server/index.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/api/v0/index.js b/api/v0/index.js index b0babf8..68e2793 100644 --- a/api/v0/index.js +++ b/api/v0/index.js @@ -42,6 +42,9 @@ const apiProfileSchema = { fingerprint: { type: "string" }, + openpgp4fpr: { + type: "string" + }, users: { type: "array", items: { diff --git a/server/index.js b/server/index.js index 043e182..d05c5b0 100644 --- a/server/index.js +++ b/server/index.js @@ -35,6 +35,7 @@ const generateWKDProfile = async (id) => { return keys.fetchWKD(id) .then(async key => { let keyData = await doip.keys.process(key.publicKey) + keyData.openpgp4fpr = `openpgp4fpr:${keyData.fingerprint.toLowerCase()}` keyData.key.fetchMethod = 'wkd' keyData.key.uri = key.fetchURL keyData.key.data = {} @@ -61,6 +62,7 @@ const generateHKPProfile = async (id, keyserverDomain) => { return keys.fetchHKP(id, keyserverDomain) .then(async key => { let keyData = await doip.keys.process(key.publicKey) + keyData.openpgp4fpr = `openpgp4fpr:${keyData.fingerprint.toLowerCase()}` keyData.key.fetchMethod = 'hkp' keyData.key.uri = key.fetchURL keyData.key.data = {} @@ -87,6 +89,7 @@ const generateSignatureProfile = async (signature) => { return keys.fetchSignature(signature) .then(async key => { let keyData = key.keyData + keyData.openpgp4fpr = `openpgp4fpr:${keyData.fingerprint.toLowerCase()}` delete key.keyData keyData.key.data = {} keyData = processKeyData(keyData) @@ -112,6 +115,7 @@ const generateKeybaseProfile = async (username, fingerprint) => { return keys.fetchKeybase(id, keyserverDomain) .then(async key => { let keyData = await doip.keys.process(key.publicKey) + keyData.openpgp4fpr = `openpgp4fpr:${keyData.fingerprint.toLowerCase()}` keyData.key.fetchMethod = 'hkp' keyData.key.uri = key.fetchURL keyData.key.data = {}