fix: only add profile verifier when appropriate

This commit is contained in:
Yarmo Mackenbach 2023-10-04 11:19:54 +02:00
parent b250392326
commit be97ff4246
No known key found for this signature in database
GPG key ID: 3C57D093219103A3

View file

@ -38,7 +38,9 @@ const generateAspeProfile = async (id) => {
return doipjs.asp.fetchASPE(id)
.then(profile => {
if (process.env.DOMAIN) {
profile.addVerifier('keyoxide', `${getScheme()}://${process.env.DOMAIN}/${id}`)
}
profile = processAspProfile(profile)
return profile
})
@ -58,7 +60,9 @@ const generateWKDProfile = async (id) => {
return fetchWKD(id)
.then(async profile => {
if (process.env.DOMAIN) {
profile.addVerifier('keyoxide', `${getScheme()}://${process.env.DOMAIN}/wkd/${id}`)
}
profile = processOpenPgpProfile(profile)
logger.debug('Generating a WKD profile',
@ -89,7 +93,9 @@ const generateHKPProfile = async (id, keyserverDomain) => {
keyoxideUrl = `${getScheme()}://${process.env.DOMAIN}/hkp/${keyserverDomain}/${id}`
}
if (process.env.DOMAIN) {
profile.addVerifier('keyoxide', keyoxideUrl)
}
profile = processOpenPgpProfile(profile)
logger.debug('Generating a HKP profile',
@ -168,7 +174,9 @@ const generateKeybaseProfile = async (username, fingerprint) => {
return fetchKeybase(username, fingerprint)
.then(async profile => {
if (process.env.DOMAIN) {
profile.addVerifier('keyoxide', `${getScheme()}://${process.env.DOMAIN}/keybase/${username}/${fingerprint}`)
}
profile = processOpenPgpProfile(profile)
logger.debug('Generating a Keybase profile',