forked from Mirrors/doipjs
1 line
24 KiB
JavaScript
1 line
24 KiB
JavaScript
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).doip=e()}}((function(){return function e(t,r,o){function i(s,a){if(!r[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(n)return n(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};t[s][0].call(l.exports,(function(e){return i(t[s][1][e]||e)}),l,l.exports,e,t,r,o)}return r[s].exports}for(var n="function"==typeof require&&require,s=0;s<o.length;s++)i(o[s]);return i}({1:[function(e,t,r){"use strict";const o=e("./core");class i extends Error{constructor(e,...t){let r;super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="StatusError",this.message=e.statusMessage,this.statusCode=e.status,this.res=e,this.json=e.json.bind(e),this.text=e.text.bind(e),this.arrayBuffer=e.arrayBuffer.bind(e);Object.defineProperty(this,"responseBody",{get:()=>(r||(r=this.arrayBuffer()),r)}),this.headers={};for(const[t,r]of e.headers.entries())this.headers[t.toLowerCase()]=r}}t.exports=o(((e,t,r,o,n)=>async(s,a,c={})=>{s=n+(s||"");let u=new URL(s);if(o||(o={}),u.username&&(o.Authorization="Basic "+btoa(u.username+":"+u.password),u=new URL(u.protocol+"//"+u.host+u.pathname+u.search)),"https:"!==u.protocol&&"http:"!==u.protocol)throw new Error("Unknown protocol, "+u.protocol);if(a)if(a instanceof ArrayBuffer||ArrayBuffer.isView(a)||"string"==typeof a);else{if("object"!=typeof a)throw new Error("Unknown body type.");a=JSON.stringify(a),o["Content-Type"]="application/json"}c=new Headers({...o||{},...c});const l=await fetch(u,{method:t,headers:c,body:a});if(l.statusCode=l.status,!e.has(l.status))throw new i(l);return"json"===r?l.json():"buffer"===r?l.arrayBuffer():"string"===r?l.text():l}))},{"./core":2}],2:[function(e,t,r){"use strict";const o=new Set(["json","buffer","string"]);t.exports=e=>(...t)=>{const r=new Set;let i,n,s,a="";return t.forEach((e=>{if("string"==typeof e)if(e.toUpperCase()===e){if(i){throw new Error(`Can't set method to ${e}, already set to ${i}.`)}i=e}else if(e.startsWith("http:")||e.startsWith("https:"))a=e;else{if(!o.has(e))throw new Error("Unknown encoding, "+e);n=e}else if("number"==typeof e)r.add(e);else{if("object"!=typeof e)throw new Error("Unknown type: "+typeof e);if(Array.isArray(e)||e instanceof Set)e.forEach((e=>r.add(e)));else{if(s)throw new Error("Cannot set headers twice.");s=e}}})),i||(i="GET"),0===r.size&&r.add(200),e(r,i,n,s,a)}},{}],3:[function(e,t,r){},{}],4:[function(e,t,r){(function(r){(function(){const o=e("fs"),i=e("path");function n(e){console.log("[dotenv][DEBUG] "+e)}const s=/^\s*([\w.-]+)\s*=\s*(.*)?\s*$/,a=/\\n/g,c=/\n|\r|\r\n/;function u(e,t){const r=Boolean(t&&t.debug),o={};return e.toString().split(c).forEach((function(e,t){const i=e.match(s);if(null!=i){const e=i[1];let t=i[2]||"";const r=t.length-1,n='"'===t[0]&&'"'===t[r];"'"===t[0]&&"'"===t[r]||n?(t=t.substring(1,r),n&&(t=t.replace(a,"\n"))):t=t.trim(),o[e]=t}else r&&n(`did not match key and value when parsing line ${t+1}: ${e}`)})),o}t.exports.config=function(e){let t=i.resolve(r.cwd(),".env"),s="utf8",a=!1;e&&(null!=e.path&&(t=e.path),null!=e.encoding&&(s=e.encoding),null!=e.debug&&(a=!0));try{const e=u(o.readFileSync(t,{encoding:s}),{debug:a});return Object.keys(e).forEach((function(t){Object.prototype.hasOwnProperty.call(r.env,t)?a&&n(`"${t}" is already defined in \`process.env\` and will not be overwritten`):r.env[t]=e[t]})),{parsed:e}}catch(e){return{error:e}}},t.exports.parse=u}).call(this)}).call(this,e("_process"))},{_process:6,fs:3,path:5}],5:[function(e,t,r){(function(e){(function(){"use strict";function r(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function o(e,t){for(var r,o="",i=0,n=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(n===a-1||1===s);else if(n!==a-1&&2===s){if(o.length<2||2!==i||46!==o.charCodeAt(o.length-1)||46!==o.charCodeAt(o.length-2))if(o.length>2){var c=o.lastIndexOf("/");if(c!==o.length-1){-1===c?(o="",i=0):i=(o=o.slice(0,c)).length-1-o.lastIndexOf("/"),n=a,s=0;continue}}else if(2===o.length||1===o.length){o="",i=0,n=a,s=0;continue}t&&(o.length>0?o+="/..":o="..",i=2)}else o.length>0?o+="/"+e.slice(n+1,a):o=e.slice(n+1,a),i=a-n-1;n=a,s=0}else 46===r&&-1!==s?++s:s=-1}return o}var i={resolve:function(){for(var t,i="",n=!1,s=arguments.length-1;s>=-1&&!n;s--){var a;s>=0?a=arguments[s]:(void 0===t&&(t=e.cwd()),a=t),r(a),0!==a.length&&(i=a+"/"+i,n=47===a.charCodeAt(0))}return i=o(i,!n),n?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(r(e),0===e.length)return".";var t=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=o(e,!t)).length||t||(e="."),e.length>0&&i&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return r(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var o=arguments[t];r(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":i.normalize(e)},relative:function(e,t){if(r(e),r(t),e===t)return"";if((e=i.resolve(e))===(t=i.resolve(t)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var n=e.length,s=n-o,a=1;a<t.length&&47===t.charCodeAt(a);++a);for(var c=t.length-a,u=s<c?s:c,l=-1,p=0;p<=u;++p){if(p===u){if(c>u){if(47===t.charCodeAt(a+p))return t.slice(a+p+1);if(0===p)return t.slice(a+p)}else s>u&&(47===e.charCodeAt(o+p)?l=p:0===p&&(l=0));break}var h=e.charCodeAt(o+p);if(h!==t.charCodeAt(a+p))break;47===h&&(l=p)}var f="";for(p=o+l+1;p<=n;++p)p!==n&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+t.slice(a+l):(a+=l,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(r(e),0===e.length)return".";for(var t=e.charCodeAt(0),o=47===t,i=-1,n=!0,s=e.length-1;s>=1;--s)if(47===(t=e.charCodeAt(s))){if(!n){i=s;break}}else n=!1;return-1===i?o?"/":".":o&&1===i?"//":e.slice(0,i)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');r(e);var o,i=0,n=-1,s=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(o=e.length-1;o>=0;--o){var u=e.charCodeAt(o);if(47===u){if(!s){i=o+1;break}}else-1===c&&(s=!1,c=o+1),a>=0&&(u===t.charCodeAt(a)?-1==--a&&(n=o):(a=-1,n=c))}return i===n?n=c:-1===n&&(n=e.length),e.slice(i,n)}for(o=e.length-1;o>=0;--o)if(47===e.charCodeAt(o)){if(!s){i=o+1;break}}else-1===n&&(s=!1,n=o+1);return-1===n?"":e.slice(i,n)},extname:function(e){r(e);for(var t=-1,o=0,i=-1,n=!0,s=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===i&&(n=!1,i=a+1),46===c?-1===t?t=a:1!==s&&(s=1):-1!==t&&(s=-1);else if(!n){o=a+1;break}}return-1===t||-1===i||0===s||1===s&&t===i-1&&t===o+1?"":e.slice(t,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,o=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+o:r+e+o:o}("/",e)},parse:function(e){r(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var o,i=e.charCodeAt(0),n=47===i;n?(t.root="/",o=1):o=0;for(var s=-1,a=0,c=-1,u=!0,l=e.length-1,p=0;l>=o;--l)if(47!==(i=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===i?-1===s?s=l:1!==p&&(p=1):-1!==s&&(p=-1);else if(!u){a=l+1;break}return-1===s||-1===c||0===p||1===p&&s===c-1&&s===a+1?-1!==c&&(t.base=t.name=0===a&&n?e.slice(1,c):e.slice(a,c)):(0===a&&n?(t.name=e.slice(1,s),t.base=e.slice(1,c)):(t.name=e.slice(a,s),t.base=e.slice(a,c)),t.ext=e.slice(s,c)),a>0?t.dir=e.slice(0,a-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};i.posix=i,t.exports=i}).call(this)}).call(this,e("_process"))},{_process:6}],6:[function(e,t,r){var o,i,n=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(o===setTimeout)return setTimeout(e,0);if((o===s||!o)&&setTimeout)return o=setTimeout,setTimeout(e,0);try{return o(e,0)}catch(t){try{return o.call(null,e,0)}catch(t){return o.call(this,e,0)}}}!function(){try{o="function"==typeof setTimeout?setTimeout:s}catch(e){o=s}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var u,l=[],p=!1,h=-1;function f(){p&&u&&(p=!1,u.length?l=u.concat(l):h=-1,l.length&&d())}function d(){if(!p){var e=c(f);p=!0;for(var t=l.length;t;){for(u=l,l=[];++h<t;)u&&u[h].run();h=-1,t=l.length}u=null,p=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new m(e,t)),1!==l.length||p||c(d)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},{}],7:[function(e,t,r){!function(e){"use strict";e.exports.is_uri=r,e.exports.is_http_uri=o,e.exports.is_https_uri=i,e.exports.is_web_uri=n,e.exports.isUri=r,e.exports.isHttpUri=o,e.exports.isHttpsUri=i,e.exports.isWebUri=n;var t=function(e){return e.match(/(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/)};function r(e){if(e&&!/[^a-z0-9\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=\.\-\_\~\%]/i.test(e)&&!/%[^0-9a-f]/i.test(e)&&!/%[0-9a-f](:?[^0-9a-f]|$)/i.test(e)){var r,o,i,n,s,a="",c="";if(a=(r=t(e))[1],o=r[2],i=r[3],n=r[4],s=r[5],a&&a.length&&i.length>=0){if(o&&o.length){if(0!==i.length&&!/^\//.test(i))return}else if(/^\/\//.test(i))return;if(/^[a-z][a-z0-9\+\-\.]*$/.test(a.toLowerCase()))return c+=a+":",o&&o.length&&(c+="//"+o),c+=i,n&&n.length&&(c+="?"+n),s&&s.length&&(c+="#"+s),c}}}function o(e,o){if(r(e)){var i,n,s,a,c="",u="",l="",p="";if(c=(i=t(e))[1],u=i[2],n=i[3],s=i[4],a=i[5],c){if(o){if("https"!=c.toLowerCase())return}else if("http"!=c.toLowerCase())return;if(u)return/:(\d+)$/.test(u)&&(l=u.match(/:(\d+)$/)[0],u=u.replace(/:\d+$/,"")),p+=c+":",p+="//"+u,l&&(p+=l),p+=n,s&&s.length&&(p+="?"+s),a&&a.length&&(p+="#"+a),p}}}function i(e){return o(e,!0)}function n(e){return o(e)||i(e)}}(t)},{}],8:[function(e,t,r){const o=e("./utils"),i=(e,t,r,o,n)=>{let s;if(e.isVerified||!t)return e;if(Array.isArray(t))return t.forEach(((t,s)=>{e=i(e,t,r,o,n)})),e;if(0==r.length){switch(n){default:case"contains":s=new RegExp(o.replace("[","\\[").replace("]","\\]"),"gi"),e.isVerified=s.test(t.replace(/\r?\n|\r/,""));break;case"equals":e.isVerified=t.replace(/\r?\n|\r/,"").toLowerCase()==o.toLowerCase();break;case"oneOf":s=new RegExp(o,"gi"),e.isVerified=s.test(t.join("|"))}return e}return r[0]in t?e=i(e,t[r[0]],r.slice(1),o,n):(e.errors.push("err_data_structure_incorrect"),e)};r.run=(e,t)=>{let r={isVerified:!1,errors:[]};switch(t.proof.format){case"json":r=i(r,e,t.claim.path,o.generateClaim(t.claim.fingerprint,t.claim.format),t.claim.relation);break;case"text":re=new RegExp(o.generateClaim(t.claim.fingerprint,t.claim.format),"gi"),r=re.test(e.replace(/\r?\n|\r/,""))}return r}},{"./utils":25}],9:[function(e,t,r){const o=e("valid-url"),i=e("./serviceproviders"),n=e("./claimVerification"),s=e("./utils");r.verify=async(e,t,r)=>{if(t||(t=null),r||(r={}),!o.isUri(e))throw new Error("Not a valid URI");const s=i.match(e,r);if("returnMatchesOnly"in r&&r.returnMatchesOnly)return s;let a,c,u,l,p=!1,h=0;for(;!p&&h<s.length;)l=s[h],l.claim.fingerprint=t,c=null,u=l.customRequestHandler instanceof Function?await l.customRequestHandler(l,r):!l.proof.useProxy||"useProxyWhenNeeded"in r&&!r.useProxyWhenNeeded?await i.directRequestHandler(l):await i.proxyRequestHandler(l),u&&(a=n.run(u,l),0==a.errors.length&&(p=!0)),h++;return a||(a={isVerified:!1}),{isVerified:a.isVerified,matchedServiceprovider:l?l.serviceprovider.name:null,serviceproviderData:l}},r.serviceproviders=i,r.claimVerification=n,r.utils=s},{"./claimVerification":8,"./serviceproviders":10,"./utils":25,"valid-url":7}],10:[function(e,t,r){const o=e("bent")("GET"),i=e("./utils"),n=["dns","xmpp","twitter","reddit","liberapay","hackernews","lobsters","devto","gitea","gitlab","github","mastodon","fediverse","discourse"],s={dns:e("./serviceproviders/dns"),xmpp:e("./serviceproviders/xmpp"),twitter:e("./serviceproviders/twitter"),reddit:e("./serviceproviders/reddit"),liberapay:e("./serviceproviders/liberapay"),hackernews:e("./serviceproviders/hackernews"),lobsters:e("./serviceproviders/lobsters"),devto:e("./serviceproviders/devto"),gitea:e("./serviceproviders/gitea"),gitlab:e("./serviceproviders/gitlab"),github:e("./serviceproviders/github"),mastodon:e("./serviceproviders/mastodon"),fediverse:e("./serviceproviders/fediverse"),discourse:e("./serviceproviders/discourse")};r.list=n,r.data=s,r.match=(e,t)=>{let r,o=[];return n.forEach(((i,n)=>{r=s[i],r.reURI.test(e)&&o.push(r.processURI(e,t))})),o},r.directRequestHandler=async e=>{const t=await o(e.proof.fetch?e.proof.fetch:e.proof.uri,"json",{Accept:"application/json"});switch(e.proof.format){case"json":return await t.json();case"text":return await t.text();default:throw new Error("No specified proof data format")}},r.proxyRequestHandler=async e=>{const t=e.proof.fetch?e.proof.fetch:e.proof.uri,r=await o(i.generateProxyURL(e.proof.format,t),"json",{Accept:"application/json"});return(await r.json()).content}},{"./serviceproviders/devto":11,"./serviceproviders/discourse":12,"./serviceproviders/dns":13,"./serviceproviders/fediverse":14,"./serviceproviders/gitea":15,"./serviceproviders/github":16,"./serviceproviders/gitlab":17,"./serviceproviders/hackernews":18,"./serviceproviders/liberapay":19,"./serviceproviders/lobsters":20,"./serviceproviders/mastodon":21,"./serviceproviders/reddit":22,"./serviceproviders/twitter":23,"./serviceproviders/xmpp":24,"./utils":25,bent:1}],11:[function(e,t,r){const o=/^https:\/\/dev\.to\/(.*)\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"devto"},profile:{display:r[1],uri:"https://dev.to/"+r[1]},proof:{uri:e,fetch:`https://dev.to/api/articles/${r[1]}/${r[2]}`,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["body_markdown"],relation:"contains"},qr:null}},r.tests=[{uri:"https://dev.to/alice/post",shouldMatch:!0},{uri:"https://dev.to/alice/post/",shouldMatch:!0},{uri:"https://domain.org/alice/post",shouldMatch:!1}]},{}],12:[function(e,t,r){const o=/^https:\/\/(.*)\/u\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"discourse"},profile:{display:`${r[2]}@${r[1]}`,uri:e},proof:{uri:e,fetch:`https://${r[1]}/u/${r[2]}.json`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["user","bio_raw"],relation:"contains"},qr:null}},r.tests=[{uri:"https://domain.org/u/alice",shouldMatch:!0},{uri:"https://domain.org/u/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],13:[function(e,t,r){const o=e("../utils"),i=/^dns:([a-zA-Z0-9\.\-\_]*)(?:\?(.*))?/;r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"dns"},profile:{display:r[1],uri:"https://"+r[1]},proof:{uri:o.generateProxyURL("dns",r[1]),fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"uri",path:["records","txt"],relation:"contains"},qr:null}},r.tests=[{uri:"dns:domain.org",shouldMatch:!0},{uri:"dns:domain.org?type=TXT",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]},{"../utils":25}],14:[function(e,t,r){const o=/^https:\/\/(.*)\/users\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"fediverse"},profile:{display:`@${r[2]}@${r[1]}`,uri:e},proof:{uri:e,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"fingerprint",path:["summary"],relation:"contains"},qr:null}},r.tests=[{uri:"https://domain.org/users/alice",shouldMatch:!0},{uri:"https://domain.org/users/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],15:[function(e,t,r){const o=/^https:\/\/(.*)\/(.*)\/gitea_proof\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"gitea"},profile:{display:`${r[2]}@${r[1]}`,uri:`https://${r[1]}/${r[2]}`},proof:{uri:e,fetch:`https://${r[1]}/api/v1/repos/${r[2]}/gitea_proof`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["description"],relation:"equals"},qr:null}},r.tests=[{uri:"https://domain.org/alice/gitea_proof",shouldMatch:!0},{uri:"https://domain.org/alice/gitea_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]},{}],16:[function(e,t,r){const o=/^https:\/\/gist\.github\.com\/(.*)\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"github"},profile:{display:r[1],uri:"https://github.com/"+r[1]},proof:{uri:e,fetch:"https://api.github.com/gists/"+r[2],useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["files","openpgp.md","content"],relation:"contains"},qr:null}},r.tests=[{uri:"https://gist.github.com/Alice/123456789",shouldMatch:!0},{uri:"https://gist.github.com/Alice/123456789/",shouldMatch:!0},{uri:"https://domain.org/Alice/123456789",shouldMatch:!1}]},{}],17:[function(e,t,r){const o=e("bent")("GET"),i=/^https:\/\/(.*)\/(.*)\/gitlab_proof\/?/,n=async(e,t)=>{const r=e.proof.uri.match(i),n=`https://${r[1]}/api/v4/users?username=${r[2]}`,s=await o(n,"json",{Accept:"application/json"}),a=(await s.json()).find((e=>e.username===r[2]));if(!a)throw new Error("No user with username "+r[2]);const c=`https://${r[1]}/api/v4/users/${a.id}/projects`,u=await o(c,{},{Accept:"application/json"}),l=(await u.json()).find((e=>"gitlab_proof"===e.path));if(!l)throw new Error("No project at "+e.proof.uri);return l};r.reURI=i,r.processURI=(e,t)=>{t||(t={});const r=e.match(i);return{serviceprovider:{type:"web",name:"gitlab"},profile:{display:`${r[2]}@${r[1]}`,uri:`https://${r[1]}/${r[2]}`},proof:{uri:e,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["description"],relation:"equals"},qr:null,customRequestHandler:n}},r.tests=[{uri:"https://gitlab.domain.org/alice/gitlab_proof",shouldMatch:!0},{uri:"https://gitlab.domain.org/alice/gitlab_proof/",shouldMatch:!0},{uri:"https://domain.org/alice/other_proof",shouldMatch:!1}]},{bent:1}],18:[function(e,t,r){const o=/^https:\/\/news\.ycombinator\.com\/user\?id=(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"hackernews"},profile:{display:r[1],uri:e},proof:{uri:`https://hacker-news.firebaseio.com/v0/user/${r[1]}.json`,fetch:null,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"uri",path:["about"],relation:"contains"},qr:null}},r.tests=[{uri:"https://news.ycombinator.com/user?id=Alice",shouldMatch:!0},{uri:"https://news.ycombinator.com/user?id=Alice/",shouldMatch:!0},{uri:"https://domain.org/user?id=Alice",shouldMatch:!1}]},{}],19:[function(e,t,r){const o=/^https:\/\/liberapay\.com\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"liberapay"},profile:{display:r[1],uri:e},proof:{uri:e,fetch:`https://liberapay.com/${r[1]}/public.json`,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:["statements","content"],relation:"contains"},qr:null}},r.tests=[{uri:"https://liberapay.com/alice",shouldMatch:!0},{uri:"https://liberapay.com/alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],20:[function(e,t,r){const o=/^https:\/\/lobste\.rs\/u\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"lobsters"},profile:{display:r[1],uri:e},proof:{uri:`https://lobste.rs/u/${r[1]}.json`,fetch:null,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["about"],relation:"contains"},qr:null}},r.tests=[{uri:"https://lobste.rs/u/Alice",shouldMatch:!0},{uri:"https://lobste.rs/u/Alice/",shouldMatch:!0},{uri:"https://domain.org/u/Alice",shouldMatch:!1}]},{}],21:[function(e,t,r){const o=/^https:\/\/(.*)\/@(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"mastodon"},profile:{display:`@${r[2]}@${r[1]}`,uri:e},proof:{uri:e,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"fingerprint",path:["attachment","value"],relation:"contains"},qr:null}},r.tests=[{uri:"https://domain.org/@alice",shouldMatch:!0},{uri:"https://domain.org/@alice/",shouldMatch:!0},{uri:"https://domain.org/alice",shouldMatch:!1}]},{}],22:[function(e,t,r){const o=/^https:\/\/(?:www\.)?reddit\.com\/user\/(.*)\/comments\/(.*)\/(.*)\/?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"reddit"},profile:{display:r[1],uri:"https://www.reddit.com/user/"+r[1]},proof:{uri:e,fetch:`https://www.reddit.com/user/${r[1]}/comments/${r[2]}.json`,useProxy:!0,format:"json"},claim:{fingerprint:null,format:"message",path:["data","children","data","selftext"],relation:"contains"},qr:null}},r.tests=[{uri:"https://www.reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://www.reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post",shouldMatch:!0},{uri:"https://reddit.com/user/Alice/comments/123456/post/",shouldMatch:!0},{uri:"https://domain.org/user/Alice/comments/123456/post",shouldMatch:!1}]},{}],23:[function(e,t,r){const o=/^https:\/\/twitter\.com\/(.*)\/status\/([0-9]*)(?:\?.*)?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"web",name:"twitter"},profile:{display:"@"+r[1],uri:"https://twitter.com/"+r[1]},proof:{uri:e,fetch:`https://mobile.twitter.com/${r[1]}/status/${r[2]}`,useProxy:!1,format:"text"},claim:{fingerprint:null,format:"message",path:[],relation:"contains"},qr:null}},r.tests=[{uri:"https://twitter.com/alice/status/1234567890123456789",shouldMatch:!0},{uri:"https://twitter.com/alice/status/1234567890123456789/",shouldMatch:!0},{uri:"https://domain.org/alice/status/1234567890123456789",shouldMatch:!1}]},{}],24:[function(e,t,r){const o=/^xmpp:([a-zA-Z0-9\.\-\_]*)@([a-zA-Z0-9\.\-\_]*)(?:\?(.*))?/;r.reURI=o,r.processURI=(e,t)=>{t||(t={});const r=e.match(o);return{serviceprovider:{type:"communication",name:"xmpp"},profile:{display:`${r[1]}@${r[2]}`,uri:e},proof:{uri:"xmppVcardServerDomain"in t?`https://${t.xmppVcardServerDomain}/api/vcard/${r[1]}@${r[2]}/DESC`:null,fetch:null,useProxy:!1,format:"json"},claim:{fingerprint:null,format:"message",path:[],relation:"contains"},qr:e}},r.tests=[{uri:"xmpp:alice@domain.org",shouldMatch:!0},{uri:"xmpp:alice@domain.org?omemo-sid-123456789=A1B2C3D4E5F6G7H8I9",shouldMatch:!0},{uri:"https://domain.org",shouldMatch:!1}]},{}],25:[function(e,t,r){(function(t){(function(){e("dotenv").config();const o=t.env.DOIP_PROXY_HOSTNAME||"proxy.keyoxide.org";r.generateProxyURL=(e,t)=>`https://${o}/api/1/get/${e}/${encodeURIComponent(t)}`,r.generateClaim=(e,t)=>{switch(t){case"uri":return"openpgp4fpr:"+e;case"message":return`[Verifying my OpenPGP key: openpgp4fpr:${e}]`;case"fingerprint":return e;default:throw new Error("No valid claim format")}}}).call(this)}).call(this,e("_process"))},{_process:6,dotenv:4}]},{},[9])(9)}));
|