mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
Run prettier
This commit is contained in:
parent
bbec25c657
commit
f781458a2f
8 changed files with 19 additions and 19 deletions
|
@ -1,18 +1,13 @@
|
||||||
{
|
{
|
||||||
"plugins": ["plugins/markdown"],
|
"plugins": ["plugins/markdown"],
|
||||||
"source": {
|
"source": {
|
||||||
"include": [
|
"include": ["./src", "./README.md"]
|
||||||
"./src",
|
|
||||||
"./README.md"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"recurseDepth": 2,
|
"recurseDepth": 2,
|
||||||
"templates": {
|
"templates": {
|
||||||
"default": {
|
"default": {
|
||||||
"staticFiles": {
|
"staticFiles": {
|
||||||
"include": [
|
"include": ["./static"]
|
||||||
"./static"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -22,4 +17,4 @@
|
||||||
"docdash": {
|
"docdash": {
|
||||||
"search": true
|
"search": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ class Claim {
|
||||||
if (uri && !validUrl.isUri(uri)) {
|
if (uri && !validUrl.isUri(uri)) {
|
||||||
throw new Error('Invalid URI')
|
throw new Error('Invalid URI')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify validity of fingerprint
|
// Verify validity of fingerprint
|
||||||
if (fingerprint) {
|
if (fingerprint) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -20,4 +20,4 @@ exports.http = require('./http')
|
||||||
exports.irc = require('./irc')
|
exports.irc = require('./irc')
|
||||||
exports.matrix = require('./matrix')
|
exports.matrix = require('./matrix')
|
||||||
exports.twitter = require('./twitter')
|
exports.twitter = require('./twitter')
|
||||||
exports.xmpp = require('./xmpp')
|
exports.xmpp = require('./xmpp')
|
||||||
|
|
|
@ -58,7 +58,7 @@ const xmppStart = async (service, username, password) => {
|
||||||
* @async
|
* @async
|
||||||
* @param {object} data - Data used in the request
|
* @param {object} data - Data used in the request
|
||||||
* @param {string} data.id - The identifier of the targeted account
|
* @param {string} data.id - The identifier of the targeted account
|
||||||
* @param {string} data.field - The vCard field to return (should be "note")
|
* @param {string} data.field - The vCard field to return (should be "note")
|
||||||
* @param {object} opts - Options used to enable the request
|
* @param {object} opts - Options used to enable the request
|
||||||
* @param {string} opts.claims.xmpp.service - The server hostname on which the library can log in
|
* @param {string} opts.claims.xmpp.service - The server hostname on which the library can log in
|
||||||
* @param {string} opts.claims.xmpp.username - The username used to log in
|
* @param {string} opts.claims.xmpp.username - The username used to log in
|
||||||
|
|
15
src/keys.js
15
src/keys.js
|
@ -34,7 +34,7 @@ const Claim = require('./claim')
|
||||||
* const key1 = doip.keys.fetchHKP('alice@domain.tld');
|
* const key1 = doip.keys.fetchHKP('alice@domain.tld');
|
||||||
* const key2 = doip.keys.fetchHKP('123abc123abc');
|
* const key2 = doip.keys.fetchHKP('123abc123abc');
|
||||||
*/
|
*/
|
||||||
exports.fetchHKP = (identifier, keyserverDomain) => {
|
exports.fetchHKP = (identifier, keyserverDomain) => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
const keyserverBaseUrl = keyserverDomain
|
const keyserverBaseUrl = keyserverDomain
|
||||||
? `https://${keyserverDomain}`
|
? `https://${keyserverDomain}`
|
||||||
|
@ -146,7 +146,7 @@ exports.fetchKeybase = (username, fingerprint) => {
|
||||||
* @returns {openpgp.key.Key}
|
* @returns {openpgp.key.Key}
|
||||||
* @example
|
* @example
|
||||||
* const plainkey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
* const plainkey = `-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
*
|
*
|
||||||
* mQINBF0mIsIBEADacleiyiV+z6FIunvLWrO6ZETxGNVpqM+WbBQKdW1BVrJBBolg
|
* mQINBF0mIsIBEADacleiyiV+z6FIunvLWrO6ZETxGNVpqM+WbBQKdW1BVrJBBolg
|
||||||
* [...]
|
* [...]
|
||||||
* =6lib
|
* =6lib
|
||||||
|
@ -187,14 +187,19 @@ exports.fetchURI = (uri) => {
|
||||||
switch (match[1]) {
|
switch (match[1]) {
|
||||||
case 'hkp':
|
case 'hkp':
|
||||||
resolve(
|
resolve(
|
||||||
exports.fetchHKP(match[3] ? match[3] : match[2], match[3] ? match[2] : null)
|
exports.fetchHKP(
|
||||||
|
match[3] ? match[3] : match[2],
|
||||||
|
match[3] ? match[2] : null
|
||||||
|
)
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
case 'wkd':
|
case 'wkd':
|
||||||
resolve(exports.fetchWKD(match[2]))
|
resolve(exports.fetchWKD(match[2]))
|
||||||
break
|
break
|
||||||
case 'kb':
|
case 'kb':
|
||||||
resolve(exports.fetchKeybase(match[2], match.length >= 4 ? match[3] : null))
|
resolve(
|
||||||
|
exports.fetchKeybase(match[2], match.length >= 4 ? match[3] : null)
|
||||||
|
)
|
||||||
break
|
break
|
||||||
default:
|
default:
|
||||||
reject('Invalid URI protocol')
|
reject('Invalid URI protocol')
|
||||||
|
@ -262,4 +267,4 @@ exports.process = (publicKey) => {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ const utils = require('./utils')
|
||||||
const E = require('./enums')
|
const E = require('./enums')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @module proofs
|
* @module proofs
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,7 +18,7 @@ const Claim = require('./claim')
|
||||||
const keys = require('./keys')
|
const keys = require('./keys')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @module signatures
|
* @module signatures
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -17,7 +17,7 @@ const validator = require('validator')
|
||||||
const E = require('./enums')
|
const E = require('./enums')
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @module utils
|
* @module utils
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue