mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
fix: ignore non-issues without current solution
This commit is contained in:
parent
fceb5b6f9b
commit
4f5e5592f4
8 changed files with 13 additions and 0 deletions
|
@ -70,6 +70,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
host,
|
host,
|
||||||
date: now.toUTCString(),
|
date: now.toUTCString(),
|
||||||
accept: 'application/activity+json',
|
accept: 'application/activity+json',
|
||||||
|
// @ts-ignore
|
||||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
axios.post(data.url, jsonData, {
|
axios.post(data.url, jsonData, {
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
// @ts-ignore
|
||||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
},
|
},
|
||||||
validateStatus: function (status) {
|
validateStatus: function (status) {
|
||||||
|
|
|
@ -56,6 +56,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
axios.get(data.url, {
|
axios.get(data.url, {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
|
// @ts-ignore
|
||||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
},
|
},
|
||||||
validateStatus: function (status) {
|
validateStatus: function (status) {
|
||||||
|
|
|
@ -71,9 +71,11 @@ if (jsEnv.isNode) {
|
||||||
const reEnd = /End\sof\s.*\staxonomy./
|
const reEnd = /End\sof\s.*\staxonomy./
|
||||||
const keys = []
|
const keys = []
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
client.addListener('registered', (message) => {
|
client.addListener('registered', (message) => {
|
||||||
client.send(`PRIVMSG NickServ TAXONOMY ${data.nick}`)
|
client.send(`PRIVMSG NickServ TAXONOMY ${data.nick}`)
|
||||||
})
|
})
|
||||||
|
// @ts-ignore
|
||||||
client.addListener('notice', (nick, to, text, message) => {
|
client.addListener('notice', (nick, to, text, message) => {
|
||||||
if (reKey.test(text)) {
|
if (reKey.test(text)) {
|
||||||
const match = text.match(reKey)
|
const match = text.match(reKey)
|
||||||
|
|
|
@ -63,6 +63,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
{
|
{
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
|
// @ts-ignore
|
||||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -66,6 +66,7 @@ module.exports.fn = async (data, opts) => {
|
||||||
axios.get(url, {
|
axios.get(url, {
|
||||||
headers: {
|
headers: {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
|
// @ts-ignore
|
||||||
'User-Agent': `doipjs/${require('../../package.json').version}`
|
'User-Agent': `doipjs/${require('../../package.json').version}`
|
||||||
},
|
},
|
||||||
validateStatus: (status) => status === 200
|
validateStatus: (status) => status === 200
|
||||||
|
|
|
@ -40,6 +40,7 @@ const fetchHKP = async (identifier, keyserverDomain) => {
|
||||||
? `https://${keyserverDomain}`
|
? `https://${keyserverDomain}`
|
||||||
: 'https://keys.openpgp.org'
|
: 'https://keys.openpgp.org'
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
const hkp = new HKP(keyserverBaseUrl)
|
const hkp = new HKP(keyserverBaseUrl)
|
||||||
const lookupOpts = {
|
const lookupOpts = {
|
||||||
query: identifier
|
query: identifier
|
||||||
|
@ -72,6 +73,7 @@ const fetchHKP = async (identifier, keyserverDomain) => {
|
||||||
* const key = doip.keys.fetchWKD('alice@domain.tld');
|
* const key = doip.keys.fetchWKD('alice@domain.tld');
|
||||||
*/
|
*/
|
||||||
const fetchWKD = async (identifier) => {
|
const fetchWKD = async (identifier) => {
|
||||||
|
// @ts-ignore
|
||||||
const wkd = new WKD()
|
const wkd = new WKD()
|
||||||
const lookupOpts = {
|
const lookupOpts = {
|
||||||
email: identifier
|
email: identifier
|
||||||
|
|
|
@ -55,9 +55,12 @@ const process = async (signature) => {
|
||||||
throw new Error(`Signature could not be read (${e.message})`)
|
throw new Error(`Signature could not be read (${e.message})`)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
const issuerKeyID = sigData.signature.packets[0].issuerKeyID.toHex()
|
const issuerKeyID = sigData.signature.packets[0].issuerKeyID.toHex()
|
||||||
|
// @ts-ignore
|
||||||
const signersUserID = sigData.signature.packets[0].signersUserID
|
const signersUserID = sigData.signature.packets[0].signersUserID
|
||||||
const preferredKeyServer =
|
const preferredKeyServer =
|
||||||
|
// @ts-ignore
|
||||||
sigData.signature.packets[0].preferredKeyServer ||
|
sigData.signature.packets[0].preferredKeyServer ||
|
||||||
'https://keys.openpgp.org/'
|
'https://keys.openpgp.org/'
|
||||||
const text = sigData.getText()
|
const text = sigData.getText()
|
||||||
|
@ -112,6 +115,7 @@ const process = async (signature) => {
|
||||||
|
|
||||||
// Verify the signature
|
// Verify the signature
|
||||||
const verificationResult = await openpgp.verify({
|
const verificationResult = await openpgp.verify({
|
||||||
|
// @ts-ignore
|
||||||
message: sigData,
|
message: sigData,
|
||||||
verificationKeys: result.key.data
|
verificationKeys: result.key.data
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue