Release 0.12.1

This commit is contained in:
Yarmo Mackenbach 2021-04-26 16:01:40 +02:00
parent e0dc5f4b21
commit 780d4d0c69
No known key found for this signature in database
GPG key ID: 37367F4AF4087AD1
4 changed files with 234 additions and 214 deletions

View file

@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [0.12.1] - 2021-04-26
## Fixed
- Bad interpretation of proxy policy
- Proxy URL protocol
## [0.12.0] - 2021-04-22 ## [0.12.0] - 2021-04-22
## Added ## Added
- Proxy server functionality - Proxy server functionality

65
dist/doip.js vendored
View file

@ -7541,7 +7541,7 @@ module.exports={
"chai": "^4.2.0", "chai": "^4.2.0",
"chai-as-promised": "^7.1.1", "chai-as-promised": "^7.1.1",
"chai-match-pattern": "^1.2.0", "chai-match-pattern": "^1.2.0",
"docdash": "^1.2.0", "clean-jsdoc-theme": "^3.2.4",
"jsdoc": "^3.6.6", "jsdoc": "^3.6.6",
"license-check-and-add": "^3.0.4", "license-check-and-add": "^3.0.4",
"minify": "^6.0.1", "minify": "^6.0.1",
@ -9493,7 +9493,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const dns = require('dns') const jsEnv = require("browser-or-node")
/** /**
* @module fetcher/dns * @module fetcher/dns
@ -9505,7 +9505,10 @@ const dns = require('dns')
*/ */
module.exports.timeout = 5000 module.exports.timeout = 5000
/** if (!jsEnv.isNode) {
const dns = require('dns')
/**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async * @async
@ -9513,7 +9516,7 @@ module.exports.timeout = 5000
* @param {string} data.domain - The targeted domain * @param {string} data.domain - The targeted domain
* @returns {object} * @returns {object}
*/ */
module.exports.fn = async (data, opts) => { module.exports.fn = async (data, opts) => {
let timeoutHandle let timeoutHandle
const timeoutPromise = new Promise((resolve, reject) => { const timeoutPromise = new Promise((resolve, reject) => {
timeoutHandle = setTimeout( timeoutHandle = setTimeout(
@ -9542,9 +9545,11 @@ module.exports.fn = async (data, opts) => {
clearTimeout(timeoutHandle) clearTimeout(timeoutHandle)
return result return result
}) })
}
} else {
module.exports.fn = null
} }
},{"browser-or-node":"/home/yarmo/dev/doip/doipjs/node_modules/browser-or-node/lib/index.js","dns":"/home/yarmo/dev/doip/doipjs/node_modules/browserify/lib/_empty.js"}],"/home/yarmo/dev/doip/doipjs/src/fetcher/gitlab.js":[function(require,module,exports){
},{"dns":"/home/yarmo/dev/doip/doipjs/node_modules/browserify/lib/_empty.js"}],"/home/yarmo/dev/doip/doipjs/src/fetcher/gitlab.js":[function(require,module,exports){
/* /*
Copyright 2021 Yarmo Mackenbach Copyright 2021 Yarmo Mackenbach
@ -9756,8 +9761,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const irc = require('irc-upd') const jsEnv = require("browser-or-node")
const validator = require('validator')
/** /**
* @module fetcher/irc * @module fetcher/irc
@ -9769,7 +9773,11 @@ const validator = require('validator')
*/ */
module.exports.timeout = 20000 module.exports.timeout = 20000
/** if (jsEnv.isNode) {
const irc = require('irc-upd')
const validator = require('validator')
/**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async * @async
@ -9780,7 +9788,7 @@ module.exports.timeout = 20000
* @param {string} opts.claims.irc.nick - The nick to be used by the library to log in * @param {string} opts.claims.irc.nick - The nick to be used by the library to log in
* @returns {object} * @returns {object}
*/ */
module.exports.fn = async (data, opts) => { module.exports.fn = async (data, opts) => {
let timeoutHandle let timeoutHandle
const timeoutPromise = new Promise((resolve, reject) => { const timeoutPromise = new Promise((resolve, reject) => {
timeoutHandle = setTimeout( timeoutHandle = setTimeout(
@ -9828,9 +9836,12 @@ module.exports.fn = async (data, opts) => {
clearTimeout(timeoutHandle) clearTimeout(timeoutHandle)
return result return result
}) })
}
} else {
module.exports.fn = null
} }
},{"irc-upd":"irc-upd","validator":"/home/yarmo/dev/doip/doipjs/node_modules/validator/index.js"}],"/home/yarmo/dev/doip/doipjs/src/fetcher/matrix.js":[function(require,module,exports){ },{"browser-or-node":"/home/yarmo/dev/doip/doipjs/node_modules/browser-or-node/lib/index.js","irc-upd":"irc-upd","validator":"/home/yarmo/dev/doip/doipjs/node_modules/validator/index.js"}],"/home/yarmo/dev/doip/doipjs/src/fetcher/matrix.js":[function(require,module,exports){
/* /*
Copyright 2021 Yarmo Mackenbach Copyright 2021 Yarmo Mackenbach
@ -10010,10 +10021,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const jsdom = require('jsdom') const jsEnv = require("browser-or-node")
const { client, xml } = require('@xmpp/client')
const debug = require('@xmpp/debug')
const validator = require('validator')
/** /**
* @module fetcher/xmpp * @module fetcher/xmpp
@ -10025,10 +10033,16 @@ const validator = require('validator')
*/ */
module.exports.timeout = 5000 module.exports.timeout = 5000
let xmpp = null, if (jsEnv.isNode) {
const jsdom = require('jsdom')
const { client, xml } = require('@xmpp/client')
const debug = require('@xmpp/debug')
const validator = require('validator')
let xmpp = null,
iqCaller = null iqCaller = null
const xmppStart = async (service, username, password) => { const xmppStart = async (service, username, password) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const xmpp = client({ const xmpp = client({
service: service, service: service,
@ -10047,9 +10061,9 @@ const xmppStart = async (service, username, password) => {
reject(error) reject(error)
}) })
}) })
} }
/** /**
* Execute a fetch request * Execute a fetch request
* @function * @function
* @async * @async
@ -10062,7 +10076,7 @@ const xmppStart = async (service, username, password) => {
* @param {string} opts.claims.xmpp.password - The password used to log in * @param {string} opts.claims.xmpp.password - The password used to log in
* @returns {object} * @returns {object}
*/ */
module.exports.fn = async (data, opts) => { module.exports.fn = async (data, opts) => {
let timeoutHandle let timeoutHandle
const timeoutPromise = new Promise((resolve, reject) => { const timeoutPromise = new Promise((resolve, reject) => {
timeoutHandle = setTimeout( timeoutHandle = setTimeout(
@ -10130,10 +10144,13 @@ module.exports.fn = async (data, opts) => {
clearTimeout(timeoutHandle) clearTimeout(timeoutHandle)
return result return result
}) })
}
} else {
module.exports.fn = null
} }
}).call(this)}).call(this,require('_process')) }).call(this)}).call(this,require('_process'))
},{"@xmpp/client":"@xmpp/client","@xmpp/debug":"@xmpp/debug","_process":"/home/yarmo/dev/doip/doipjs/node_modules/process/browser.js","jsdom":"jsdom","validator":"/home/yarmo/dev/doip/doipjs/node_modules/validator/index.js"}],"/home/yarmo/dev/doip/doipjs/src/index.js":[function(require,module,exports){ },{"@xmpp/client":"@xmpp/client","@xmpp/debug":"@xmpp/debug","_process":"/home/yarmo/dev/doip/doipjs/node_modules/process/browser.js","browser-or-node":"/home/yarmo/dev/doip/doipjs/node_modules/browser-or-node/lib/index.js","jsdom":"jsdom","validator":"/home/yarmo/dev/doip/doipjs/node_modules/validator/index.js"}],"/home/yarmo/dev/doip/doipjs/src/index.js":[function(require,module,exports){
/* /*
Copyright 2021 Yarmo Mackenbach Copyright 2021 Yarmo Mackenbach
@ -10530,9 +10547,7 @@ const handleBrowserRequests = (data, opts) => {
return createFallbackRequestPromise(data, opts) return createFallbackRequestPromise(data, opts)
break break
case E.ProofAccess.SERVER: case E.ProofAccess.SERVER:
throw new Error( return createProxyRequestPromise(data, opts)
'Impossible to fetch proof (bad combination of service access and proxy policy)'
)
break break
default: default:
throw new Error('Invalid proof access value') throw new Error('Invalid proof access value')
@ -10834,7 +10849,7 @@ const generateProxyURL = (type, data, opts) => {
queryStrings.push(`${key}=${encodeURIComponent(data[key])}`) queryStrings.push(`${key}=${encodeURIComponent(data[key])}`)
}) })
return `http://${opts.proxy.hostname}/api/2/get/${type}?${queryStrings.join( return `https://${opts.proxy.hostname}/api/2/get/${type}?${queryStrings.join(
'&' '&'
)}` )}`
} }

2
dist/doip.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "doipjs", "name": "doipjs",
"version": "0.12.0", "version": "0.12.1",
"description": "Decentralized OpenPGP Identity Proofs library in Node.js", "description": "Decentralized OpenPGP Identity Proofs library in Node.js",
"main": "src/index.js", "main": "src/index.js",
"dependencies": { "dependencies": {
@ -35,7 +35,7 @@
"prettier": "^2.1.2" "prettier": "^2.1.2"
}, },
"scripts": { "scripts": {
"release:bundle": "./node_modules/.bin/browserify ./src/index.js --full-paths --standalone doip -x openpgp -x jsdom -x @xmpp/client -x @xmpp/debug -x irc-upd -o ./dist/doip.js", "release:bundle": "./node_modules/.bin/browserify ./src/index.js --standalone doip -x openpgp -x jsdom -x @xmpp/client -x @xmpp/debug -x irc-upd -o ./dist/doip.js",
"release:minify": "./node_modules/.bin/minify ./dist/doip.js > ./dist/doip.min.js", "release:minify": "./node_modules/.bin/minify ./dist/doip.js > ./dist/doip.min.js",
"prettier:check": "./node_modules/.bin/prettier --check .", "prettier:check": "./node_modules/.bin/prettier --check .",
"prettier:write": "./node_modules/.bin/prettier --write .", "prettier:write": "./node_modules/.bin/prettier --write .",