forked from Mirrors/doipjs
Release 0.11.1
This commit is contained in:
parent
7641d1639a
commit
bd9247a566
7 changed files with 44 additions and 21 deletions
|
@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.11.1] - 2021-03-06
|
||||||
|
## Fixed
|
||||||
|
- Proxy URL encoding
|
||||||
|
|
||||||
## [0.11.0] - 2021-03-05
|
## [0.11.0] - 2021-03-05
|
||||||
## Added
|
## Added
|
||||||
- IRC service provider
|
- IRC service provider
|
||||||
|
|
45
dist/doip.js
vendored
45
dist/doip.js
vendored
|
@ -1742,7 +1742,7 @@ module.exports = str => encodeURIComponent(str).replace(/[!'()*]/g, x => `%${x.c
|
||||||
},{}],14:[function(require,module,exports){
|
},{}],14:[function(require,module,exports){
|
||||||
module.exports={
|
module.exports={
|
||||||
"name": "doipjs",
|
"name": "doipjs",
|
||||||
"version": "0.11.0",
|
"version": "0.11.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": {
|
||||||
|
@ -3481,7 +3481,11 @@ const processURI = (uri, opts) => {
|
||||||
if (match[2]) {
|
if (match[2]) {
|
||||||
const params = queryString.parse(match[2])
|
const params = queryString.parse(match[2])
|
||||||
if ('org.keyoxide.e' in params && 'org.keyoxide.r' in params) {
|
if ('org.keyoxide.e' in params && 'org.keyoxide.r' in params) {
|
||||||
proofUrl = utils.generateProxyURL('matrix', [params['org.keyoxide.r'], params['org.keyoxide.e']], opts)
|
proofUrl = utils.generateProxyURL(
|
||||||
|
'matrix',
|
||||||
|
[params['org.keyoxide.r'], params['org.keyoxide.e']],
|
||||||
|
opts
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3517,7 +3521,8 @@ const tests = [
|
||||||
shouldMatch: true,
|
shouldMatch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
uri: 'matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123',
|
uri:
|
||||||
|
'matrix:u/@alice:matrix.domain.org?org.keyoxide.r=!123:domain.org&org.keyoxide.e=$123',
|
||||||
shouldMatch: true,
|
shouldMatch: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -3715,10 +3720,14 @@ const customRequestHandler = async (spData, opts) => {
|
||||||
// Attempt direct verification if policy allows it
|
// Attempt direct verification if policy allows it
|
||||||
if (opts.proxyPolicy !== 'always') {
|
if (opts.proxyPolicy !== 'always') {
|
||||||
if ('twitterBearerToken' in opts && opts.twitterBearerToken) {
|
if ('twitterBearerToken' in opts && opts.twitterBearerToken) {
|
||||||
const res = await req(`https://api.twitter.com/1.1/statuses/show.json?id=${match[2]}`, null, {
|
const res = await req(
|
||||||
Accept: 'application/json',
|
`https://api.twitter.com/1.1/statuses/show.json?id=${match[2]}`,
|
||||||
Authorization: `Bearer ${opts.twitterBearerToken}`
|
null,
|
||||||
})
|
{
|
||||||
|
Accept: 'application/json',
|
||||||
|
Authorization: `Bearer ${opts.twitterBearerToken}`,
|
||||||
|
}
|
||||||
|
)
|
||||||
const json = await res.json()
|
const json = await res.json()
|
||||||
return json.text
|
return json.text
|
||||||
} else if ('nitterInstance' in opts && opts.nitterInstance) {
|
} else if ('nitterInstance' in opts && opts.nitterInstance) {
|
||||||
|
@ -3733,15 +3742,15 @@ const customRequestHandler = async (spData, opts) => {
|
||||||
return req(utils.generateProxyURL('twitter', match[2], opts), null, {
|
return req(utils.generateProxyURL('twitter', match[2], opts), null, {
|
||||||
Accept: 'application/json',
|
Accept: 'application/json',
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
return await res.json()
|
return await res.json()
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
return res.data.text
|
return res.data.text
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
reject(e)
|
reject(e)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// No verification
|
// No verification
|
||||||
|
@ -4025,7 +4034,9 @@ const generateProxyURL = (type, urlElements, opts) => {
|
||||||
urlElements = [urlElements]
|
urlElements = [urlElements]
|
||||||
}
|
}
|
||||||
|
|
||||||
urlElements.map((x) => { encodeURIComponent(x) })
|
urlElements = urlElements.map((x) => {
|
||||||
|
return encodeURIComponent(x)
|
||||||
|
})
|
||||||
|
|
||||||
return `https://${
|
return `https://${
|
||||||
opts.doipProxyHostname
|
opts.doipProxyHostname
|
||||||
|
|
2
dist/doip.min.js
vendored
2
dist/doip.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,4 +1,4 @@
|
||||||
# doip.js <small>0.11.0</small>
|
# doip.js <small>0.11.1</small>
|
||||||
|
|
||||||
<img src="doip.png" width="120">
|
<img src="doip.png" width="120">
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [0.11.1]
|
||||||
|
|
||||||
|
[2021-03-06](https://codeberg.org/keyoxide/doipjs/releases/tag/0.11.1)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Proxy URL encoding
|
||||||
|
|
||||||
|
|
||||||
## [0.11.0]
|
## [0.11.0]
|
||||||
|
|
||||||
[2021-03-05](https://codeberg.org/keyoxide/doipjs/releases/tag/0.11.0)
|
[2021-03-05](https://codeberg.org/keyoxide/doipjs/releases/tag/0.11.0)
|
||||||
|
|
|
@ -15,7 +15,7 @@ npm install --save doipjs
|
||||||
Install on website by including the following HTML snippet:
|
Install on website by including the following HTML snippet:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="https://cdn.jsdelivr.net/npm/doipjs@0.11.0/dist/doip.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/doipjs@0.11.1/dist/doip.min.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
Next step: [quick start (Node.js)](quickstart-nodejs.md) and [quick start (browser)](quickstart-browser.md)
|
Next step: [quick start (Node.js)](quickstart-nodejs.md) and [quick start (browser)](quickstart-browser.md)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "doipjs",
|
"name": "doipjs",
|
||||||
"version": "0.11.0",
|
"version": "0.11.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": {
|
||||||
|
|
Loading…
Reference in a new issue