forked from Mirrors/keyoxide-web
Add openpgp4fpr to keyData object
This commit is contained in:
parent
a5040cb223
commit
29ccb63bf1
2 changed files with 7 additions and 0 deletions
|
@ -42,6 +42,9 @@ const apiProfileSchema = {
|
|||
fingerprint: {
|
||||
type: "string"
|
||||
},
|
||||
openpgp4fpr: {
|
||||
type: "string"
|
||||
},
|
||||
users: {
|
||||
type: "array",
|
||||
items: {
|
||||
|
|
|
@ -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 = {}
|
||||
|
|
Loading…
Reference in a new issue