mirror of
https://codeberg.org/keyoxide/doipjs.git
synced 2024-12-22 14:39:28 -07:00
chore: release 1.2.0
This commit is contained in:
parent
ea8eb234ad
commit
bd864b796d
9 changed files with 213 additions and 103 deletions
|
@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.2.0] - 2023-09-23
|
||||||
|
### Added
|
||||||
|
- Allow service providers to validate the claim verification result (useful for forks)
|
||||||
|
- Support for Forgejo claims
|
||||||
|
|
||||||
## [1.1.1] - 2023-09-22
|
## [1.1.1] - 2023-09-22
|
||||||
### Fixed
|
### Fixed
|
||||||
- Normalize case before hashed proof verification
|
- Normalize case before hashed proof verification
|
||||||
|
|
295
dist/doip.core.js
vendored
295
dist/doip.core.js
vendored
|
@ -3004,14 +3004,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$k = /^dns:([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;
|
const reURI$l = /^dns:([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$k (uri) {
|
function processURI$l (uri) {
|
||||||
const match = uri.match(reURI$k);
|
const match = uri.match(reURI$l);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3024,7 +3024,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$k.toString(),
|
uriRegularExpression: reURI$l.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3049,7 +3049,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$k = [
|
const tests$l = [
|
||||||
{
|
{
|
||||||
uri: 'dns:domain.org',
|
uri: 'dns:domain.org',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3066,9 +3066,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var dns = /*#__PURE__*/Object.freeze({
|
var dns = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$k,
|
processURI: processURI$l,
|
||||||
reURI: reURI$k,
|
reURI: reURI$l,
|
||||||
tests: tests$k
|
tests: tests$l
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3087,14 +3087,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$j = /^irc:\/\/(.*)\/([a-zA-Z0-9\-[\]\\`_^{|}]*)/;
|
const reURI$k = /^irc:\/\/(.*)\/([a-zA-Z0-9\-[\]\\`_^{|}]*)/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$j (uri) {
|
function processURI$k (uri) {
|
||||||
const match = uri.match(reURI$j);
|
const match = uri.match(reURI$k);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3107,7 +3107,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$j.toString(),
|
uriRegularExpression: reURI$k.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3133,7 +3133,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$j = [
|
const tests$k = [
|
||||||
{
|
{
|
||||||
uri: 'irc://chat.ircserver.org/Alice1',
|
uri: 'irc://chat.ircserver.org/Alice1',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3154,9 +3154,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var irc = /*#__PURE__*/Object.freeze({
|
var irc = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$j,
|
processURI: processURI$k,
|
||||||
reURI: reURI$j,
|
reURI: reURI$k,
|
||||||
tests: tests$j
|
tests: tests$k
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3175,14 +3175,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$i = /^xmpp:([a-zA-Z0-9.\-_]*)@([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;
|
const reURI$j = /^xmpp:([a-zA-Z0-9.\-_]*)@([a-zA-Z0-9.\-_]*)(?:\?(.*))?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$i (uri) {
|
function processURI$j (uri) {
|
||||||
const match = uri.match(reURI$i);
|
const match = uri.match(reURI$j);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3196,7 +3196,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: uri
|
qr: uri
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$i.toString(),
|
uriRegularExpression: reURI$j.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3221,7 +3221,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$i = [
|
const tests$j = [
|
||||||
{
|
{
|
||||||
uri: 'xmpp:alice@domain.org',
|
uri: 'xmpp:alice@domain.org',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3238,9 +3238,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var xmpp = /*#__PURE__*/Object.freeze({
|
var xmpp = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$i,
|
processURI: processURI$j,
|
||||||
reURI: reURI$i,
|
reURI: reURI$j,
|
||||||
tests: tests$i
|
tests: tests$j
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3259,14 +3259,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$h = /^matrix:u\/(?:@)?([^@:]*:[^?]*)(\?.*)?/;
|
const reURI$i = /^matrix:u\/(?:@)?([^@:]*:[^?]*)(\?.*)?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$h (uri) {
|
function processURI$i (uri) {
|
||||||
const match = uri.match(reURI$h);
|
const match = uri.match(reURI$i);
|
||||||
|
|
||||||
if (!match[2]) {
|
if (!match[2]) {
|
||||||
return null
|
return null
|
||||||
|
@ -3296,7 +3296,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$h.toString(),
|
uriRegularExpression: reURI$i.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3322,7 +3322,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$h = [
|
const tests$i = [
|
||||||
{
|
{
|
||||||
uri:
|
uri:
|
||||||
'matrix:u/alice:matrix.domain.org?org.keyoxide.r=123:domain.org&org.keyoxide.e=123',
|
'matrix:u/alice:matrix.domain.org?org.keyoxide.r=123:domain.org&org.keyoxide.e=123',
|
||||||
|
@ -3349,9 +3349,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var matrix = /*#__PURE__*/Object.freeze({
|
var matrix = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$h,
|
processURI: processURI$i,
|
||||||
reURI: reURI$h,
|
reURI: reURI$i,
|
||||||
tests: tests$h
|
tests: tests$i
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3370,14 +3370,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$g = /https:\/\/t.me\/([A-Za-z0-9_]{5,32})\?proof=([A-Za-z0-9_]{5,32})/;
|
const reURI$h = /https:\/\/t.me\/([A-Za-z0-9_]{5,32})\?proof=([A-Za-z0-9_]{5,32})/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$g (uri) {
|
function processURI$h (uri) {
|
||||||
const match = uri.match(reURI$g);
|
const match = uri.match(reURI$h);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3391,7 +3391,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: `https://t.me/${match[1]}`
|
qr: `https://t.me/${match[1]}`
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$g.toString(),
|
uriRegularExpression: reURI$h.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3417,7 +3417,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$g = [
|
const tests$h = [
|
||||||
{
|
{
|
||||||
uri: 'https://t.me/alice?proof=foobar',
|
uri: 'https://t.me/alice?proof=foobar',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3442,9 +3442,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var telegram = /*#__PURE__*/Object.freeze({
|
var telegram = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$g,
|
processURI: processURI$h,
|
||||||
reURI: reURI$g,
|
reURI: reURI$h,
|
||||||
tests: tests$g
|
tests: tests$h
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3463,14 +3463,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$f = /^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;
|
const reURI$g = /^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$f (uri) {
|
function processURI$g (uri) {
|
||||||
const match = uri.match(reURI$f);
|
const match = uri.match(reURI$g);
|
||||||
|
|
||||||
const urlsp = new URLSearchParams();
|
const urlsp = new URLSearchParams();
|
||||||
urlsp.set('url', match[0]);
|
urlsp.set('url', match[0]);
|
||||||
|
@ -3488,7 +3488,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$f.toString(),
|
uriRegularExpression: reURI$g.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3515,7 +3515,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$f = [
|
const tests$g = [
|
||||||
{
|
{
|
||||||
uri: 'https://twitter.com/alice/status/1234567890123456789',
|
uri: 'https://twitter.com/alice/status/1234567890123456789',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3532,9 +3532,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var twitter = /*#__PURE__*/Object.freeze({
|
var twitter = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$f,
|
processURI: processURI$g,
|
||||||
reURI: reURI$f,
|
reURI: reURI$g,
|
||||||
tests: tests$f
|
tests: tests$g
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3553,14 +3553,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$e = /^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;
|
const reURI$f = /^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$e (uri) {
|
function processURI$f (uri) {
|
||||||
const match = uri.match(reURI$e);
|
const match = uri.match(reURI$f);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3574,7 +3574,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$e.toString(),
|
uriRegularExpression: reURI$f.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3600,7 +3600,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$e = [
|
const tests$f = [
|
||||||
{
|
{
|
||||||
uri: 'https://www.reddit.com/user/Alice/comments/123456/post',
|
uri: 'https://www.reddit.com/user/Alice/comments/123456/post',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3625,9 +3625,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var reddit = /*#__PURE__*/Object.freeze({
|
var reddit = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$e,
|
processURI: processURI$f,
|
||||||
reURI: reURI$e,
|
reURI: reURI$f,
|
||||||
tests: tests$e
|
tests: tests$f
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3646,14 +3646,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$d = /^https:\/\/liberapay\.com\/(.*)\/?/;
|
const reURI$e = /^https:\/\/liberapay\.com\/(.*)\/?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$d (uri) {
|
function processURI$e (uri) {
|
||||||
const match = uri.match(reURI$d);
|
const match = uri.match(reURI$e);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3667,7 +3667,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$d.toString(),
|
uriRegularExpression: reURI$e.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3693,7 +3693,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$d = [
|
const tests$e = [
|
||||||
{
|
{
|
||||||
uri: 'https://liberapay.com/alice',
|
uri: 'https://liberapay.com/alice',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3710,9 +3710,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var liberapay = /*#__PURE__*/Object.freeze({
|
var liberapay = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$d,
|
processURI: processURI$e,
|
||||||
reURI: reURI$d,
|
reURI: reURI$e,
|
||||||
tests: tests$d
|
tests: tests$e
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3731,14 +3731,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$c = /^https:\/\/lichess\.org\/@\/(.*)\/?/;
|
const reURI$d = /^https:\/\/lichess\.org\/@\/(.*)\/?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$c (uri) {
|
function processURI$d (uri) {
|
||||||
const match = uri.match(reURI$c);
|
const match = uri.match(reURI$d);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3751,7 +3751,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$c.toString(),
|
uriRegularExpression: reURI$d.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3777,7 +3777,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$c = [
|
const tests$d = [
|
||||||
{
|
{
|
||||||
uri: 'https://lichess.org/@/Alice',
|
uri: 'https://lichess.org/@/Alice',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3794,9 +3794,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var lichess = /*#__PURE__*/Object.freeze({
|
var lichess = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$c,
|
processURI: processURI$d,
|
||||||
reURI: reURI$c,
|
reURI: reURI$d,
|
||||||
tests: tests$c
|
tests: tests$d
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3815,14 +3815,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$b = /^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;
|
const reURI$c = /^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$b (uri) {
|
function processURI$c (uri) {
|
||||||
const match = uri.match(reURI$b);
|
const match = uri.match(reURI$c);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3836,7 +3836,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$b.toString(),
|
uriRegularExpression: reURI$c.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3862,7 +3862,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$b = [
|
const tests$c = [
|
||||||
{
|
{
|
||||||
uri: 'https://news.ycombinator.com/user?id=Alice',
|
uri: 'https://news.ycombinator.com/user?id=Alice',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3879,9 +3879,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var hackernews = /*#__PURE__*/Object.freeze({
|
var hackernews = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$b,
|
processURI: processURI$c,
|
||||||
reURI: reURI$b,
|
reURI: reURI$c,
|
||||||
tests: tests$b
|
tests: tests$c
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3900,14 +3900,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$a = /^https:\/\/lobste\.rs\/u\/(.*)\/?/;
|
const reURI$b = /^https:\/\/lobste\.rs\/u\/(.*)\/?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$a (uri) {
|
function processURI$b (uri) {
|
||||||
const match = uri.match(reURI$a);
|
const match = uri.match(reURI$b);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -3921,7 +3921,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$a.toString(),
|
uriRegularExpression: reURI$b.toString(),
|
||||||
uriIsAmbiguous: false
|
uriIsAmbiguous: false
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -3947,7 +3947,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$a = [
|
const tests$b = [
|
||||||
{
|
{
|
||||||
uri: 'https://lobste.rs/u/Alice',
|
uri: 'https://lobste.rs/u/Alice',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -3964,9 +3964,9 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var lobsters = /*#__PURE__*/Object.freeze({
|
var lobsters = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
processURI: processURI$a,
|
processURI: processURI$b,
|
||||||
reURI: reURI$a,
|
reURI: reURI$b,
|
||||||
tests: tests$a
|
tests: tests$b
|
||||||
});
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3985,14 +3985,14 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const reURI$9 = /^https:\/\/(.*)\/(.*)\/(.*)\/?/;
|
const reURI$a = /^https:\/\/(.*)\/(.*)\/(.*)\/?/;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @function
|
* @function
|
||||||
* @param {string} uri
|
* @param {string} uri
|
||||||
*/
|
*/
|
||||||
function processURI$9 (uri) {
|
function processURI$a (uri) {
|
||||||
const match = uri.match(reURI$9);
|
const match = uri.match(reURI$a);
|
||||||
|
|
||||||
return new ServiceProvider({
|
return new ServiceProvider({
|
||||||
about: {
|
about: {
|
||||||
|
@ -4006,7 +4006,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
qr: null
|
qr: null
|
||||||
},
|
},
|
||||||
claim: {
|
claim: {
|
||||||
uriRegularExpression: reURI$9.toString().toString(),
|
uriRegularExpression: reURI$a.toString().toString(),
|
||||||
uriIsAmbiguous: true
|
uriIsAmbiguous: true
|
||||||
},
|
},
|
||||||
proof: {
|
proof: {
|
||||||
|
@ -4032,7 +4032,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const tests$9 = [
|
const tests$a = [
|
||||||
{
|
{
|
||||||
uri: 'https://domain.org/alice/post',
|
uri: 'https://domain.org/alice/post',
|
||||||
shouldMatch: true
|
shouldMatch: true
|
||||||
|
@ -4049,6 +4049,104 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
|
|
||||||
var forem = /*#__PURE__*/Object.freeze({
|
var forem = /*#__PURE__*/Object.freeze({
|
||||||
__proto__: null,
|
__proto__: null,
|
||||||
|
processURI: processURI$a,
|
||||||
|
reURI: reURI$a,
|
||||||
|
tests: tests$a
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
Copyright 2023 Yarmo Mackenbach
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const reURI$9 = /^https:\/\/(.*)\/(.*)\/(.*)\/?/;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @function
|
||||||
|
* @param {string} uri
|
||||||
|
*/
|
||||||
|
function processURI$9 (uri) {
|
||||||
|
const match = uri.match(reURI$9);
|
||||||
|
|
||||||
|
return new ServiceProvider({
|
||||||
|
about: {
|
||||||
|
id: 'forgejo',
|
||||||
|
name: 'Forgejo',
|
||||||
|
homepage: 'https://forgejo.org'
|
||||||
|
},
|
||||||
|
profile: {
|
||||||
|
display: `${match[2]}@${match[1]}`,
|
||||||
|
uri: `https://${match[1]}/${match[2]}`,
|
||||||
|
qr: null
|
||||||
|
},
|
||||||
|
claim: {
|
||||||
|
uriRegularExpression: reURI$9.toString(),
|
||||||
|
uriIsAmbiguous: true
|
||||||
|
},
|
||||||
|
proof: {
|
||||||
|
request: {
|
||||||
|
uri,
|
||||||
|
fetcher: Fetcher.HTTP,
|
||||||
|
accessRestriction: ProofAccessRestriction.NOCORS,
|
||||||
|
data: {
|
||||||
|
url: `https://${match[1]}/api/v1/repos/${match[2]}/${match[3]}`,
|
||||||
|
format: ProofFormat.JSON
|
||||||
|
}
|
||||||
|
},
|
||||||
|
response: {
|
||||||
|
format: ProofFormat.JSON
|
||||||
|
},
|
||||||
|
target: [{
|
||||||
|
format: ClaimFormat.URI,
|
||||||
|
encoding: EntityEncodingFormat.PLAIN,
|
||||||
|
relation: ClaimRelation.EQUALS,
|
||||||
|
path: ['description']
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const functions$1 = {
|
||||||
|
validate: async (/** @type {ServiceProvider} */ claimData, proofData, opts) => {
|
||||||
|
const url = `https://${new URL(claimData.proof.request.uri).hostname}/api/forgejo/v1/version`;
|
||||||
|
const forgejoData = await fetcher__namespace.http.fn({ url, format: ProofFormat.JSON }, opts);
|
||||||
|
return forgejoData && 'version' in forgejoData
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const tests$9 = [
|
||||||
|
{
|
||||||
|
uri: 'https://domain.org/alice/forgejo_proof',
|
||||||
|
shouldMatch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
uri: 'https://domain.org/alice/forgejo_proof/',
|
||||||
|
shouldMatch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
uri: 'https://domain.org/alice/other_proof',
|
||||||
|
shouldMatch: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
uri: 'https://domain.org/alice',
|
||||||
|
shouldMatch: false
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
var forgejo = /*#__PURE__*/Object.freeze({
|
||||||
|
__proto__: null,
|
||||||
|
functions: functions$1,
|
||||||
processURI: processURI$9,
|
processURI: processURI$9,
|
||||||
reURI: reURI$9,
|
reURI: reURI$9,
|
||||||
tests: tests$9
|
tests: tests$9
|
||||||
|
@ -5079,7 +5177,7 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
hackernews,
|
hackernews,
|
||||||
lobsters,
|
lobsters,
|
||||||
forem,
|
forem,
|
||||||
// forgejo,
|
forgejo,
|
||||||
gitea,
|
gitea,
|
||||||
gitlab,
|
gitlab,
|
||||||
github,
|
github,
|
||||||
|
@ -5435,8 +5533,15 @@ var doip = (function (exports, openpgp$1, fetcher) {
|
||||||
viaProxy: proofData.viaProxy
|
viaProxy: proofData.viaProxy
|
||||||
};
|
};
|
||||||
|
|
||||||
// Post process the data
|
// Validate the result
|
||||||
const def = _data[claimData.about.id];
|
const def = _data[claimData.about.id];
|
||||||
|
if (def.functions?.validate && verificationResult.completed && verificationResult.result) {
|
||||||
|
try {
|
||||||
|
(verificationResult.result = await def.functions.validate(claimData, proofData, verificationResult, opts$1));
|
||||||
|
} catch (_) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Post process the data
|
||||||
if (def.functions?.postprocess) {
|
if (def.functions?.postprocess) {
|
||||||
try {
|
try {
|
||||||
({ claimData, proofData } = await def.functions.postprocess(claimData, proofData, opts$1));
|
({ claimData, proofData } = await def.functions.postprocess(claimData, proofData, opts$1));
|
||||||
|
|
4
dist/doip.core.min.js
vendored
4
dist/doip.core.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/doip.fetchers.js
vendored
2
dist/doip.fetchers.js
vendored
|
@ -2728,7 +2728,7 @@ var doipFetchers = (function (exports) {
|
||||||
* doip.js library version
|
* doip.js library version
|
||||||
* @constant {string}
|
* @constant {string}
|
||||||
*/
|
*/
|
||||||
const version = '1.1.1';
|
const version = '1.2.0';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2022 Yarmo Mackenbach
|
Copyright 2022 Yarmo Mackenbach
|
||||||
|
|
2
dist/doip.fetchers.min.js
vendored
2
dist/doip.fetchers.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/doip.fetchers.minimal.js
vendored
2
dist/doip.fetchers.minimal.js
vendored
|
@ -2698,7 +2698,7 @@ var doipFetchers = (function (exports) {
|
||||||
* doip.js library version
|
* doip.js library version
|
||||||
* @constant {string}
|
* @constant {string}
|
||||||
*/
|
*/
|
||||||
const version = '1.1.1';
|
const version = '1.2.0';
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Copyright 2022 Yarmo Mackenbach
|
Copyright 2022 Yarmo Mackenbach
|
||||||
|
|
2
dist/doip.fetchers.minimal.min.js
vendored
2
dist/doip.fetchers.minimal.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "doipjs",
|
"name": "doipjs",
|
||||||
"version": "1.1.1",
|
"version": "1.2.0",
|
||||||
"description": "Decentralized Online Identity Proofs library in Node.js",
|
"description": "Decentralized Online Identity Proofs library in Node.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
|
|
|
@ -22,4 +22,4 @@ limitations under the License.
|
||||||
* doip.js library version
|
* doip.js library version
|
||||||
* @constant {string}
|
* @constant {string}
|
||||||
*/
|
*/
|
||||||
export const version = '1.1.1'
|
export const version = '1.2.0'
|
||||||
|
|
Loading…
Reference in a new issue