hfs 3.3.2 → 3.4.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/assets/AccountsPage-C6J2hRcY.js +4 -0
- package/admin/assets/ConfigFilePage-D5TZZyMR.js +4 -0
- package/admin/assets/CustomHtmlPage-DV2-ufWZ.js +2 -0
- package/admin/assets/InternetPage-DT3wSQYQ.js +6 -0
- package/admin/assets/LangPage-DbXCv7wR.js +2 -0
- package/admin/assets/LogsPage-DmAxUZpu.js +3 -0
- package/admin/assets/MonitorPage-D7ydOeq_.js +2 -0
- package/admin/assets/OptionsPage-DpN3ajRm.js +3 -0
- package/admin/assets/PluginsPage-BYzfwuvg.js +1 -0
- package/admin/assets/icons-CfBG9vvB.js +1 -0
- package/admin/assets/index-CVCnYMoB.js +755 -0
- package/admin/assets/index-mI9kZlpb.css +1 -0
- package/admin/assets/routing-C4l8rnk_.js +1 -0
- package/admin/index.html +2 -2
- package/central.json +100 -1
- package/frontend/assets/{dist-legacy-zQdkj0Z9.js → dist-legacy-CKczq_fx.js} +1 -1
- package/frontend/assets/index-legacy-ZYae30AY.js +1 -0
- package/frontend/assets/{lib-legacy-CRrFEEqm.js → lib-legacy-D2tyILlj.js} +1 -1
- package/frontend/assets/{sha512-legacy-BB7Mdt0y.js → sha512-legacy-CFcDeiiP.js} +1 -1
- package/frontend/index.html +1 -1
- package/npm-shrinkwrap.json +60 -60
- package/package.json +3 -3
- package/src/acme.js +143 -50
- package/src/acmeConfig.js +43 -0
- package/src/acmeDns.js +285 -0
- package/src/admin-langs/embedded.js +33 -0
- package/src/admin-langs/hfs-admin-lang-ar.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-bg.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-de.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-el.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-en.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-es.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-fi.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-fr.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-hu.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-it.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-ja.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-ko.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-lt.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-ms.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-nl.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-pl.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-pt-br.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-ro.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-ru.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-sr-latn.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-sr.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-th.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-tr.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-uk.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-vi.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-zh-tw.json +1141 -0
- package/src/admin-langs/hfs-admin-lang-zh.json +1141 -0
- package/src/adminApis.js +2 -2
- package/src/adminLang.js +50 -0
- package/src/api.lang.js +22 -13
- package/src/api.log.js +5 -3
- package/src/api.net.js +22 -4
- package/src/api.plugins.js +53 -19
- package/src/api.vfs.js +2 -1
- package/src/argv.js +4 -0
- package/src/auth.js +0 -2
- package/src/basicWeb.js +6 -2
- package/src/block.js +1 -1
- package/src/config.js +1 -0
- package/src/connections.js +4 -7
- package/src/const.js +1 -1
- package/src/cross-const.js +7 -5
- package/src/cross.js +16 -3
- package/src/frontEndApis.js +44 -7
- package/src/github.js +6 -37
- package/src/i18n.js +16 -4
- package/src/index.js +4 -2
- package/src/lang.js +15 -8
- package/src/langs/embedded.js +2 -1
- package/src/langs/hfs-lang-ar.json +5 -1
- package/src/langs/hfs-lang-bg.json +5 -1
- package/src/langs/hfs-lang-de.json +5 -1
- package/src/langs/hfs-lang-el.json +5 -1
- package/src/langs/hfs-lang-en.json +188 -0
- package/src/langs/hfs-lang-es.json +7 -3
- package/src/langs/hfs-lang-fi.json +6 -2
- package/src/langs/hfs-lang-fr.json +10 -6
- package/src/langs/hfs-lang-hu.json +5 -1
- package/src/langs/hfs-lang-it.json +9 -4
- package/src/langs/hfs-lang-ja.json +5 -1
- package/src/langs/hfs-lang-ko.json +5 -1
- package/src/langs/hfs-lang-lt.json +5 -1
- package/src/langs/hfs-lang-ms.json +7 -1
- package/src/langs/hfs-lang-nl.json +5 -1
- package/src/langs/hfs-lang-pl.json +5 -1
- package/src/langs/hfs-lang-pt-br.json +7 -3
- package/src/langs/hfs-lang-ro.json +5 -1
- package/src/langs/hfs-lang-ru.json +7 -3
- package/src/langs/hfs-lang-sr-latn.json +5 -1
- package/src/langs/hfs-lang-sr.json +5 -1
- package/src/langs/hfs-lang-th.json +6 -2
- package/src/langs/hfs-lang-tr.json +6 -2
- package/src/langs/hfs-lang-uk.json +14 -10
- package/src/langs/hfs-lang-vi.json +5 -1
- package/src/langs/hfs-lang-zh-tw.json +5 -1
- package/src/langs/hfs-lang-zh.json +5 -1
- package/src/log.js +7 -1
- package/src/middlewares.js +85 -14
- package/src/multipartUpload.js +21 -0
- package/src/nat.js +10 -7
- package/src/outboundProxy.js +1 -1
- package/src/perm.js +38 -20
- package/src/pluginCatalog.js +66 -0
- package/src/pluginUsage.js +64 -0
- package/src/plugins.js +12 -0
- package/src/roots.js +22 -13
- package/src/serveFile.js +26 -5
- package/src/serveGuiFiles.js +5 -2
- package/src/update.js +51 -18
- package/src/upload.js +49 -8
- package/src/util-http.js +31 -5
- package/src/vfs.js +84 -4
- package/src/webdav.js +12 -6
- package/admin/assets/AccountsPage-Cvi9DSc1.js +0 -3
- package/admin/assets/ArrayField-ChS9pNra.js +0 -2
- package/admin/assets/ConfigFilePage-6jCYVkbr.js +0 -4
- package/admin/assets/CustomHtmlPage-DaEXsEcQ.js +0 -2
- package/admin/assets/DataTable-Cf5S5yWr.js +0 -119
- package/admin/assets/DateTimeField--mTsSB1l.js +0 -1
- package/admin/assets/EventManager-BJWba-fL.js +0 -1
- package/admin/assets/FileField-B0WhrAuk.js +0 -117
- package/admin/assets/InternetPage-BICQDG_K.js +0 -8
- package/admin/assets/LangPage-D42UPSxC.js +0 -2
- package/admin/assets/LogsPage-DQTrf5GE.js +0 -4
- package/admin/assets/MenuButton-DDfB3119.js +0 -1
- package/admin/assets/MonitorPage-CH06c8aW.js +0 -2
- package/admin/assets/OptionsPage-BvXLA_R0.js +0 -3
- package/admin/assets/PluginsPage-CyaVJZkM.js +0 -1
- package/admin/assets/Tabs-CGfV3BK0.js +0 -1
- package/admin/assets/TextEditor-BeS-mR2I.css +0 -1
- package/admin/assets/TextEditor-Df9LSzm6.js +0 -34
- package/admin/assets/VfsPathField-6Kyy5vuQ.js +0 -1
- package/admin/assets/agentIcons-DwT9U-lh.js +0 -1
- package/admin/assets/baseUrl-D7S0KsqZ.js +0 -2
- package/admin/assets/icons-DWkdo8hc.js +0 -1
- package/admin/assets/index-11n5z0Ez.css +0 -1
- package/admin/assets/index-BDdPG215.js +0 -477
- package/admin/assets/routing-CxxvyWME.js +0 -1
- package/frontend/assets/index-legacy-B8EvbIOB.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ariaOnly{clip-path:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);position:absolute}.icon{text-align:center;width:1.4em;height:1.2em;font-size:1.2em;display:inline-block}@keyframes blink{0%{opacity:1}50%{opacity:.3}}:root{--success:#5c5;height:100dvh}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background:#000;height:100vh;margin:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}#root{min-height:100%;display:flex}main{word-break:break-word}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}img.flag{vertical-align:text-top;width:1.5em;height:1em;margin-top:1px}.icon-w-text{margin-right:.5em}form{max-width:100%}.MuiSvgIcon-root{vertical-align:bottom}div.MuiTreeItem-content{padding-top:1px;padding-bottom:0}.MuiDataGrid-columnHeaders{background-color:rgba(136,136,136,.133)}.MuiDataGrid-virtualScrollerRenderZone .MuiDataGrid-row .MuiDataGrid-cell{flex-wrap:wrap;align-items:center;line-height:1.2em;display:flex}.MuiDataGrid-filterForm{flex-wrap:wrap;justify-content:flex-end;row-gap:1em}.wrap[role=cell]{white-space:normal!important}ol,ul{margin-top:.2em;margin-bottom:.2em;padding-left:1.5em}h2.MuiDialogTitle-root{padding-top:2px;padding-bottom:2px}.dialog-alert .MuiDialogContent-root{white-space:pre-wrap;max-width:45em;padding:.5em 1em}.release code{background-color:rgba(136,136,136,.2);border-radius:.2em;padding:0 .2em;font-size:95%}.MuiAppBar-root .MuiAlert-standardInfo .MuiAlert-icon{color:rgba(255,255,255,.533)!important}.MuiAppBar-root .MuiAlert-standardInfo .MuiAlert-message{color:rgba(255,255,255,.667)!important}.MuiAppBar-root .MuiAlert-colorWarning .MuiAlert-icon{color:rgba(255,255,0,.533)!important}.MuiAppBar-root .MuiAlert-colorWarning .MuiAlert-message{color:rgba(255,255,0,.667)!important}.animated-dashed-line{background-image:linear-gradient(90deg,currentColor 50%,transparent 50%);background-size:10px 100%;width:100%;height:2px;animation:1s linear infinite alternate animate-dash}@keyframes animate-dash{to{background-position:20px 0}}@keyframes success{50%{color:var(--success);transform:scale(1.3)}to{transform:inherit;color:inherit}}@keyframes wave{0%{transform:rotate(-20deg)}to{transform:rotate(20deg)}}.usage-stats-celebrate:before,.usage-stats-celebrate:after{content:"▪ • ▲";color:#f44336;white-space:nowrap;font-size:.35em;animation:1s ease-out forwards confetti-left;position:absolute;top:.2em;bottom:auto;left:.4em;right:auto}.usage-stats-celebrate:after{color:#2196f3;animation-name:confetti-right}@keyframes celebrate{0%{transform:scale(.3)rotate(-20deg)}45%{transform:scale(1.35)rotate(10deg)}to{transform:none}}@keyframes confetti-left{to{opacity:0;transform:translate(-2em,-2em)rotate(-90deg)}}@keyframes confetti-right{to{opacity:0;transform:translate(2em,-2em)rotate(90deg)}}::-webkit-scrollbar{width:4px}::-webkit-scrollbar-thumb{background:rgba(136,136,136,.533)}::-webkit-scrollbar-track{background:rgba(136,136,136,.133)}.token.operator{background:unset!important}.fflag{vertical-align:bottom;border:none;width:1.7em;height:1.1em}code[class*=language-],pre[class*=language-]{color:#657b83;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;line-height:1.5}pre[class*=language-]::-moz-selection{background:#073642}pre[class*=language-] ::-moz-selection{background:#073642}code[class*=language-]::-moz-selection{background:#073642}code[class*=language-] ::-moz-selection{background:#073642}pre[class*=language-]::-moz-selection{background:#073642}pre[class*=language-]::selection{background:#073642}pre[class*=language-] ::-moz-selection{background:#073642}pre[class*=language-] ::selection{background:#073642}code[class*=language-]::-moz-selection{background:#073642}code[class*=language-]::selection{background:#073642}code[class*=language-] ::-moz-selection{background:#073642}code[class*=language-] ::selection{background:#073642}pre[class*=language-]{border-radius:.3em;margin:.5em 0;padding:1em;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background-color:#fdf6e3}:not(pre)>code[class*=language-]{border-radius:.3em;padding:.1em}.token.comment,.token.prolog,.token.doctype,.token.cdata{color:#93a1a1}.token.punctuation{color:#586e75}.token.namespace{opacity:.7}.token.property,.token.tag,.token.boolean,.token.number,.token.constant,.token.symbol,.token.deleted{color:#268bd2}.token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.url,.token.inserted{color:#2aa198}.token.entity{color:#657b83;background:#eee8d5}.token.atrule,.token.attr-value,.token.keyword{color:#859900}.token.function,.token.class-name{color:#b58900}.token.regex,.token.important,.token.variable{color:#cb4b16}.token.important,.token.bold{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e}from"./rolldown-runtime-CacB07dV.js";import{Yn as t,rn as n,yr as r}from"./index-CVCnYMoB.js";var i=e(r());function a(e,r){let[a,o]=n(),s=`/${e}/`,c=Math.max(0,r.indexOf(t(s,a)));return(0,i.useEffect)(()=>{let t=`/${e}/${r[c]}`;a!==t&&o(t,{replace:!0})},[e,o,a,c,r]),[c,l];function l(t){o(`/${e}/${r[t]}`)}}export{a as t};
|
package/admin/index.html
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
<link href="../frontend/fontello.css" rel="stylesheet" />
|
|
9
9
|
<link href="/flags/freakflags.css" rel="stylesheet" />
|
|
10
10
|
<link href="../frontend/fontello.woff2" rel="prefetch" />
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-CVCnYMoB.js"></script>
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-CacB07dV.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-mI9kZlpb.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<style class="removeAtBoot">@media (prefers-color-scheme: dark) { html { background-color: #000; color: #888; } }</style>
|
package/central.json
CHANGED
|
@@ -56,5 +56,104 @@
|
|
|
56
56
|
"^3\\.2\\.[1-9]": {
|
|
57
57
|
"alert": "Please update. Your installation may be at risk if:\n - shared folders contain hidden subfolders: their contents can be downloaded if the folder name is known;\n - untrusted users can download folders as ZIP: they can make HFS unavailable;\n - you use WebDAV, LDAP, or `?login=` links: passwords can be exposed during login;\n - multiple users manage files in the same folders: one user can alter another's files"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
},
|
|
60
|
+
"acmeDns": [
|
|
61
|
+
{
|
|
62
|
+
"driver": "http-json1",
|
|
63
|
+
"help_url": "https://dash.cloudflare.com/profile/api-tokens",
|
|
64
|
+
"config_version": 1,
|
|
65
|
+
"providers": {"Cloudflare": {"endpoint": "https://api.cloudflare.com/client/v4"}},
|
|
66
|
+
"fields": {"token": {"label": "API token", "secret": true}},
|
|
67
|
+
"headers": {"Authorization": "Bearer {credentials.token}"},
|
|
68
|
+
"prepare": [{"method": "GET", "path": "/zones?name={zone}", "expect": ["success", true], "capture": {"zoneId": "result.0.id"}}],
|
|
69
|
+
"create": [{"method": "POST", "path": "/zones/{zoneId}/dns_records", "body": {"type": "TXT", "name": "{name}", "content": "{value}", "ttl": 120}, "expect": ["success", true], "capture": {"recordId": "result.id"}}],
|
|
70
|
+
"remove": [{"method": "DELETE", "path": "/zones/{zoneId}/dns_records/{recordId}", "expect": ["success", true]}]
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"driver": "http-json1",
|
|
74
|
+
"help_url": "https://cloud.digitalocean.com/account/api/tokens",
|
|
75
|
+
"config_version": 1,
|
|
76
|
+
"providers": {"DigitalOcean": {"endpoint": "https://api.digitalocean.com/v2"}},
|
|
77
|
+
"fields": {"token": {"label": "API token", "secret": true}},
|
|
78
|
+
"headers": {"Authorization": "Bearer {credentials.token}"},
|
|
79
|
+
"create": [{"method": "POST", "path": "/domains/{zone}/records", "body": {"type": "TXT", "name": "{name}", "data": "{value}", "ttl": 30}, "capture": {"recordId": "domain_record.id"}}],
|
|
80
|
+
"remove": [{"method": "DELETE", "path": "/domains/{zone}/records/{recordId}"}]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"driver": "http-json1",
|
|
84
|
+
"help_url": "https://porkbun.com/account/api",
|
|
85
|
+
"config_version": 1,
|
|
86
|
+
"providers": {"Porkbun": {"endpoint": "https://api.porkbun1.com/api/json/v3"}},
|
|
87
|
+
"fields": {"key": {"label": "API key", "secret": true}, "secret": {"label": "Secret API key", "secret": true}},
|
|
88
|
+
"headers": {},
|
|
89
|
+
"create": [{"method": "POST", "path": "/dns/create/{zone}", "body": {"apikey": "{credentials.key}", "secretapikey": "{credentials.secret}", "type": "TXT", "name": "{relative}", "content": "{value}", "ttl": "300"}, "expect": ["status", "SUCCESS"], "capture": {"recordId": "id"}}],
|
|
90
|
+
"remove": [{"method": "POST", "path": "/dns/delete/{zone}/{recordId}", "body": {"apikey": "{credentials.key}", "secretapikey": "{credentials.secret}"}, "expect": ["status", "SUCCESS"]}]
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"driver": "http-json1",
|
|
94
|
+
"help_url": "https://my.vultr.com/settings/#settingsapi",
|
|
95
|
+
"config_version": 1,
|
|
96
|
+
"providers": {"Vultr": {"endpoint": "https://api.vultr.com/v2"}},
|
|
97
|
+
"fields": {"token": {"label": "API token", "secret": true}},
|
|
98
|
+
"headers": {"Authorization": "Bearer {credentials.token}"},
|
|
99
|
+
"create": [{"method": "POST", "path": "/domains/{zone}/records", "body": {"type": "TXT", "name": "{relative}", "data": "\"{value}\"", "ttl": 300, "priority": 0}, "capture": {"recordId": "record.id"}}],
|
|
100
|
+
"remove": [{"method": "DELETE", "path": "/domains/{zone}/records/{recordId}"}]
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"driver": "http-json1",
|
|
104
|
+
"help_url": "https://cloud.linode.com/profile/tokens",
|
|
105
|
+
"config_version": 1,
|
|
106
|
+
"providers": {"Linode": {"endpoint": "https://api.linode.com/v4"}},
|
|
107
|
+
"fields": {"token": {"label": "API token", "secret": true}},
|
|
108
|
+
"headers": {"Authorization": "Bearer {credentials.token}", "X-Filter": "{\"domain\":\"{zone}\"}"},
|
|
109
|
+
"prepare": [{"method": "GET", "path": "/domains", "expect": ["results", 1], "capture": {"zoneId": "data.0.id"}}],
|
|
110
|
+
"create": [{"method": "POST", "path": "/domains/{zoneId}/records", "body": {"type": "TXT", "name": "{relative}", "target": "{value}", "ttl_sec": 300}, "capture": {"recordId": "id"}}],
|
|
111
|
+
"remove": [{"method": "DELETE", "path": "/domains/{zoneId}/records/{recordId}"}]
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"driver": "http-json1",
|
|
115
|
+
"help_url": "https://support.dnsimple.com/articles/api-access-token/",
|
|
116
|
+
"config_version": 1,
|
|
117
|
+
"providers": {"DNSimple": {"endpoint": "https://api.dnsimple.com/v2"}},
|
|
118
|
+
"fields": {"token": {"label": "Account API token", "secret": true}},
|
|
119
|
+
"headers": {"Authorization": "Bearer {credentials.token}"},
|
|
120
|
+
"prepare": [{"method": "GET", "path": "/whoami", "capture": {"accountId": "data.account.id"}}],
|
|
121
|
+
"create": [{"method": "POST", "path": "/{accountId}/zones/{zone}/records", "body": {"type": "TXT", "name": "{relative}", "content": "{value}", "ttl": 300}, "capture": {"recordId": "data.id"}}],
|
|
122
|
+
"remove": [{"method": "DELETE", "path": "/{accountId}/zones/{zone}/records/{recordId}"}]
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"driver": "http-json1",
|
|
126
|
+
"help_url": "https://developer.hosting.ionos.com/keys",
|
|
127
|
+
"config_version": 1,
|
|
128
|
+
"providers": {"IONOS": {"endpoint": "https://api.hosting.ionos.com/dns/v1"}},
|
|
129
|
+
"fields": {"token": {"label": "API token", "secret": true}},
|
|
130
|
+
"headers": {"X-API-Key": "{credentials.token}"},
|
|
131
|
+
"prepare": [{"method": "GET", "path": "/zones", "select": {"field": "name", "equals": "{zone}"}, "capture": {"zoneId": "id"}}],
|
|
132
|
+
"create": [{"method": "POST", "path": "/zones/{zoneId}/records", "body": [{"type": "TXT", "name": "{name}", "content": "{value}", "ttl": 300, "disabled": false}], "capture": {"recordId": "0.id"}}],
|
|
133
|
+
"remove": [{"method": "DELETE", "path": "/zones/{zoneId}/records/{recordId}"}],
|
|
134
|
+
"propagation_timeout": 900
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"driver": "http-json1",
|
|
138
|
+
"help_url": "https://www.name.com/account/settings/api",
|
|
139
|
+
"config_version": 1,
|
|
140
|
+
"providers": {"Name.com": {"endpoint": "https://api.name.com/core/v1"}},
|
|
141
|
+
"fields": {"username": {"label": "Username"}, "token": {"label": "API token", "secret": true}},
|
|
142
|
+
"headers": {},
|
|
143
|
+
"create": [{"method": "POST", "path": "/domains/{zone}/records", "body": {"type": "TXT", "host": "{relative}", "answer": "{value}", "ttl": 300}, "capture": {"recordId": "id"}}],
|
|
144
|
+
"remove": [{"method": "DELETE", "path": "/domains/{zone}/records/{recordId}"}],
|
|
145
|
+
"auth": {"basic": "{credentials.username}:{credentials.token}"}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"driver": "http-json1",
|
|
149
|
+
"help_url": "https://eu.api.ovh.com/createToken/?POST=/domain/zone/*&DELETE=/domain/zone/*",
|
|
150
|
+
"config_version": 1,
|
|
151
|
+
"providers": {"OVHcloud": {"endpoint": "https://eu.api.ovh.com/1.0"}, "OVHcloud Canada": {"endpoint": "https://ca.api.ovh.com/1.0", "help_url": "https://ca.api.ovh.com/createToken/?POST=/domain/zone/*&DELETE=/domain/zone/*"}},
|
|
152
|
+
"fields": {"applicationKey": {"label": "Application key", "secret": true}, "applicationSecret": {"label": "Application secret", "secret": true}, "consumerKey": {"label": "Consumer key", "secret": true}},
|
|
153
|
+
"headers": {},
|
|
154
|
+
"auth": "ovh",
|
|
155
|
+
"create": [{"method": "POST", "path": "/domain/zone/{zone}/record", "body": {"fieldType": "TXT", "subDomain": "{relative}", "target": "{value}", "ttl": 60}, "capture": {"recordId": "id"}}, {"method": "POST", "path": "/domain/zone/{zone}/refresh"}],
|
|
156
|
+
"remove": [{"method": "DELETE", "path": "/domain/zone/{zone}/record/{recordId}"}, {"method": "POST", "path": "/domain/zone/{zone}/refresh"}]
|
|
157
|
+
}
|
|
158
|
+
]
|
|
60
159
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.toStringTag||"@@toStringTag";function a(e,i,o,u){var a=i&&i.prototype instanceof c?i:c,f=Object.create(a.prototype);return t(f,"_invoke",function(e,t,i){var o,u,a,c=0,f=i||[],h=!1,l={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(e,t){return o=e,u=0,a=r,l.n=t,s}};function v(e,t){for(u=e,a=t,n=0;!h&&c&&!i&&n<f.length;n++){var i,o=f[n],v=l.p,p=o[2];e>3?(i=p===t)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=r):o[0]<=v&&((i=e<2&&v<o[1])?(u=0,l.v=t,l.n=o[1]):v<p&&(i=e<3||o[0]>t||t>p)&&(o[4]=e,o[5]=t,l.n=p,u=0))}if(i||e>1)return s;throw h=!0,t}return function(i,f,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===f&&v(f,p),u=f,a=p;(n=u<2?r:a)||!h;){o||(u?u<3?(u>1&&(l.n=-1),v(u,a)):l.n=a:l.v=a);try{if(c=2,o){if(u||(i="next"),n=o[i]){if(!(n=n.call(o,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,u<2&&(u=0)}else 1===u&&(n=o.return)&&n.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=r}else if((n=(h=l.n<0)?a:e.call(t,l))!==s)break}catch(n){o=r,u=1,a=n}finally{c=1}}return{value:n,done:h}}}(e,o,u),!0),f}var s={};function c(){}function f(){}function h(){}n=Object.getPrototypeOf;var l=[][o]?n(n([][o]())):(t(n={},o,(function(){return this})),n),v=h.prototype=c.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,t(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=h,t(v,"constructor",h),t(h,"constructor",f),f.displayName="GeneratorFunction",t(h,u,"GeneratorFunction"),t(v),t(v,u,"Generator"),t(v,o,(function(){return this})),t(v,"toString",(function(){return"[object Generator]"})),(e=function(){return{w:a,m:p}})()}function t(e,r,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}t=function(e,r,n,i){function u(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))}r?o?o(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},t(e,r,n,i)}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}System.register(["./index-legacy-B8EvbIOB.js"],(function(t,n){var i,u,s,c,f,h,l,v;return{setters:[function(e){i=e.t}],execute:function(){u=i((function(e,t){t.exports={}})),s=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crossEnvCrypto=void 0;try{var t="undefined"!=typeof window&&window.crypto||u().webcrypto;if(t){if(!t.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");var r=function(e){return function(r){return t.subtle.digest(e,r)}};e.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:r("SHA-1"),SHA256:r("SHA-256"),SHA384:r("SHA-384"),SHA512:r("SHA-512")}}}else{var n=u(),i=function(e){return function(t){return n.createHash(e).update(t).digest().buffer}};e.crossEnvCrypto={randomBytes:n.randomFillSync,hashFunctions:{SHA1:i("sha1"),SHA256:i("sha256"),SHA384:i("sha384"),SHA512:i("sha512")}}}}catch(o){throw console.error(o),new Error("No suitable crypto library was found. You may need a polyfill.")}})),c=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SRPParameters=void 0;var t=s(),r=o((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.PrimeGroup[2048],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.H.SHA512;if(a(this,e),this.primeGroup=t,this.H=r,this.NBits=this.primeGroup.N.toString(2).length,!r)throw new Error("Hash function required")}));e.SRPParameters=r,r.PrimeGroup={256:{N:BigInt("125617018995153554710546479714086468244499594888726646874671447258204721048803"),g:BigInt(2)},512:{N:BigInt("11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603"),g:BigInt(2)},768:{N:BigInt("1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147"),g:BigInt(2)},1024:{N:BigInt("167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939"),g:BigInt(2)},1536:{N:BigInt("1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587"),g:BigInt(2)},2048:{N:BigInt("21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819"),g:BigInt(2)}},r.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512}})),f=i((function(t){var n=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.modPow=t.hashBitCount=t.createVerifierAndSalt=t.createVerifier=t.generateRandomBigInt=t.generateRandomString=t.hashPadded=t.hash=t.padStartArrayBuffer=t.stringToArrayBuffer=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=void 0;var i=s(),o=BigInt(0),u=BigInt(1),a=BigInt(2);t.bigIntToArrayBuffer=function(e){var t=e.toString(16),r=new ArrayBuffer(Math.ceil(t.length/2)),n=new Uint8Array(r),i=0;t.length%2!=0&&(n[0]=parseInt(t[0],16),i=1);for(var o=0;o<r.byteLength;o++)n[o+i]=parseInt(t.slice(2*o+i,2*o+2+i),16);return r};t.arrayBufferToBigInt=function(e){var t=[];return new Uint8Array(e).forEach((function(e){t.push(("0"+e.toString(16)).slice(-2))})),BigInt(`0x${t.join("")}`)},t.stringToArrayBuffer=function(e){return(new TextEncoder).encode(e).buffer};function c(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=r.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i),u=0,a=0;a<r.length;a++)o.set(new Uint8Array(r[a]),u),u+=r[a].byteLength;return e.H(o)}function f(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:if(r&&r.trim()){e.n=1;break}throw new Error("Identity (I) must not be null or empty.");case 1:if(i){e.n=2;break}throw new Error("Salt (s) must not be null.");case 2:if(o){e.n=3;break}throw new Error("Password (P) must not be null");case 3:return e.n=4,t.computeX(r,i,o);case 4:return u=e.v,e.a(2,t.computeVerifier(u))}}),n)})))}t.padStartArrayBuffer=function(e,t){var r=new Uint8Array(e);if(r.length<t){var n=new Uint8Array(t);return n.fill(0,0,t-r.length),n.set(r,t-r.length),n}return r},t.hash=c,t.hashPadded=function(e,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),u=2;u<i;u++)o[u-2]=arguments[u];return c.apply(void 0,[e].concat(r(o.map((function(e){return t.padStartArrayBuffer(e,n)})))))},t.generateRandomString=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=new Uint8Array(Math.ceil(Math.ceil(e/2)));return i.crossEnvCrypto.randomBytes(t),t.reduce((function(e,t){var r=t.toString(16).toString();return 1===r.length?e+"0"+r:e+r}),"").slice(0,e)},t.generateRandomBigInt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return t.arrayBufferToBigInt(h(e))},t.createVerifier=f,t.createVerifierAndSalt=function(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.generateRandomSalt(o);case 1:return u=e.v,a=u,e.n=2,f(t,r,u,i);case 2:return s=e.v,e.a(2,{s:a,v:s})}}),n)})))};t.hashBitCount=function(r){return n(void 0,void 0,void 0,e().m((function n(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,c(r,t.bigIntToArrayBuffer(BigInt(1)));case 1:return i=e.v.byteLength,e.a(2,8*i)}}),n)})))},t.modPow=function(e,t,r){for(var n=u;t>o;)t%a==u?(n=e*n%r,t-=u):(e=e*e%r,t/=a);return n};var h=function(e){var t=new Uint8Array(e);return i.crossEnvCrypto.randomBytes(t),t.buffer}})),h=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPRoutines=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.parameters=t}),[{key:"hash",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.hash.apply(n,[this.parameters].concat(t))}},{key:"hashPadded",value:function(){for(var e=Math.trunc((this.parameters.NBits+7)/8),t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.hashPadded.apply(n,[this.parameters,e].concat(r))}},{key:"computeK",value:function(){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(this.parameters.primeGroup.N),n.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"generateRandomSalt",value:function(t){return r(this,void 0,void 0,e().m((function r(){var i,o;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,n.hashBitCount(this.parameters);case 1:return i=e.v,o=t||2*i/8,e.a(2,n.generateRandomBigInt(o))}}),r,this)})))}},{key:"computeX",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,a=this,s=n.bigIntToArrayBuffer(i),e.n=1,this.computeIdentityHash(t,o);case 1:return e.n=2,a.hash.call(a,s,e.v);case 2:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeXStep2",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),i);case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeIdentityHash",value:function(t,i){return r(this,void 0,void 0,e().m((function t(){return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hash(n.stringToArrayBuffer(i));case 1:return e.a(2,e.v)}}),t,this)})))}},{key:"computeVerifier",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"generatePrivateValue",value:function(){var e,t=Math.max(256,this.parameters.NBits);do{e=n.generateRandomBigInt(t/8)%this.parameters.primeGroup.N}while(e===BigInt(0));return e}},{key:"computeClientPublicValue",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"isValidPublicValue",value:function(e){return e%this.parameters.primeGroup.N!==BigInt(0)}},{key:"computeU",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i));case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeClientEvidence",value:function(t,i,o,u,a){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hash(n.bigIntToArrayBuffer(o),n.bigIntToArrayBuffer(u),n.bigIntToArrayBuffer(a));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"computeServerEvidence",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i),n.bigIntToArrayBuffer(o));case 1:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeClientSessionKey",value:function(e,t,r,i,o){var u=this.parameters.primeGroup.N,a=r*t+i,s=n.modPow(this.parameters.primeGroup.g,t,u)*e%u;return n.modPow(o+u-s,a,u)}}])}();t.SRPRoutines=i})),l=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=void 0;var n=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:if(t&&t.trim()){e.n=1;break}throw new Error("User identity must not be null nor empty");case 1:if(n){e.n=2;break}throw new Error("User password must not be null");case 2:return e.n=3,this.routines.computeIdentityHash(t,n);case 3:return o=e.v,e.a(2,new i(this.routines,t,o))}}),r,this)})))}}])}();t.SRPClientSession=n;var i=function(){function t(e,r,n){a(this,t),this.routines=e,this.I=r,this.IH=n}return o(t,[{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i,o,a,s,c,f,h;return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Salt (s) must not be null");case 1:if(n){e.n=2;break}throw new Error("Public server value (B) must not be null");case 2:return e.n=3,this.routines.computeXStep2(t,this.IH);case 3:return i=e.v,o=this.routines.generatePrivateValue(),a=this.routines.computeClientPublicValue(o),e.n=4,this.routines.computeK();case 4:return s=e.v,e.n=5,this.routines.computeU(a,n);case 5:return c=e.v,f=this.routines.computeClientSessionKey(s,i,c,o,n),e.n=6,this.routines.computeClientEvidence(this.I,t,a,n,f);case 6:return h=e.v,e.a(2,new u(this.routines,a,h,f))}}),r,this)})))}},{key:"toJSON",value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:"fromState",value:function(e,r){return new t(e,r.I,new Uint8Array(r.IH).buffer)}}])}();t.SRPClientSessionStep1=i;var u=function(){function t(e,r,n,i){a(this,t),this.routines=e,this.A=r,this.M1=n,this.S=i}return o(t,[{key:"step3",value:function(t){return r(this,void 0,void 0,e().m((function r(){return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Server evidence (M2) must not be null");case 1:return e.n=2,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 2:if(e.v===t){e.n=3;break}throw new Error("Bad server credentials");case 3:return e.a(2)}}),r,this)})))}},{key:"toJSON",value:function(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,BigInt("0x"+r.A),BigInt("0x"+r.M1),BigInt("0x"+r.S))}}])}();t.SRPClientSessionStep2=u})),v=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPServerSessionStep1=t.SRPServerSession=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n,i){return r(this,void 0,void 0,e().m((function r(){var o,a,c;return e().w((function(e){for(;;)switch(e.n){case 0:return o=this.routines.generatePrivateValue(),e.n=1,this.routines.computeK();case 1:return a=e.v,c=s(this.routines.parameters,a,i,o),e.a(2,new u(this.routines,t,n,i,o,c))}}),r,this)})))}}])}();t.SRPServerSession=i;var u=function(){function t(e,r,n,i,o,u){a(this,t),this.routines=e,this.identifier=r,this.salt=n,this.verifier=i,this.b=o,this.B=u}return o(t,[{key:"sessionKey",value:function(t){return r(this,void 0,void 0,e().m((function r(){var n;return e().w((function(e){for(;;)switch(e.n){case 0:if(null!==t){e.n=1;break}throw new Error("Client public value (A) must not be null");case 1:if(this.routines.isValidPublicValue(t)){e.n=2;break}throw new Error(`Invalid Client public value (A): ${t.toString(16)}`);case 2:return e.n=3,this.routines.computeU(t,this.B);case 3:return n=e.v,e.a(2,c(this.routines.parameters.primeGroup.N,this.verifier,n,t,this.b))}}),r,this)})))}},{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}throw new Error("Client evidence (M1) must not be null");case 1:return e.n=2,this.sessionKey(t);case 2:return i=e.v,e.n=3,this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,i);case 3:if(e.v===n){e.n=4;break}throw new Error("Bad client credentials");case 4:return e.a(2,this.routines.computeServerEvidence(t,n,i))}}),r,this)})))}},{key:"toJSON",value:function(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,r.identifier,BigInt("0x"+r.salt),BigInt("0x"+r.verifier),BigInt("0x"+r.b),BigInt("0x"+r.B))}}])}();t.SRPServerSessionStep1=u;var s=function(e,t,r,i){return(n.modPow(e.primeGroup.g,i,e.primeGroup.N)+r*t)%e.primeGroup.N},c=function(e,t,r,i,o){return n.modPow(n.modPow(t,r,e)*i,o,e)}})),t("default",i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=c();Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var r=h();Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return r.SRPRoutines}});var n=l();Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return n.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return n.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return n.SRPClientSessionStep2}});var i=v();Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return i.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return i.SRPServerSessionStep1}});var o=f();Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return o.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return o.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return o.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return o.generateRandomBigInt}})}))())}}}))}();
|
|
1
|
+
!function(){function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.toStringTag||"@@toStringTag";function a(e,i,o,u){var a=i&&i.prototype instanceof c?i:c,f=Object.create(a.prototype);return t(f,"_invoke",function(e,t,i){var o,u,a,c=0,f=i||[],h=!1,l={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(e,t){return o=e,u=0,a=r,l.n=t,s}};function v(e,t){for(u=e,a=t,n=0;!h&&c&&!i&&n<f.length;n++){var i,o=f[n],v=l.p,p=o[2];e>3?(i=p===t)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=r):o[0]<=v&&((i=e<2&&v<o[1])?(u=0,l.v=t,l.n=o[1]):v<p&&(i=e<3||o[0]>t||t>p)&&(o[4]=e,o[5]=t,l.n=p,u=0))}if(i||e>1)return s;throw h=!0,t}return function(i,f,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===f&&v(f,p),u=f,a=p;(n=u<2?r:a)||!h;){o||(u?u<3?(u>1&&(l.n=-1),v(u,a)):l.n=a:l.v=a);try{if(c=2,o){if(u||(i="next"),n=o[i]){if(!(n=n.call(o,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,u<2&&(u=0)}else 1===u&&(n=o.return)&&n.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=r}else if((n=(h=l.n<0)?a:e.call(t,l))!==s)break}catch(n){o=r,u=1,a=n}finally{c=1}}return{value:n,done:h}}}(e,o,u),!0),f}var s={};function c(){}function f(){}function h(){}n=Object.getPrototypeOf;var l=[][o]?n(n([][o]())):(t(n={},o,(function(){return this})),n),v=h.prototype=c.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,t(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=h,t(v,"constructor",h),t(h,"constructor",f),f.displayName="GeneratorFunction",t(h,u,"GeneratorFunction"),t(v),t(v,u,"Generator"),t(v,o,(function(){return this})),t(v,"toString",(function(){return"[object Generator]"})),(e=function(){return{w:a,m:p}})()}function t(e,r,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}t=function(e,r,n,i){function u(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))}r?o?o(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},t(e,r,n,i)}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}System.register(["./index-legacy-ZYae30AY.js"],(function(t,n){var i,u,s,c,f,h,l,v;return{setters:[function(e){i=e.t}],execute:function(){u=i((function(e,t){t.exports={}})),s=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crossEnvCrypto=void 0;try{var t="undefined"!=typeof window&&window.crypto||u().webcrypto;if(t){if(!t.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");var r=function(e){return function(r){return t.subtle.digest(e,r)}};e.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:r("SHA-1"),SHA256:r("SHA-256"),SHA384:r("SHA-384"),SHA512:r("SHA-512")}}}else{var n=u(),i=function(e){return function(t){return n.createHash(e).update(t).digest().buffer}};e.crossEnvCrypto={randomBytes:n.randomFillSync,hashFunctions:{SHA1:i("sha1"),SHA256:i("sha256"),SHA384:i("sha384"),SHA512:i("sha512")}}}}catch(o){throw console.error(o),new Error("No suitable crypto library was found. You may need a polyfill.")}})),c=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SRPParameters=void 0;var t=s(),r=o((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.PrimeGroup[2048],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.H.SHA512;if(a(this,e),this.primeGroup=t,this.H=r,this.NBits=this.primeGroup.N.toString(2).length,!r)throw new Error("Hash function required")}));e.SRPParameters=r,r.PrimeGroup={256:{N:BigInt("125617018995153554710546479714086468244499594888726646874671447258204721048803"),g:BigInt(2)},512:{N:BigInt("11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603"),g:BigInt(2)},768:{N:BigInt("1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147"),g:BigInt(2)},1024:{N:BigInt("167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939"),g:BigInt(2)},1536:{N:BigInt("1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587"),g:BigInt(2)},2048:{N:BigInt("21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819"),g:BigInt(2)}},r.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512}})),f=i((function(t){var n=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.modPow=t.hashBitCount=t.createVerifierAndSalt=t.createVerifier=t.generateRandomBigInt=t.generateRandomString=t.hashPadded=t.hash=t.padStartArrayBuffer=t.stringToArrayBuffer=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=void 0;var i=s(),o=BigInt(0),u=BigInt(1),a=BigInt(2);t.bigIntToArrayBuffer=function(e){var t=e.toString(16),r=new ArrayBuffer(Math.ceil(t.length/2)),n=new Uint8Array(r),i=0;t.length%2!=0&&(n[0]=parseInt(t[0],16),i=1);for(var o=0;o<r.byteLength;o++)n[o+i]=parseInt(t.slice(2*o+i,2*o+2+i),16);return r};t.arrayBufferToBigInt=function(e){var t=[];return new Uint8Array(e).forEach((function(e){t.push(("0"+e.toString(16)).slice(-2))})),BigInt(`0x${t.join("")}`)},t.stringToArrayBuffer=function(e){return(new TextEncoder).encode(e).buffer};function c(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=r.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i),u=0,a=0;a<r.length;a++)o.set(new Uint8Array(r[a]),u),u+=r[a].byteLength;return e.H(o)}function f(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:if(r&&r.trim()){e.n=1;break}throw new Error("Identity (I) must not be null or empty.");case 1:if(i){e.n=2;break}throw new Error("Salt (s) must not be null.");case 2:if(o){e.n=3;break}throw new Error("Password (P) must not be null");case 3:return e.n=4,t.computeX(r,i,o);case 4:return u=e.v,e.a(2,t.computeVerifier(u))}}),n)})))}t.padStartArrayBuffer=function(e,t){var r=new Uint8Array(e);if(r.length<t){var n=new Uint8Array(t);return n.fill(0,0,t-r.length),n.set(r,t-r.length),n}return r},t.hash=c,t.hashPadded=function(e,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),u=2;u<i;u++)o[u-2]=arguments[u];return c.apply(void 0,[e].concat(r(o.map((function(e){return t.padStartArrayBuffer(e,n)})))))},t.generateRandomString=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=new Uint8Array(Math.ceil(Math.ceil(e/2)));return i.crossEnvCrypto.randomBytes(t),t.reduce((function(e,t){var r=t.toString(16).toString();return 1===r.length?e+"0"+r:e+r}),"").slice(0,e)},t.generateRandomBigInt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return t.arrayBufferToBigInt(h(e))},t.createVerifier=f,t.createVerifierAndSalt=function(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.generateRandomSalt(o);case 1:return u=e.v,a=u,e.n=2,f(t,r,u,i);case 2:return s=e.v,e.a(2,{s:a,v:s})}}),n)})))};t.hashBitCount=function(r){return n(void 0,void 0,void 0,e().m((function n(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,c(r,t.bigIntToArrayBuffer(BigInt(1)));case 1:return i=e.v.byteLength,e.a(2,8*i)}}),n)})))},t.modPow=function(e,t,r){for(var n=u;t>o;)t%a==u?(n=e*n%r,t-=u):(e=e*e%r,t/=a);return n};var h=function(e){var t=new Uint8Array(e);return i.crossEnvCrypto.randomBytes(t),t.buffer}})),h=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPRoutines=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.parameters=t}),[{key:"hash",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.hash.apply(n,[this.parameters].concat(t))}},{key:"hashPadded",value:function(){for(var e=Math.trunc((this.parameters.NBits+7)/8),t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.hashPadded.apply(n,[this.parameters,e].concat(r))}},{key:"computeK",value:function(){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(this.parameters.primeGroup.N),n.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"generateRandomSalt",value:function(t){return r(this,void 0,void 0,e().m((function r(){var i,o;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,n.hashBitCount(this.parameters);case 1:return i=e.v,o=t||2*i/8,e.a(2,n.generateRandomBigInt(o))}}),r,this)})))}},{key:"computeX",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,a=this,s=n.bigIntToArrayBuffer(i),e.n=1,this.computeIdentityHash(t,o);case 1:return e.n=2,a.hash.call(a,s,e.v);case 2:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeXStep2",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),i);case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeIdentityHash",value:function(t,i){return r(this,void 0,void 0,e().m((function t(){return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hash(n.stringToArrayBuffer(i));case 1:return e.a(2,e.v)}}),t,this)})))}},{key:"computeVerifier",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"generatePrivateValue",value:function(){var e,t=Math.max(256,this.parameters.NBits);do{e=n.generateRandomBigInt(t/8)%this.parameters.primeGroup.N}while(e===BigInt(0));return e}},{key:"computeClientPublicValue",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"isValidPublicValue",value:function(e){return e%this.parameters.primeGroup.N!==BigInt(0)}},{key:"computeU",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i));case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeClientEvidence",value:function(t,i,o,u,a){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hash(n.bigIntToArrayBuffer(o),n.bigIntToArrayBuffer(u),n.bigIntToArrayBuffer(a));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"computeServerEvidence",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i),n.bigIntToArrayBuffer(o));case 1:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeClientSessionKey",value:function(e,t,r,i,o){var u=this.parameters.primeGroup.N,a=r*t+i,s=n.modPow(this.parameters.primeGroup.g,t,u)*e%u;return n.modPow(o+u-s,a,u)}}])}();t.SRPRoutines=i})),l=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=void 0;var n=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:if(t&&t.trim()){e.n=1;break}throw new Error("User identity must not be null nor empty");case 1:if(n){e.n=2;break}throw new Error("User password must not be null");case 2:return e.n=3,this.routines.computeIdentityHash(t,n);case 3:return o=e.v,e.a(2,new i(this.routines,t,o))}}),r,this)})))}}])}();t.SRPClientSession=n;var i=function(){function t(e,r,n){a(this,t),this.routines=e,this.I=r,this.IH=n}return o(t,[{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i,o,a,s,c,f,h;return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Salt (s) must not be null");case 1:if(n){e.n=2;break}throw new Error("Public server value (B) must not be null");case 2:return e.n=3,this.routines.computeXStep2(t,this.IH);case 3:return i=e.v,o=this.routines.generatePrivateValue(),a=this.routines.computeClientPublicValue(o),e.n=4,this.routines.computeK();case 4:return s=e.v,e.n=5,this.routines.computeU(a,n);case 5:return c=e.v,f=this.routines.computeClientSessionKey(s,i,c,o,n),e.n=6,this.routines.computeClientEvidence(this.I,t,a,n,f);case 6:return h=e.v,e.a(2,new u(this.routines,a,h,f))}}),r,this)})))}},{key:"toJSON",value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:"fromState",value:function(e,r){return new t(e,r.I,new Uint8Array(r.IH).buffer)}}])}();t.SRPClientSessionStep1=i;var u=function(){function t(e,r,n,i){a(this,t),this.routines=e,this.A=r,this.M1=n,this.S=i}return o(t,[{key:"step3",value:function(t){return r(this,void 0,void 0,e().m((function r(){return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Server evidence (M2) must not be null");case 1:return e.n=2,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 2:if(e.v===t){e.n=3;break}throw new Error("Bad server credentials");case 3:return e.a(2)}}),r,this)})))}},{key:"toJSON",value:function(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,BigInt("0x"+r.A),BigInt("0x"+r.M1),BigInt("0x"+r.S))}}])}();t.SRPClientSessionStep2=u})),v=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPServerSessionStep1=t.SRPServerSession=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n,i){return r(this,void 0,void 0,e().m((function r(){var o,a,c;return e().w((function(e){for(;;)switch(e.n){case 0:return o=this.routines.generatePrivateValue(),e.n=1,this.routines.computeK();case 1:return a=e.v,c=s(this.routines.parameters,a,i,o),e.a(2,new u(this.routines,t,n,i,o,c))}}),r,this)})))}}])}();t.SRPServerSession=i;var u=function(){function t(e,r,n,i,o,u){a(this,t),this.routines=e,this.identifier=r,this.salt=n,this.verifier=i,this.b=o,this.B=u}return o(t,[{key:"sessionKey",value:function(t){return r(this,void 0,void 0,e().m((function r(){var n;return e().w((function(e){for(;;)switch(e.n){case 0:if(null!==t){e.n=1;break}throw new Error("Client public value (A) must not be null");case 1:if(this.routines.isValidPublicValue(t)){e.n=2;break}throw new Error(`Invalid Client public value (A): ${t.toString(16)}`);case 2:return e.n=3,this.routines.computeU(t,this.B);case 3:return n=e.v,e.a(2,c(this.routines.parameters.primeGroup.N,this.verifier,n,t,this.b))}}),r,this)})))}},{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}throw new Error("Client evidence (M1) must not be null");case 1:return e.n=2,this.sessionKey(t);case 2:return i=e.v,e.n=3,this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,i);case 3:if(e.v===n){e.n=4;break}throw new Error("Bad client credentials");case 4:return e.a(2,this.routines.computeServerEvidence(t,n,i))}}),r,this)})))}},{key:"toJSON",value:function(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,r.identifier,BigInt("0x"+r.salt),BigInt("0x"+r.verifier),BigInt("0x"+r.b),BigInt("0x"+r.B))}}])}();t.SRPServerSessionStep1=u;var s=function(e,t,r,i){return(n.modPow(e.primeGroup.g,i,e.primeGroup.N)+r*t)%e.primeGroup.N},c=function(e,t,r,i,o){return n.modPow(n.modPow(t,r,e)*i,o,e)}})),t("default",i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=c();Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var r=h();Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return r.SRPRoutines}});var n=l();Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return n.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return n.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return n.SRPClientSessionStep2}});var i=v();Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return i.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return i.SRPServerSessionStep1}});var o=f();Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return o.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return o.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return o.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return o.generateRandomBigInt}})}))())}}}))}();
|