authhero 0.48.0 → 0.49.0
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/dist/authhero.cjs +11 -11
- package/dist/authhero.mjs +317 -305
- package/package.json +1 -1
package/dist/authhero.mjs
CHANGED
|
@@ -1442,7 +1442,7 @@ const mn = a.object({
|
|
|
1442
1442
|
email: a.string(),
|
|
1443
1443
|
login_count: a.number(),
|
|
1444
1444
|
identities: a.array(jh).optional()
|
|
1445
|
-
}),
|
|
1445
|
+
}), St = bd, R3 = Da.extend({
|
|
1446
1446
|
email: a.string(),
|
|
1447
1447
|
login_count: a.number(),
|
|
1448
1448
|
multifactor: a.array(a.string()).optional(),
|
|
@@ -1720,7 +1720,7 @@ const Ph = a.enum([
|
|
|
1720
1720
|
created_at: a.string(),
|
|
1721
1721
|
updated_at: a.string()
|
|
1722
1722
|
});
|
|
1723
|
-
var
|
|
1723
|
+
var ye = /* @__PURE__ */ ((n) => (n.FAILED_SILENT_AUTH = "fsa", n.FAILED_SIGNUP = "fs", n.FAILED_LOGIN = "f", n.FAILED_LOGIN_INCORRECT_PASSWORD = "fp", n.FAILED_CHANGE_PASSWORD = "fcp", n.FAILED_BY_CONNECTOR = "fc", n.FAILED_LOGIN_INVALID_EMAIL_USERNAME = "fu", n.FAILED_HOOK = "fh", n.FAILED_CROSS_ORIGIN_AUTHENTICATION = "fcoa", n.SUCCESS_API_OPERATION = "sapi", n.SUCCESS_CHANGE_PASSWORD = "scp", n.SUCCESS_CHANGE_PASSWORD_REQUEST = "scpr", n.SUCCESS_CHANGE_USERNAME = "scu", n.SUCCESS_CROSS_ORIGIN_AUTHENTICATION = "scoa", n.SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN = "seacft", n.SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN = "serft", n.SUCCESS_LOGIN = "s", n.SUCCESS_LOGOUT = "slo", n.SUCCESS_SIGNUP = "ss", n.SUCCESS_SILENT_AUTH = "ssa", n.SUCCESS_VERIFICATION_EMAIL = "sv", n.SUCCESS_VERIFICATION_EMAIL_REQUEST = "svr", n.CODE_LINK_SENT = "cls", n.BLOCKED_ACCOUNT_EMAIL = "limit_wc", n.BLOCKED_ACCOUNT_IP = "limit_sul", n.BLOCKED_IP_ADDRESS = "limit_mu", n))(ye || {});
|
|
1724
1724
|
const Mh = a.enum([
|
|
1725
1725
|
"cls",
|
|
1726
1726
|
// CODE_LINK_SENT
|
|
@@ -3719,7 +3719,7 @@ function Fn(n) {
|
|
|
3719
3719
|
sort_order: i
|
|
3720
3720
|
};
|
|
3721
3721
|
}
|
|
3722
|
-
function
|
|
3722
|
+
function xe(n, e) {
|
|
3723
3723
|
return {
|
|
3724
3724
|
type: e.type,
|
|
3725
3725
|
description: e.description || "",
|
|
@@ -3764,11 +3764,11 @@ var lg = {
|
|
|
3764
3764
|
}
|
|
3765
3765
|
return typeof (n == null ? void 0 : n.EdgeRuntime) == "string" ? "edge-light" : (n == null ? void 0 : n.fastly) !== void 0 ? "fastly" : ((i = (t = n == null ? void 0 : n.process) == null ? void 0 : t.release) == null ? void 0 : i.name) === "node" ? "node" : "other";
|
|
3766
3766
|
}, dg = (n) => navigator.userAgent.startsWith(n);
|
|
3767
|
-
function
|
|
3767
|
+
function _t(n, e) {
|
|
3768
3768
|
ug() === "workerd" && n.executionCtx.waitUntil(e);
|
|
3769
3769
|
}
|
|
3770
3770
|
const yl = mn.extend({
|
|
3771
|
-
users: a.array(
|
|
3771
|
+
users: a.array(St)
|
|
3772
3772
|
}), pg = mn.extend({
|
|
3773
3773
|
sessions: a.array(Sd)
|
|
3774
3774
|
}), fg = new _e().openapi(
|
|
@@ -3792,7 +3792,7 @@ const yl = mn.extend({
|
|
|
3792
3792
|
content: {
|
|
3793
3793
|
"application/json": {
|
|
3794
3794
|
schema: a.union([
|
|
3795
|
-
a.array(
|
|
3795
|
+
a.array(St),
|
|
3796
3796
|
yl
|
|
3797
3797
|
])
|
|
3798
3798
|
}
|
|
@@ -3822,7 +3822,7 @@ const yl = mn.extend({
|
|
|
3822
3822
|
throw new O(500, {
|
|
3823
3823
|
message: "Primary account not found"
|
|
3824
3824
|
});
|
|
3825
|
-
return n.json([
|
|
3825
|
+
return n.json([St.parse(h)]);
|
|
3826
3826
|
}
|
|
3827
3827
|
const c = ["-_exists_:linked_to"];
|
|
3828
3828
|
s && c.push(s);
|
|
@@ -3840,7 +3840,7 @@ const yl = mn.extend({
|
|
|
3840
3840
|
start: l.start,
|
|
3841
3841
|
limit: l.limit
|
|
3842
3842
|
})
|
|
3843
|
-
) : n.json(a.array(
|
|
3843
|
+
) : n.json(a.array(St).parse(u));
|
|
3844
3844
|
}
|
|
3845
3845
|
).openapi(
|
|
3846
3846
|
Z({
|
|
@@ -3864,7 +3864,7 @@ const yl = mn.extend({
|
|
|
3864
3864
|
200: {
|
|
3865
3865
|
content: {
|
|
3866
3866
|
"application/json": {
|
|
3867
|
-
schema:
|
|
3867
|
+
schema: St
|
|
3868
3868
|
}
|
|
3869
3869
|
},
|
|
3870
3870
|
description: "List of users"
|
|
@@ -3937,7 +3937,7 @@ const yl = mn.extend({
|
|
|
3937
3937
|
200: {
|
|
3938
3938
|
content: {
|
|
3939
3939
|
"application/json": {
|
|
3940
|
-
schema:
|
|
3940
|
+
schema: St
|
|
3941
3941
|
}
|
|
3942
3942
|
},
|
|
3943
3943
|
description: "Status"
|
|
@@ -3966,11 +3966,11 @@ const yl = mn.extend({
|
|
|
3966
3966
|
last_login: (/* @__PURE__ */ new Date()).toISOString()
|
|
3967
3967
|
});
|
|
3968
3968
|
n.set("user_id", o.user_id);
|
|
3969
|
-
const c =
|
|
3970
|
-
type:
|
|
3969
|
+
const c = xe(n, {
|
|
3970
|
+
type: ye.SUCCESS_API_OPERATION,
|
|
3971
3971
|
description: "User created"
|
|
3972
3972
|
});
|
|
3973
|
-
|
|
3973
|
+
_t(n, n.env.data.logs.create(e, c));
|
|
3974
3974
|
const l = {
|
|
3975
3975
|
...o,
|
|
3976
3976
|
identities: [
|
|
@@ -3982,7 +3982,7 @@ const yl = mn.extend({
|
|
|
3982
3982
|
}
|
|
3983
3983
|
]
|
|
3984
3984
|
};
|
|
3985
|
-
return n.json(
|
|
3985
|
+
return n.json(St.parse(l), {
|
|
3986
3986
|
status: 201
|
|
3987
3987
|
});
|
|
3988
3988
|
} catch (o) {
|
|
@@ -4162,7 +4162,7 @@ const yl = mn.extend({
|
|
|
4162
4162
|
200: {
|
|
4163
4163
|
content: {
|
|
4164
4164
|
"application/json": {
|
|
4165
|
-
schema: a.array(
|
|
4165
|
+
schema: a.array(St)
|
|
4166
4166
|
}
|
|
4167
4167
|
},
|
|
4168
4168
|
description: "Status"
|
|
@@ -4180,7 +4180,7 @@ const yl = mn.extend({
|
|
|
4180
4180
|
const s = await n.env.data.users.get(e, t);
|
|
4181
4181
|
if (!s)
|
|
4182
4182
|
throw new O(404);
|
|
4183
|
-
return n.json([
|
|
4183
|
+
return n.json([St.parse(s)]);
|
|
4184
4184
|
}
|
|
4185
4185
|
).openapi(
|
|
4186
4186
|
Z({
|
|
@@ -4384,11 +4384,11 @@ var vl;
|
|
|
4384
4384
|
}
|
|
4385
4385
|
function A(k, I, j, L) {
|
|
4386
4386
|
for (var X = k.length - 1; X >= 0; --X) {
|
|
4387
|
-
var Ee = k[X],
|
|
4388
|
-
if (!z(
|
|
4389
|
-
if (!pe(
|
|
4387
|
+
var Ee = k[X], Se = Ee(I, j, L);
|
|
4388
|
+
if (!z(Se) && !Ie(Se)) {
|
|
4389
|
+
if (!pe(Se))
|
|
4390
4390
|
throw new TypeError();
|
|
4391
|
-
L =
|
|
4391
|
+
L = Se;
|
|
4392
4392
|
}
|
|
4393
4393
|
}
|
|
4394
4394
|
return L;
|
|
@@ -4445,15 +4445,15 @@ var vl;
|
|
|
4445
4445
|
return j;
|
|
4446
4446
|
if (j.length <= 0)
|
|
4447
4447
|
return X;
|
|
4448
|
-
for (var Ee = new x(),
|
|
4448
|
+
for (var Ee = new x(), Se = [], ie = 0, M = j; ie < M.length; ie++) {
|
|
4449
4449
|
var H = M[ie], G = Ee.has(H);
|
|
4450
|
-
G || (Ee.add(H),
|
|
4450
|
+
G || (Ee.add(H), Se.push(H));
|
|
4451
4451
|
}
|
|
4452
4452
|
for (var J = 0, re = X; J < re.length; J++) {
|
|
4453
4453
|
var H = re[J], G = Ee.has(H);
|
|
4454
|
-
G || (Ee.add(H),
|
|
4454
|
+
G || (Ee.add(H), Se.push(H));
|
|
4455
4455
|
}
|
|
4456
|
-
return
|
|
4456
|
+
return Se;
|
|
4457
4457
|
}
|
|
4458
4458
|
function te(k, I) {
|
|
4459
4459
|
var j = ei(
|
|
@@ -4612,12 +4612,12 @@ var vl;
|
|
|
4612
4612
|
var k;
|
|
4613
4613
|
!z(_) && typeof t.Reflect < "u" && !(_ in t.Reflect) && typeof t.Reflect.defineMetadata == "function" && (k = ih(t.Reflect));
|
|
4614
4614
|
var I, j, L, X = new h(), Ee = {
|
|
4615
|
-
registerProvider:
|
|
4615
|
+
registerProvider: Se,
|
|
4616
4616
|
getProvider: M,
|
|
4617
4617
|
setProvider: G
|
|
4618
4618
|
};
|
|
4619
4619
|
return Ee;
|
|
4620
|
-
function
|
|
4620
|
+
function Se(J) {
|
|
4621
4621
|
if (!Object.isExtensible(Ee))
|
|
4622
4622
|
throw new Error("Cannot add provider to a frozen registry.");
|
|
4623
4623
|
switch (!0) {
|
|
@@ -4647,10 +4647,10 @@ var vl;
|
|
|
4647
4647
|
return I;
|
|
4648
4648
|
if (!z(L))
|
|
4649
4649
|
for (var he = Yc(L); ; ) {
|
|
4650
|
-
var
|
|
4651
|
-
if (!
|
|
4650
|
+
var ve = Qc(he);
|
|
4651
|
+
if (!ve)
|
|
4652
4652
|
return;
|
|
4653
|
-
var st = Xc(
|
|
4653
|
+
var st = Xc(ve);
|
|
4654
4654
|
if (st.isProviderFor(J, re))
|
|
4655
4655
|
return el(he), st;
|
|
4656
4656
|
}
|
|
@@ -4660,8 +4660,8 @@ var vl;
|
|
|
4660
4660
|
return k;
|
|
4661
4661
|
}
|
|
4662
4662
|
function M(J, re) {
|
|
4663
|
-
var he = X.get(J),
|
|
4664
|
-
return z(he) || (
|
|
4663
|
+
var he = X.get(J), ve;
|
|
4664
|
+
return z(he) || (ve = he.get(re)), z(ve) && (ve = ie(J, re), z(ve) || (z(he) && (he = new m(), X.set(J, he)), he.set(re, ve))), ve;
|
|
4665
4665
|
}
|
|
4666
4666
|
function H(J) {
|
|
4667
4667
|
if (z(J))
|
|
@@ -4671,9 +4671,9 @@ var vl;
|
|
|
4671
4671
|
function G(J, re, he) {
|
|
4672
4672
|
if (!H(he))
|
|
4673
4673
|
throw new Error("Metadata provider not registered.");
|
|
4674
|
-
var
|
|
4675
|
-
if (
|
|
4676
|
-
if (!z(
|
|
4674
|
+
var ve = M(J, re);
|
|
4675
|
+
if (ve !== he) {
|
|
4676
|
+
if (!z(ve))
|
|
4677
4677
|
return !1;
|
|
4678
4678
|
var st = X.get(J);
|
|
4679
4679
|
z(st) && (st = new m(), X.set(J, st)), st.set(re, he);
|
|
@@ -4696,7 +4696,7 @@ var vl;
|
|
|
4696
4696
|
var J = I.get(H);
|
|
4697
4697
|
return z(J) ? !1 : J.has(G);
|
|
4698
4698
|
},
|
|
4699
|
-
OrdinaryDefineOwnMetadata:
|
|
4699
|
+
OrdinaryDefineOwnMetadata: Se,
|
|
4700
4700
|
OrdinaryHasOwnMetadata: X,
|
|
4701
4701
|
OrdinaryGetOwnMetadata: Ee,
|
|
4702
4702
|
OrdinaryOwnMetadataKeys: ie,
|
|
@@ -4710,14 +4710,14 @@ var vl;
|
|
|
4710
4710
|
return;
|
|
4711
4711
|
re = new m(), I.set(H, re), he = !0;
|
|
4712
4712
|
}
|
|
4713
|
-
var
|
|
4714
|
-
if (z(
|
|
4713
|
+
var ve = re.get(G);
|
|
4714
|
+
if (z(ve)) {
|
|
4715
4715
|
if (!J)
|
|
4716
4716
|
return;
|
|
4717
|
-
if (
|
|
4717
|
+
if (ve = new m(), re.set(G, ve), !k.setProvider(H, G, j))
|
|
4718
4718
|
throw re.delete(G), he && I.delete(H), new Error("Wrong provider for target.");
|
|
4719
4719
|
}
|
|
4720
|
-
return
|
|
4720
|
+
return ve;
|
|
4721
4721
|
}
|
|
4722
4722
|
function X(H, G, J) {
|
|
4723
4723
|
var re = L(
|
|
@@ -4738,7 +4738,7 @@ var vl;
|
|
|
4738
4738
|
if (!z(re))
|
|
4739
4739
|
return re.get(H);
|
|
4740
4740
|
}
|
|
4741
|
-
function
|
|
4741
|
+
function Se(H, G, J, re) {
|
|
4742
4742
|
var he = L(
|
|
4743
4743
|
J,
|
|
4744
4744
|
re,
|
|
@@ -4756,8 +4756,8 @@ var vl;
|
|
|
4756
4756
|
);
|
|
4757
4757
|
if (z(re))
|
|
4758
4758
|
return J;
|
|
4759
|
-
for (var he = re.keys(),
|
|
4760
|
-
var tl = Qc(
|
|
4759
|
+
for (var he = re.keys(), ve = Yc(he), st = 0; ; ) {
|
|
4760
|
+
var tl = Qc(ve);
|
|
4761
4761
|
if (!tl)
|
|
4762
4762
|
return J.length = st, J;
|
|
4763
4763
|
var ah = Xc(tl);
|
|
@@ -4765,7 +4765,7 @@ var vl;
|
|
|
4765
4765
|
J[st] = ah;
|
|
4766
4766
|
} catch (ch) {
|
|
4767
4767
|
try {
|
|
4768
|
-
el(
|
|
4768
|
+
el(ve);
|
|
4769
4769
|
} finally {
|
|
4770
4770
|
throw ch;
|
|
4771
4771
|
}
|
|
@@ -4790,10 +4790,10 @@ var vl;
|
|
|
4790
4790
|
}
|
|
4791
4791
|
}
|
|
4792
4792
|
function ih(k) {
|
|
4793
|
-
var I = k.defineMetadata, j = k.hasOwnMetadata, L = k.getOwnMetadata, X = k.getOwnMetadataKeys, Ee = k.deleteMetadata,
|
|
4793
|
+
var I = k.defineMetadata, j = k.hasOwnMetadata, L = k.getOwnMetadata, X = k.getOwnMetadataKeys, Ee = k.deleteMetadata, Se = new h(), ie = {
|
|
4794
4794
|
isProviderFor: function(M, H) {
|
|
4795
|
-
var G =
|
|
4796
|
-
return !z(G) && G.has(H) ? !0 : X(M, H).length ? (z(G) && (G = new x(),
|
|
4795
|
+
var G = Se.get(M);
|
|
4796
|
+
return !z(G) && G.has(H) ? !0 : X(M, H).length ? (z(G) && (G = new x(), Se.set(M, G)), G.add(H), !0) : !1;
|
|
4797
4797
|
},
|
|
4798
4798
|
OrdinaryDefineOwnMetadata: I,
|
|
4799
4799
|
OrdinaryHasOwnMetadata: j,
|
|
@@ -4888,7 +4888,7 @@ var vl;
|
|
|
4888
4888
|
}, ie.prototype.values = function() {
|
|
4889
4889
|
return new j(this._keys, this._values, Ee);
|
|
4890
4890
|
}, ie.prototype.entries = function() {
|
|
4891
|
-
return new j(this._keys, this._values,
|
|
4891
|
+
return new j(this._keys, this._values, Se);
|
|
4892
4892
|
}, ie.prototype["@@iterator"] = function() {
|
|
4893
4893
|
return this.entries();
|
|
4894
4894
|
}, ie.prototype[o] = function() {
|
|
@@ -4913,7 +4913,7 @@ var vl;
|
|
|
4913
4913
|
function Ee(ie, M) {
|
|
4914
4914
|
return M;
|
|
4915
4915
|
}
|
|
4916
|
-
function
|
|
4916
|
+
function Se(ie, M) {
|
|
4917
4917
|
return [ie, M];
|
|
4918
4918
|
}
|
|
4919
4919
|
}
|
|
@@ -5014,7 +5014,7 @@ var vl;
|
|
|
5014
5014
|
M[G] = Math.random() * 255 | 0;
|
|
5015
5015
|
return M;
|
|
5016
5016
|
}
|
|
5017
|
-
function
|
|
5017
|
+
function Se(M) {
|
|
5018
5018
|
if (typeof Uint8Array == "function") {
|
|
5019
5019
|
var H = new Uint8Array(M);
|
|
5020
5020
|
return typeof crypto < "u" ? crypto.getRandomValues(H) : typeof msCrypto < "u" ? msCrypto.getRandomValues(H) : Ee(H, M), H;
|
|
@@ -5022,7 +5022,7 @@ var vl;
|
|
|
5022
5022
|
return Ee(new Array(M), M);
|
|
5023
5023
|
}
|
|
5024
5024
|
function ie() {
|
|
5025
|
-
var M =
|
|
5025
|
+
var M = Se(k);
|
|
5026
5026
|
M[6] = M[6] & 79 | 64, M[8] = M[8] & 191 | 128;
|
|
5027
5027
|
for (var H = "", G = 0; G < k; ++G) {
|
|
5028
5028
|
var J = M[G];
|
|
@@ -5479,7 +5479,7 @@ function Wa(n) {
|
|
|
5479
5479
|
}
|
|
5480
5480
|
return i.buffer;
|
|
5481
5481
|
}
|
|
5482
|
-
function
|
|
5482
|
+
function Bt(n, e, t, i) {
|
|
5483
5483
|
return e instanceof Uint8Array ? e.byteLength ? t < 0 ? (n.error = "Wrong parameter: inputOffset less than zero", !1) : i < 0 ? (n.error = "Wrong parameter: inputLength less than zero", !1) : e.byteLength - t - i < 0 ? (n.error = "End of input reached before message was fully decoded (inconsistent offset and length values)", !1) : !0 : (n.error = "Wrong parameter: inputBuffer has zero length", !1) : (n.error = "Wrong parameter: inputBuffer must be 'Uint8Array'", !1);
|
|
5484
5484
|
}
|
|
5485
5485
|
class Xr {
|
|
@@ -5494,7 +5494,7 @@ class Xr {
|
|
|
5494
5494
|
}
|
|
5495
5495
|
}
|
|
5496
5496
|
const ni = [new Uint8Array([1])], bl = "0123456789", Xs = "name", kl = "valueHexView", bg = "isHexOnly", kg = "idBlock", xg = "tagClass", Sg = "tagNumber", Ag = "isConstructed", Ig = "fromBER", Eg = "toBER", $g = "local", Me = "", ut = new ArrayBuffer(0), Qr = new Uint8Array(0), _i = "EndOfContent", jd = "OCTET STRING", Nd = "BIT STRING";
|
|
5497
|
-
function
|
|
5497
|
+
function wt(n) {
|
|
5498
5498
|
var e;
|
|
5499
5499
|
return e = class extends n {
|
|
5500
5500
|
constructor(...i) {
|
|
@@ -5511,7 +5511,7 @@ function vt(n) {
|
|
|
5511
5511
|
}
|
|
5512
5512
|
fromBER(i, r, s) {
|
|
5513
5513
|
const o = i instanceof ArrayBuffer ? new Uint8Array(i) : i;
|
|
5514
|
-
if (!
|
|
5514
|
+
if (!Bt(this, o, r, s))
|
|
5515
5515
|
return -1;
|
|
5516
5516
|
const c = r + s;
|
|
5517
5517
|
return this.valueHexView = o.subarray(r, c), this.valueHexView.length ? (this.blockLength = s, c) : (this.warnings.push("Zero buffer length"), r);
|
|
@@ -5561,7 +5561,7 @@ class Le extends yn {
|
|
|
5561
5561
|
}
|
|
5562
5562
|
}
|
|
5563
5563
|
Le.NAME = "valueBlock";
|
|
5564
|
-
class Od extends
|
|
5564
|
+
class Od extends wt(yn) {
|
|
5565
5565
|
constructor({ idBlock: e = {} } = {}) {
|
|
5566
5566
|
var t, i, r, s;
|
|
5567
5567
|
super(), e ? (this.isHexOnly = (t = e.isHexOnly) !== null && t !== void 0 ? t : !1, this.valueHexView = e.valueHex ? V.toUint8Array(e.valueHex) : Qr, this.tagClass = (i = e.tagClass) !== null && i !== void 0 ? i : -1, this.tagNumber = (r = e.tagNumber) !== null && r !== void 0 ? r : -1, this.isConstructed = (s = e.isConstructed) !== null && s !== void 0 ? s : !1) : (this.tagClass = -1, this.tagNumber = -1, this.isConstructed = !1);
|
|
@@ -5612,7 +5612,7 @@ class Od extends vt(yn) {
|
|
|
5612
5612
|
}
|
|
5613
5613
|
fromBER(e, t, i) {
|
|
5614
5614
|
const r = V.toUint8Array(e);
|
|
5615
|
-
if (!
|
|
5615
|
+
if (!Bt(this, r, t, i))
|
|
5616
5616
|
return -1;
|
|
5617
5617
|
const s = r.subarray(t, t + i);
|
|
5618
5618
|
if (s.length === 0)
|
|
@@ -5692,7 +5692,7 @@ class Bd extends yn {
|
|
|
5692
5692
|
}
|
|
5693
5693
|
fromBER(e, t, i) {
|
|
5694
5694
|
const r = V.toUint8Array(e);
|
|
5695
|
-
if (!
|
|
5695
|
+
if (!Bt(this, r, t, i))
|
|
5696
5696
|
return -1;
|
|
5697
5697
|
const s = r.subarray(t, t + i);
|
|
5698
5698
|
if (s.length === 0)
|
|
@@ -5814,7 +5814,7 @@ class Ga extends je {
|
|
|
5814
5814
|
}
|
|
5815
5815
|
}
|
|
5816
5816
|
Ga.NAME = "BaseStringBlock";
|
|
5817
|
-
class Pd extends
|
|
5817
|
+
class Pd extends wt(Le) {
|
|
5818
5818
|
constructor({ isHexOnly: e = !0, ...t } = {}) {
|
|
5819
5819
|
super(t), this.isHexOnly = e;
|
|
5820
5820
|
}
|
|
@@ -5839,7 +5839,7 @@ function Hn(n, e = 0, t = n.length) {
|
|
|
5839
5839
|
const i = e;
|
|
5840
5840
|
let r = new je({}, Le);
|
|
5841
5841
|
const s = new yn();
|
|
5842
|
-
if (!
|
|
5842
|
+
if (!Bt(s, n, e, t))
|
|
5843
5843
|
return r.error = s.error, {
|
|
5844
5844
|
offset: -1,
|
|
5845
5845
|
result: r
|
|
@@ -6010,7 +6010,7 @@ class Ut extends Le {
|
|
|
6010
6010
|
}
|
|
6011
6011
|
fromBER(e, t, i) {
|
|
6012
6012
|
const r = V.toUint8Array(e);
|
|
6013
|
-
if (!
|
|
6013
|
+
if (!Bt(this, r, t, i))
|
|
6014
6014
|
return -1;
|
|
6015
6015
|
if (this.valueBeforeDecodeView = r.subarray(t, t + i), this.valueBeforeDecodeView.length === 0)
|
|
6016
6016
|
return this.warnings.push("Zero buffer length"), t;
|
|
@@ -6108,7 +6108,7 @@ class on extends je {
|
|
|
6108
6108
|
Md = on;
|
|
6109
6109
|
F.Null = Md;
|
|
6110
6110
|
on.NAME = "NULL";
|
|
6111
|
-
class zd extends
|
|
6111
|
+
class zd extends wt(Le) {
|
|
6112
6112
|
constructor({ value: e, ...t } = {}) {
|
|
6113
6113
|
super(t), t.valueHex ? this.valueHexView = V.toUint8Array(t.valueHex) : this.valueHexView = new Uint8Array(1), e && (this.value = e);
|
|
6114
6114
|
}
|
|
@@ -6123,7 +6123,7 @@ class zd extends vt(Le) {
|
|
|
6123
6123
|
}
|
|
6124
6124
|
fromBER(e, t, i) {
|
|
6125
6125
|
const r = V.toUint8Array(e);
|
|
6126
|
-
return
|
|
6126
|
+
return Bt(this, r, t, i) ? (this.valueHexView = r.subarray(t, t + i), i > 1 && this.warnings.push("Boolean value encoded in more then 1 octet"), this.isHexOnly = !0, Cd.call(this), this.blockLength = i, t + i) : -1;
|
|
6127
6127
|
}
|
|
6128
6128
|
toBER() {
|
|
6129
6129
|
return this.valueHexView.slice();
|
|
@@ -6154,7 +6154,7 @@ class es extends je {
|
|
|
6154
6154
|
Dd = es;
|
|
6155
6155
|
F.Boolean = Dd;
|
|
6156
6156
|
es.NAME = "BOOLEAN";
|
|
6157
|
-
class Fd extends
|
|
6157
|
+
class Fd extends wt(Ut) {
|
|
6158
6158
|
constructor({ isConstructed: e = !1, ...t } = {}) {
|
|
6159
6159
|
super(t), this.isConstructed = e;
|
|
6160
6160
|
}
|
|
@@ -6234,7 +6234,7 @@ let Qt = class qd extends je {
|
|
|
6234
6234
|
Hd = Qt;
|
|
6235
6235
|
F.OctetString = Hd;
|
|
6236
6236
|
Qt.NAME = jd;
|
|
6237
|
-
class Kd extends
|
|
6237
|
+
class Kd extends wt(Ut) {
|
|
6238
6238
|
constructor({ unusedBits: e = 0, isConstructed: t = !1, ...i } = {}) {
|
|
6239
6239
|
super(i), this.unusedBits = e, this.isConstructed = t, this.blockLength = this.valueHexView.byteLength;
|
|
6240
6240
|
}
|
|
@@ -6262,7 +6262,7 @@ class Kd extends vt(Ut) {
|
|
|
6262
6262
|
return r;
|
|
6263
6263
|
}
|
|
6264
6264
|
const s = V.toUint8Array(e);
|
|
6265
|
-
if (!
|
|
6265
|
+
if (!Bt(this, s, t, i))
|
|
6266
6266
|
return -1;
|
|
6267
6267
|
const o = s.subarray(t, t + i);
|
|
6268
6268
|
if (this.unusedBits = o[0], this.unusedBits > 7)
|
|
@@ -6393,7 +6393,7 @@ function Og(n, e) {
|
|
|
6393
6393
|
}
|
|
6394
6394
|
return s.slice();
|
|
6395
6395
|
}
|
|
6396
|
-
class Za extends
|
|
6396
|
+
class Za extends wt(Le) {
|
|
6397
6397
|
constructor({ value: e, ...t } = {}) {
|
|
6398
6398
|
super(t), this._valueDec = 0, t.valueHex && this.setValueHex(), e !== void 0 && (this.valueDec = e);
|
|
6399
6399
|
}
|
|
@@ -6476,7 +6476,7 @@ Object.defineProperty(Gd.prototype, "valueHex", {
|
|
|
6476
6476
|
}
|
|
6477
6477
|
});
|
|
6478
6478
|
var Jd;
|
|
6479
|
-
class
|
|
6479
|
+
class mt extends je {
|
|
6480
6480
|
constructor(e = {}) {
|
|
6481
6481
|
super(e, Za), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 2;
|
|
6482
6482
|
}
|
|
@@ -6493,16 +6493,16 @@ class _t extends je {
|
|
|
6493
6493
|
p[0] |= 128, i.write(p);
|
|
6494
6494
|
} else
|
|
6495
6495
|
s[0] & 128 && i.write(new Uint8Array([0])), i.write(s);
|
|
6496
|
-
return new
|
|
6496
|
+
return new mt({
|
|
6497
6497
|
valueHex: i.final()
|
|
6498
6498
|
});
|
|
6499
6499
|
}
|
|
6500
6500
|
convertToDER() {
|
|
6501
|
-
const e = new
|
|
6501
|
+
const e = new mt({ valueHex: this.valueBlock.valueHexView });
|
|
6502
6502
|
return e.valueBlock.toDER(), e;
|
|
6503
6503
|
}
|
|
6504
6504
|
convertFromDER() {
|
|
6505
|
-
return new
|
|
6505
|
+
return new mt({
|
|
6506
6506
|
valueHex: this.valueBlock.valueHexView[0] === 0 ? this.valueBlock.valueHexView.subarray(1) : this.valueBlock.valueHexView
|
|
6507
6507
|
});
|
|
6508
6508
|
}
|
|
@@ -6510,11 +6510,11 @@ class _t extends je {
|
|
|
6510
6510
|
return `${this.constructor.NAME} : ${this.valueBlock.toString()}`;
|
|
6511
6511
|
}
|
|
6512
6512
|
}
|
|
6513
|
-
Jd =
|
|
6513
|
+
Jd = mt;
|
|
6514
6514
|
F.Integer = Jd;
|
|
6515
|
-
|
|
6515
|
+
mt.NAME = "INTEGER";
|
|
6516
6516
|
var Zd;
|
|
6517
|
-
class ts extends
|
|
6517
|
+
class ts extends mt {
|
|
6518
6518
|
constructor(e = {}) {
|
|
6519
6519
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 10;
|
|
6520
6520
|
}
|
|
@@ -6522,7 +6522,7 @@ class ts extends _t {
|
|
|
6522
6522
|
Zd = ts;
|
|
6523
6523
|
F.Enumerated = Zd;
|
|
6524
6524
|
ts.NAME = "ENUMERATED";
|
|
6525
|
-
class bo extends
|
|
6525
|
+
class bo extends wt(Le) {
|
|
6526
6526
|
constructor({ valueDec: e = -1, isFirstSid: t = !1, ...i } = {}) {
|
|
6527
6527
|
super(i), this.valueDec = e, this.isFirstSid = t;
|
|
6528
6528
|
}
|
|
@@ -6530,7 +6530,7 @@ class bo extends vt(Le) {
|
|
|
6530
6530
|
if (!i)
|
|
6531
6531
|
return t;
|
|
6532
6532
|
const r = V.toUint8Array(e);
|
|
6533
|
-
if (!
|
|
6533
|
+
if (!Bt(this, r, t, i))
|
|
6534
6534
|
return -1;
|
|
6535
6535
|
const s = r.subarray(t, t + i);
|
|
6536
6536
|
this.valueHexView = new Uint8Array(i);
|
|
@@ -6697,7 +6697,7 @@ class ns extends je {
|
|
|
6697
6697
|
Xd = ns;
|
|
6698
6698
|
F.ObjectIdentifier = Xd;
|
|
6699
6699
|
ns.NAME = "OBJECT IDENTIFIER";
|
|
6700
|
-
class ko extends
|
|
6700
|
+
class ko extends wt(yn) {
|
|
6701
6701
|
constructor({ valueDec: e = 0, ...t } = {}) {
|
|
6702
6702
|
super(t), this.valueDec = e;
|
|
6703
6703
|
}
|
|
@@ -6705,7 +6705,7 @@ class ko extends vt(yn) {
|
|
|
6705
6705
|
if (i === 0)
|
|
6706
6706
|
return t;
|
|
6707
6707
|
const r = V.toUint8Array(e);
|
|
6708
|
-
if (!
|
|
6708
|
+
if (!Bt(this, r, t, i))
|
|
6709
6709
|
return -1;
|
|
6710
6710
|
const s = r.subarray(t, t + i);
|
|
6711
6711
|
this.valueHexView = new Uint8Array(i);
|
|
@@ -6831,24 +6831,24 @@ ep = Ya;
|
|
|
6831
6831
|
F.RelativeObjectIdentifier = ep;
|
|
6832
6832
|
Ya.NAME = "RelativeObjectIdentifier";
|
|
6833
6833
|
var tp;
|
|
6834
|
-
class
|
|
6834
|
+
class It extends ze {
|
|
6835
6835
|
constructor(e = {}) {
|
|
6836
6836
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 16;
|
|
6837
6837
|
}
|
|
6838
6838
|
}
|
|
6839
|
-
tp =
|
|
6839
|
+
tp = It;
|
|
6840
6840
|
F.Sequence = tp;
|
|
6841
|
-
|
|
6841
|
+
It.NAME = "SEQUENCE";
|
|
6842
6842
|
var np;
|
|
6843
|
-
let
|
|
6843
|
+
let Et = class extends ze {
|
|
6844
6844
|
constructor(e = {}) {
|
|
6845
6845
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 17;
|
|
6846
6846
|
}
|
|
6847
6847
|
};
|
|
6848
|
-
np =
|
|
6848
|
+
np = Et;
|
|
6849
6849
|
F.Set = np;
|
|
6850
|
-
|
|
6851
|
-
class ip extends
|
|
6850
|
+
Et.NAME = "SET";
|
|
6851
|
+
class ip extends wt(Le) {
|
|
6852
6852
|
constructor({ ...e } = {}) {
|
|
6853
6853
|
super(e), this.isHexOnly = !0, this.value = Me;
|
|
6854
6854
|
}
|
|
@@ -6893,14 +6893,14 @@ class sp extends Je {
|
|
|
6893
6893
|
}
|
|
6894
6894
|
sp.NAME = "Utf8StringValueBlock";
|
|
6895
6895
|
var op;
|
|
6896
|
-
class
|
|
6896
|
+
class Tt extends sp {
|
|
6897
6897
|
constructor(e = {}) {
|
|
6898
6898
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 12;
|
|
6899
6899
|
}
|
|
6900
6900
|
}
|
|
6901
|
-
op =
|
|
6901
|
+
op = Tt;
|
|
6902
6902
|
F.Utf8String = op;
|
|
6903
|
-
|
|
6903
|
+
Tt.NAME = "UTF8String";
|
|
6904
6904
|
class ap extends Je {
|
|
6905
6905
|
fromBuffer(e) {
|
|
6906
6906
|
this.valueBlock.value = W.ToUtf16String(e), this.valueBlock.valueHexView = V.toUint8Array(e);
|
|
@@ -7214,7 +7214,7 @@ bp = fs;
|
|
|
7214
7214
|
F.GeneralizedTime = bp;
|
|
7215
7215
|
fs.NAME = "GeneralizedTime";
|
|
7216
7216
|
var kp;
|
|
7217
|
-
class Xa extends
|
|
7217
|
+
class Xa extends Tt {
|
|
7218
7218
|
constructor(e = {}) {
|
|
7219
7219
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 31;
|
|
7220
7220
|
}
|
|
@@ -7223,7 +7223,7 @@ kp = Xa;
|
|
|
7223
7223
|
F.DATE = kp;
|
|
7224
7224
|
Xa.NAME = "DATE";
|
|
7225
7225
|
var xp;
|
|
7226
|
-
class Qa extends
|
|
7226
|
+
class Qa extends Tt {
|
|
7227
7227
|
constructor(e = {}) {
|
|
7228
7228
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 32;
|
|
7229
7229
|
}
|
|
@@ -7232,7 +7232,7 @@ xp = Qa;
|
|
|
7232
7232
|
F.TimeOfDay = xp;
|
|
7233
7233
|
Qa.NAME = "TimeOfDay";
|
|
7234
7234
|
var Sp;
|
|
7235
|
-
class ec extends
|
|
7235
|
+
class ec extends Tt {
|
|
7236
7236
|
constructor(e = {}) {
|
|
7237
7237
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 33;
|
|
7238
7238
|
}
|
|
@@ -7241,7 +7241,7 @@ Sp = ec;
|
|
|
7241
7241
|
F.DateTime = Sp;
|
|
7242
7242
|
ec.NAME = "DateTime";
|
|
7243
7243
|
var Ap;
|
|
7244
|
-
class tc extends
|
|
7244
|
+
class tc extends Tt {
|
|
7245
7245
|
constructor(e = {}) {
|
|
7246
7246
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 34;
|
|
7247
7247
|
}
|
|
@@ -7250,7 +7250,7 @@ Ap = tc;
|
|
|
7250
7250
|
F.Duration = Ap;
|
|
7251
7251
|
tc.NAME = "Duration";
|
|
7252
7252
|
var Ip;
|
|
7253
|
-
class nc extends
|
|
7253
|
+
class nc extends Tt {
|
|
7254
7254
|
constructor(e = {}) {
|
|
7255
7255
|
super(e), this.idBlock.tagClass = 1, this.idBlock.tagNumber = 14;
|
|
7256
7256
|
}
|
|
@@ -7521,9 +7521,9 @@ const Ep = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7521
7521
|
GeneralString: ds,
|
|
7522
7522
|
GeneralizedTime: fs,
|
|
7523
7523
|
GraphicString: us,
|
|
7524
|
-
HexBlock:
|
|
7524
|
+
HexBlock: wt,
|
|
7525
7525
|
IA5String: ls,
|
|
7526
|
-
Integer:
|
|
7526
|
+
Integer: mt,
|
|
7527
7527
|
Null: on,
|
|
7528
7528
|
NumericString: ss,
|
|
7529
7529
|
ObjectIdentifier: ns,
|
|
@@ -7533,14 +7533,14 @@ const Ep = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
7533
7533
|
RawData: Bg,
|
|
7534
7534
|
RelativeObjectIdentifier: Ya,
|
|
7535
7535
|
Repeated: hr,
|
|
7536
|
-
Sequence:
|
|
7537
|
-
Set:
|
|
7536
|
+
Sequence: It,
|
|
7537
|
+
Set: Et,
|
|
7538
7538
|
TIME: nc,
|
|
7539
7539
|
TeletexString: as,
|
|
7540
7540
|
TimeOfDay: Qa,
|
|
7541
7541
|
UTCTime: Oi,
|
|
7542
7542
|
UniversalString: rs,
|
|
7543
|
-
Utf8String:
|
|
7543
|
+
Utf8String: Tt,
|
|
7544
7544
|
ValueBlock: Le,
|
|
7545
7545
|
VideotexString: cs,
|
|
7546
7546
|
ViewWriter: Xr,
|
|
@@ -7631,13 +7631,13 @@ const Pg = {
|
|
|
7631
7631
|
}
|
|
7632
7632
|
}, Rg = {
|
|
7633
7633
|
fromASN: (n) => n.valueBlock.valueHexView.byteLength >= 4 ? n.valueBlock.toString() : n.valueBlock.valueDec,
|
|
7634
|
-
toASN: (n) => new
|
|
7634
|
+
toASN: (n) => new mt({ value: +n })
|
|
7635
7635
|
}, Lg = {
|
|
7636
7636
|
fromASN: (n) => n.valueBlock.valueDec,
|
|
7637
7637
|
toASN: (n) => new ts({ value: n })
|
|
7638
7638
|
}, ge = {
|
|
7639
7639
|
fromASN: (n) => n.valueBlock.valueHexView,
|
|
7640
|
-
toASN: (n) => new
|
|
7640
|
+
toASN: (n) => new mt({ valueHex: n })
|
|
7641
7641
|
}, Ug = {
|
|
7642
7642
|
fromASN: (n) => n.valueBlock.valueHexView,
|
|
7643
7643
|
toASN: (n) => new en({ valueHex: n })
|
|
@@ -7660,7 +7660,7 @@ function tt(n) {
|
|
|
7660
7660
|
toASN: (e) => new n({ value: e })
|
|
7661
7661
|
};
|
|
7662
7662
|
}
|
|
7663
|
-
const $p = tt(
|
|
7663
|
+
const $p = tt(Tt), Dg = tt(is), Fg = tt(rs), Hg = tt(ss), qg = tt(os), Kg = tt(as), Wg = tt(cs), Gg = tt(ls), Jg = tt(us), Zg = tt(Ni), Yg = tt(ds), Xg = tt(ps), Qg = {
|
|
7664
7664
|
fromASN: (n) => n.toDate(),
|
|
7665
7665
|
toASN: (n) => new Oi({ valueDate: n })
|
|
7666
7666
|
}, e_ = {
|
|
@@ -7720,8 +7720,8 @@ function rc(n) {
|
|
|
7720
7720
|
return null;
|
|
7721
7721
|
}
|
|
7722
7722
|
}
|
|
7723
|
-
function
|
|
7724
|
-
return typeof n == "function" && n.prototype ? n.prototype.toASN && n.prototype.fromASN ? !0 :
|
|
7723
|
+
function At(n) {
|
|
7724
|
+
return typeof n == "function" && n.prototype ? n.prototype.toASN && n.prototype.fromASN ? !0 : At(n.prototype) : !!(n && typeof n == "object" && "toASN" in n && "fromASN" in n);
|
|
7725
7725
|
}
|
|
7726
7726
|
function Cp(n) {
|
|
7727
7727
|
var e;
|
|
@@ -7776,11 +7776,11 @@ class i_ {
|
|
|
7776
7776
|
if (!g)
|
|
7777
7777
|
throw new Error(`Cannot get ASN1 class by name '${p}'`);
|
|
7778
7778
|
l = new g({ name: c });
|
|
7779
|
-
} else
|
|
7779
|
+
} else At(o.type) ? l = new o.type().toSchema(c) : o.optional ? this.get(o.type).type === N.Choice ? l = new an({ name: c }) : (l = this.create(o.type, !1), l.name = c) : l = new an({ name: c });
|
|
7780
7780
|
const u = !!o.optional || o.defaultValue !== void 0;
|
|
7781
7781
|
if (o.repeated) {
|
|
7782
7782
|
l.name = "";
|
|
7783
|
-
const p = o.repeated === "set" ?
|
|
7783
|
+
const p = o.repeated === "set" ? Et : It;
|
|
7784
7784
|
l = new p({
|
|
7785
7785
|
name: "",
|
|
7786
7786
|
value: [
|
|
@@ -7793,7 +7793,7 @@ class i_ {
|
|
|
7793
7793
|
}
|
|
7794
7794
|
if (o.context !== null && o.context !== void 0)
|
|
7795
7795
|
if (o.implicit)
|
|
7796
|
-
if (typeof o.type == "number" ||
|
|
7796
|
+
if (typeof o.type == "number" || At(o.type)) {
|
|
7797
7797
|
const p = o.repeated ? ze : ji;
|
|
7798
7798
|
r.push(new p({
|
|
7799
7799
|
name: c,
|
|
@@ -7831,9 +7831,9 @@ class i_ {
|
|
|
7831
7831
|
}
|
|
7832
7832
|
switch (i.type) {
|
|
7833
7833
|
case N.Sequence:
|
|
7834
|
-
return new At({ value: r, name: "" });
|
|
7835
|
-
case N.Set:
|
|
7836
7834
|
return new It({ value: r, name: "" });
|
|
7835
|
+
case N.Set:
|
|
7836
|
+
return new Et({ value: r, name: "" });
|
|
7837
7837
|
case N.Choice:
|
|
7838
7838
|
return new ic({ value: r, name: "" });
|
|
7839
7839
|
default:
|
|
@@ -7878,7 +7878,7 @@ class r_ {
|
|
|
7878
7878
|
static fromASN(e, t) {
|
|
7879
7879
|
var i;
|
|
7880
7880
|
try {
|
|
7881
|
-
if (
|
|
7881
|
+
if (At(t))
|
|
7882
7882
|
return new t().fromASN(e);
|
|
7883
7883
|
const r = Ye.get(t);
|
|
7884
7884
|
Ye.cache(t);
|
|
@@ -7915,13 +7915,13 @@ class r_ {
|
|
|
7915
7915
|
if (!u)
|
|
7916
7916
|
continue;
|
|
7917
7917
|
const p = r.items[l], g = p.type;
|
|
7918
|
-
if (typeof g == "number" ||
|
|
7919
|
-
const m = (i = p.converter) !== null && i !== void 0 ? i :
|
|
7918
|
+
if (typeof g == "number" || At(g)) {
|
|
7919
|
+
const m = (i = p.converter) !== null && i !== void 0 ? i : At(g) ? new g() : null;
|
|
7920
7920
|
if (!m)
|
|
7921
7921
|
throw new Error("Converter is empty");
|
|
7922
7922
|
if (p.repeated)
|
|
7923
7923
|
if (p.implicit) {
|
|
7924
|
-
const x = p.repeated === "sequence" ?
|
|
7924
|
+
const x = p.repeated === "sequence" ? It : Et, h = new x();
|
|
7925
7925
|
h.valueBlock = u.valueBlock;
|
|
7926
7926
|
const _ = En(h.toBER(!1));
|
|
7927
7927
|
if (_.offset === -1)
|
|
@@ -7936,7 +7936,7 @@ class r_ {
|
|
|
7936
7936
|
let x = u;
|
|
7937
7937
|
if (p.implicit) {
|
|
7938
7938
|
let h;
|
|
7939
|
-
if (
|
|
7939
|
+
if (At(g))
|
|
7940
7940
|
h = new g().toSchema("");
|
|
7941
7941
|
else {
|
|
7942
7942
|
const _ = y[g], b = Ep[_];
|
|
@@ -7966,7 +7966,7 @@ class sc {
|
|
|
7966
7966
|
return e instanceof je ? e.toBER(!1) : this.toASN(e).toBER(!1);
|
|
7967
7967
|
}
|
|
7968
7968
|
static toASN(e) {
|
|
7969
|
-
if (e && typeof e == "object" &&
|
|
7969
|
+
if (e && typeof e == "object" && At(e))
|
|
7970
7970
|
return e.toASN();
|
|
7971
7971
|
if (!(e && typeof e == "object"))
|
|
7972
7972
|
throw new TypeError("Parameter 1 should be type of Object.");
|
|
@@ -7991,7 +7991,7 @@ class sc {
|
|
|
7991
7991
|
const u = sc.toAsnItem(c, o, t, l);
|
|
7992
7992
|
if (typeof c.context == "number")
|
|
7993
7993
|
if (c.implicit)
|
|
7994
|
-
if (!c.repeated && (typeof c.type == "number" ||
|
|
7994
|
+
if (!c.repeated && (typeof c.type == "number" || At(c.type))) {
|
|
7995
7995
|
const p = {};
|
|
7996
7996
|
p.valueHex = u instanceof on ? u.valueBeforeDecodeView : u.valueBlock.toBER(), r.push(new ji({
|
|
7997
7997
|
optional: c.optional,
|
|
@@ -8024,10 +8024,10 @@ class sc {
|
|
|
8024
8024
|
let s;
|
|
8025
8025
|
switch (i.type) {
|
|
8026
8026
|
case N.Sequence:
|
|
8027
|
-
s = new
|
|
8027
|
+
s = new It({ value: r });
|
|
8028
8028
|
break;
|
|
8029
8029
|
case N.Set:
|
|
8030
|
-
s = new
|
|
8030
|
+
s = new Et({ value: r });
|
|
8031
8031
|
break;
|
|
8032
8032
|
case N.Choice:
|
|
8033
8033
|
if (!r[0])
|
|
@@ -8046,7 +8046,7 @@ class sc {
|
|
|
8046
8046
|
if (e.repeated) {
|
|
8047
8047
|
if (!Array.isArray(r))
|
|
8048
8048
|
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
8049
|
-
const c = Array.from(r, (u) => o.toASN(u)), l = e.repeated === "sequence" ?
|
|
8049
|
+
const c = Array.from(r, (u) => o.toASN(u)), l = e.repeated === "sequence" ? It : Et;
|
|
8050
8050
|
s = new l({
|
|
8051
8051
|
value: c
|
|
8052
8052
|
});
|
|
@@ -8055,7 +8055,7 @@ class sc {
|
|
|
8055
8055
|
} else if (e.repeated) {
|
|
8056
8056
|
if (!Array.isArray(r))
|
|
8057
8057
|
throw new TypeError("Parameter 'objProp' should be type of Array.");
|
|
8058
|
-
const o = Array.from(r, (l) => this.toASN(l)), c = e.repeated === "sequence" ?
|
|
8058
|
+
const o = Array.from(r, (l) => this.toASN(l)), c = e.repeated === "sequence" ? It : Et;
|
|
8059
8059
|
s = new c({
|
|
8060
8060
|
value: o
|
|
8061
8061
|
});
|
|
@@ -8829,7 +8829,7 @@ Nl = No = d([
|
|
|
8829
8829
|
], Nl);
|
|
8830
8830
|
var Oo;
|
|
8831
8831
|
const Op = `${Ft}.32`;
|
|
8832
|
-
let
|
|
8832
|
+
let $t = class {
|
|
8833
8833
|
constructor(e = {}) {
|
|
8834
8834
|
Object.assign(this, e);
|
|
8835
8835
|
}
|
|
@@ -8839,26 +8839,26 @@ let Et = class {
|
|
|
8839
8839
|
};
|
|
8840
8840
|
d([
|
|
8841
8841
|
f({ type: y.IA5String })
|
|
8842
|
-
],
|
|
8842
|
+
], $t.prototype, "ia5String", void 0);
|
|
8843
8843
|
d([
|
|
8844
8844
|
f({ type: y.VisibleString })
|
|
8845
|
-
],
|
|
8845
|
+
], $t.prototype, "visibleString", void 0);
|
|
8846
8846
|
d([
|
|
8847
8847
|
f({ type: y.BmpString })
|
|
8848
|
-
],
|
|
8848
|
+
], $t.prototype, "bmpString", void 0);
|
|
8849
8849
|
d([
|
|
8850
8850
|
f({ type: y.Utf8String })
|
|
8851
|
-
],
|
|
8852
|
-
|
|
8851
|
+
], $t.prototype, "utf8String", void 0);
|
|
8852
|
+
$t = d([
|
|
8853
8853
|
T({ type: N.Choice })
|
|
8854
|
-
],
|
|
8854
|
+
], $t);
|
|
8855
8855
|
class lc {
|
|
8856
8856
|
constructor(e = {}) {
|
|
8857
|
-
this.organization = new
|
|
8857
|
+
this.organization = new $t(), this.noticeNumbers = [], Object.assign(this, e);
|
|
8858
8858
|
}
|
|
8859
8859
|
}
|
|
8860
8860
|
d([
|
|
8861
|
-
f({ type:
|
|
8861
|
+
f({ type: $t })
|
|
8862
8862
|
], lc.prototype, "organization", void 0);
|
|
8863
8863
|
d([
|
|
8864
8864
|
f({ type: y.Integer, repeated: "sequence" })
|
|
@@ -8872,7 +8872,7 @@ d([
|
|
|
8872
8872
|
f({ type: lc, optional: !0 })
|
|
8873
8873
|
], uc.prototype, "noticeRef", void 0);
|
|
8874
8874
|
d([
|
|
8875
|
-
f({ type:
|
|
8875
|
+
f({ type: $t, optional: !0 })
|
|
8876
8876
|
], uc.prototype, "explicitText", void 0);
|
|
8877
8877
|
let mr = class {
|
|
8878
8878
|
constructor(e = {}) {
|
|
@@ -9182,17 +9182,17 @@ let Ho = Fo = class extends Re {
|
|
|
9182
9182
|
Ho = Fo = d([
|
|
9183
9183
|
T({ type: N.Sequence })
|
|
9184
9184
|
], Ho);
|
|
9185
|
-
let
|
|
9185
|
+
let Ct = class {
|
|
9186
9186
|
constructor(e = {}) {
|
|
9187
9187
|
this.type = "", this.values = [], Object.assign(this, e);
|
|
9188
9188
|
}
|
|
9189
9189
|
};
|
|
9190
9190
|
d([
|
|
9191
9191
|
f({ type: y.ObjectIdentifier })
|
|
9192
|
-
],
|
|
9192
|
+
], Ct.prototype, "type", void 0);
|
|
9193
9193
|
d([
|
|
9194
9194
|
f({ type: y.Any, repeated: "set" })
|
|
9195
|
-
],
|
|
9195
|
+
], Ct.prototype, "values", void 0);
|
|
9196
9196
|
var qo;
|
|
9197
9197
|
let Rl = qo = class extends ue {
|
|
9198
9198
|
constructor(e) {
|
|
@@ -9200,7 +9200,7 @@ let Rl = qo = class extends ue {
|
|
|
9200
9200
|
}
|
|
9201
9201
|
};
|
|
9202
9202
|
Rl = qo = d([
|
|
9203
|
-
T({ type: N.Sequence, itemType:
|
|
9203
|
+
T({ type: N.Sequence, itemType: Ct })
|
|
9204
9204
|
], Rl);
|
|
9205
9205
|
const Vp = `${Ft}.14`;
|
|
9206
9206
|
class Vt extends cc {
|
|
@@ -9425,39 +9425,39 @@ d([
|
|
|
9425
9425
|
d([
|
|
9426
9426
|
f({ type: et, optional: !0, repeated: "sequence" })
|
|
9427
9427
|
], vs.prototype, "crlEntryExtensions", void 0);
|
|
9428
|
-
class
|
|
9428
|
+
class Pt {
|
|
9429
9429
|
constructor(e = {}) {
|
|
9430
9430
|
this.signature = new D(), this.issuer = new be(), this.thisUpdate = new Ce(), Object.assign(this, e);
|
|
9431
9431
|
}
|
|
9432
9432
|
}
|
|
9433
9433
|
d([
|
|
9434
9434
|
f({ type: y.Integer, optional: !0 })
|
|
9435
|
-
],
|
|
9435
|
+
], Pt.prototype, "version", void 0);
|
|
9436
9436
|
d([
|
|
9437
9437
|
f({ type: D })
|
|
9438
|
-
],
|
|
9438
|
+
], Pt.prototype, "signature", void 0);
|
|
9439
9439
|
d([
|
|
9440
9440
|
f({ type: be })
|
|
9441
|
-
],
|
|
9441
|
+
], Pt.prototype, "issuer", void 0);
|
|
9442
9442
|
d([
|
|
9443
9443
|
f({ type: Ce })
|
|
9444
|
-
],
|
|
9444
|
+
], Pt.prototype, "thisUpdate", void 0);
|
|
9445
9445
|
d([
|
|
9446
9446
|
f({ type: Ce, optional: !0 })
|
|
9447
|
-
],
|
|
9447
|
+
], Pt.prototype, "nextUpdate", void 0);
|
|
9448
9448
|
d([
|
|
9449
9449
|
f({ type: vs, repeated: "sequence", optional: !0 })
|
|
9450
|
-
],
|
|
9450
|
+
], Pt.prototype, "revokedCertificates", void 0);
|
|
9451
9451
|
d([
|
|
9452
9452
|
f({ type: et, optional: !0, context: 0, repeated: "sequence" })
|
|
9453
|
-
],
|
|
9453
|
+
], Pt.prototype, "crlExtensions", void 0);
|
|
9454
9454
|
class fc {
|
|
9455
9455
|
constructor(e = {}) {
|
|
9456
|
-
this.tbsCertList = new
|
|
9456
|
+
this.tbsCertList = new Pt(), this.signatureAlgorithm = new D(), this.signature = new ArrayBuffer(0), Object.assign(this, e);
|
|
9457
9457
|
}
|
|
9458
9458
|
}
|
|
9459
9459
|
d([
|
|
9460
|
-
f({ type:
|
|
9460
|
+
f({ type: Pt })
|
|
9461
9461
|
], fc.prototype, "tbsCertList", void 0);
|
|
9462
9462
|
d([
|
|
9463
9463
|
f({ type: D })
|
|
@@ -9490,10 +9490,10 @@ d([
|
|
|
9490
9490
|
Tn = d([
|
|
9491
9491
|
T({ type: N.Choice })
|
|
9492
9492
|
], Tn);
|
|
9493
|
-
var
|
|
9493
|
+
var jt;
|
|
9494
9494
|
(function(n) {
|
|
9495
9495
|
n[n.v0 = 0] = "v0", n[n.v1 = 1] = "v1", n[n.v2 = 2] = "v2", n[n.v3 = 3] = "v3", n[n.v4 = 4] = "v4", n[n.v5 = 5] = "v5";
|
|
9496
|
-
})(
|
|
9496
|
+
})(jt || (jt = {}));
|
|
9497
9497
|
let yi = class extends D {
|
|
9498
9498
|
};
|
|
9499
9499
|
yi = d([
|
|
@@ -9504,11 +9504,11 @@ let kr = class extends D {
|
|
|
9504
9504
|
kr = d([
|
|
9505
9505
|
T({ type: N.Sequence })
|
|
9506
9506
|
], kr);
|
|
9507
|
-
let
|
|
9507
|
+
let yt = class extends D {
|
|
9508
9508
|
};
|
|
9509
|
-
|
|
9509
|
+
yt = d([
|
|
9510
9510
|
T({ type: N.Sequence })
|
|
9511
|
-
],
|
|
9511
|
+
], yt);
|
|
9512
9512
|
let xr = class extends D {
|
|
9513
9513
|
};
|
|
9514
9514
|
xr = d([
|
|
@@ -9536,46 +9536,46 @@ d([
|
|
|
9536
9536
|
f({ type: y.Any, repeated: "set" })
|
|
9537
9537
|
], Gn.prototype, "attrValues", void 0);
|
|
9538
9538
|
var Jo;
|
|
9539
|
-
class
|
|
9539
|
+
class bt {
|
|
9540
9540
|
constructor(e = {}) {
|
|
9541
|
-
this.version =
|
|
9541
|
+
this.version = jt.v0, this.sid = new Tn(), this.digestAlgorithm = new yi(), this.signatureAlgorithm = new kr(), this.signature = new se(), Object.assign(this, e);
|
|
9542
9542
|
}
|
|
9543
9543
|
}
|
|
9544
9544
|
d([
|
|
9545
9545
|
f({ type: y.Integer })
|
|
9546
|
-
],
|
|
9546
|
+
], bt.prototype, "version", void 0);
|
|
9547
9547
|
d([
|
|
9548
9548
|
f({ type: Tn })
|
|
9549
|
-
],
|
|
9549
|
+
], bt.prototype, "sid", void 0);
|
|
9550
9550
|
d([
|
|
9551
9551
|
f({ type: yi })
|
|
9552
|
-
],
|
|
9552
|
+
], bt.prototype, "digestAlgorithm", void 0);
|
|
9553
9553
|
d([
|
|
9554
9554
|
f({ type: Gn, repeated: "set", context: 0, implicit: !0, optional: !0 })
|
|
9555
|
-
],
|
|
9555
|
+
], bt.prototype, "signedAttrs", void 0);
|
|
9556
9556
|
d([
|
|
9557
9557
|
f({ type: kr })
|
|
9558
|
-
],
|
|
9558
|
+
], bt.prototype, "signatureAlgorithm", void 0);
|
|
9559
9559
|
d([
|
|
9560
9560
|
f({ type: se })
|
|
9561
|
-
],
|
|
9561
|
+
], bt.prototype, "signature", void 0);
|
|
9562
9562
|
d([
|
|
9563
9563
|
f({ type: Gn, repeated: "set", context: 1, implicit: !0, optional: !0 })
|
|
9564
|
-
],
|
|
9564
|
+
], bt.prototype, "unsignedAttrs", void 0);
|
|
9565
9565
|
let Sr = Jo = class extends ue {
|
|
9566
9566
|
constructor(e) {
|
|
9567
9567
|
super(e), Object.setPrototypeOf(this, Jo.prototype);
|
|
9568
9568
|
}
|
|
9569
9569
|
};
|
|
9570
9570
|
Sr = Jo = d([
|
|
9571
|
-
T({ type: N.Set, itemType:
|
|
9571
|
+
T({ type: N.Set, itemType: bt })
|
|
9572
9572
|
], Sr);
|
|
9573
9573
|
let Vl = class extends Ce {
|
|
9574
9574
|
};
|
|
9575
9575
|
Vl = d([
|
|
9576
9576
|
T({ type: N.Choice })
|
|
9577
9577
|
], Vl);
|
|
9578
|
-
let Ml = class extends
|
|
9578
|
+
let Ml = class extends bt {
|
|
9579
9579
|
};
|
|
9580
9580
|
Ml = d([
|
|
9581
9581
|
T({ type: N.Sequence })
|
|
@@ -9592,7 +9592,7 @@ d([
|
|
|
9592
9592
|
f({ type: y.Integer })
|
|
9593
9593
|
], hc.prototype, "acSerial", void 0);
|
|
9594
9594
|
d([
|
|
9595
|
-
f({ type:
|
|
9595
|
+
f({ type: Ct, repeated: "sequence" })
|
|
9596
9596
|
], hc.prototype, "attrs", void 0);
|
|
9597
9597
|
var Zo;
|
|
9598
9598
|
let Ar = Zo = class extends ue {
|
|
@@ -9736,7 +9736,7 @@ d([
|
|
|
9736
9736
|
f({ type: ks })
|
|
9737
9737
|
], dt.prototype, "attrCertValidityPeriod", void 0);
|
|
9738
9738
|
d([
|
|
9739
|
-
f({ type:
|
|
9739
|
+
f({ type: Ct, repeated: "sequence" })
|
|
9740
9740
|
], dt.prototype, "attributes", void 0);
|
|
9741
9741
|
d([
|
|
9742
9742
|
f({ type: y.BitString, optional: !0 })
|
|
@@ -10078,7 +10078,7 @@ dn = d([
|
|
|
10078
10078
|
], dn);
|
|
10079
10079
|
class Zn {
|
|
10080
10080
|
constructor(e = {}) {
|
|
10081
|
-
this.version =
|
|
10081
|
+
this.version = jt.v3, this.originator = new dn(), this.keyEncryptionAlgorithm = new yt(), this.recipientEncryptedKeys = new $r(), Object.assign(this, e);
|
|
10082
10082
|
}
|
|
10083
10083
|
}
|
|
10084
10084
|
d([
|
|
@@ -10091,7 +10091,7 @@ d([
|
|
|
10091
10091
|
f({ type: se, context: 1, optional: !0 })
|
|
10092
10092
|
], Zn.prototype, "ukm", void 0);
|
|
10093
10093
|
d([
|
|
10094
|
-
f({ type:
|
|
10094
|
+
f({ type: yt })
|
|
10095
10095
|
], Zn.prototype, "keyEncryptionAlgorithm", void 0);
|
|
10096
10096
|
d([
|
|
10097
10097
|
f({ type: $r })
|
|
@@ -10112,7 +10112,7 @@ Vn = d([
|
|
|
10112
10112
|
], Vn);
|
|
10113
10113
|
class Li {
|
|
10114
10114
|
constructor(e = {}) {
|
|
10115
|
-
this.version =
|
|
10115
|
+
this.version = jt.v0, this.rid = new Vn(), this.keyEncryptionAlgorithm = new yt(), this.encryptedKey = new se(), Object.assign(this, e);
|
|
10116
10116
|
}
|
|
10117
10117
|
}
|
|
10118
10118
|
d([
|
|
@@ -10122,7 +10122,7 @@ d([
|
|
|
10122
10122
|
f({ type: Vn })
|
|
10123
10123
|
], Li.prototype, "rid", void 0);
|
|
10124
10124
|
d([
|
|
10125
|
-
f({ type:
|
|
10125
|
+
f({ type: yt })
|
|
10126
10126
|
], Li.prototype, "keyEncryptionAlgorithm", void 0);
|
|
10127
10127
|
d([
|
|
10128
10128
|
f({ type: se })
|
|
@@ -10143,7 +10143,7 @@ d([
|
|
|
10143
10143
|
], Ui.prototype, "other", void 0);
|
|
10144
10144
|
class Vi {
|
|
10145
10145
|
constructor(e = {}) {
|
|
10146
|
-
this.version =
|
|
10146
|
+
this.version = jt.v4, this.kekid = new Ui(), this.keyEncryptionAlgorithm = new yt(), this.encryptedKey = new se(), Object.assign(this, e);
|
|
10147
10147
|
}
|
|
10148
10148
|
}
|
|
10149
10149
|
d([
|
|
@@ -10153,14 +10153,14 @@ d([
|
|
|
10153
10153
|
f({ type: Ui })
|
|
10154
10154
|
], Vi.prototype, "kekid", void 0);
|
|
10155
10155
|
d([
|
|
10156
|
-
f({ type:
|
|
10156
|
+
f({ type: yt })
|
|
10157
10157
|
], Vi.prototype, "keyEncryptionAlgorithm", void 0);
|
|
10158
10158
|
d([
|
|
10159
10159
|
f({ type: se })
|
|
10160
10160
|
], Vi.prototype, "encryptedKey", void 0);
|
|
10161
10161
|
class Mi {
|
|
10162
10162
|
constructor(e = {}) {
|
|
10163
|
-
this.version =
|
|
10163
|
+
this.version = jt.v0, this.keyEncryptionAlgorithm = new yt(), this.encryptedKey = new se(), Object.assign(this, e);
|
|
10164
10164
|
}
|
|
10165
10165
|
}
|
|
10166
10166
|
d([
|
|
@@ -10170,7 +10170,7 @@ d([
|
|
|
10170
10170
|
f({ type: Go, context: 0, optional: !0 })
|
|
10171
10171
|
], Mi.prototype, "keyDerivationAlgorithm", void 0);
|
|
10172
10172
|
d([
|
|
10173
|
-
f({ type:
|
|
10173
|
+
f({ type: yt })
|
|
10174
10174
|
], Mi.prototype, "keyEncryptionAlgorithm", void 0);
|
|
10175
10175
|
d([
|
|
10176
10176
|
f({ type: se })
|
|
@@ -10271,7 +10271,7 @@ ca = aa = d([
|
|
|
10271
10271
|
], ca);
|
|
10272
10272
|
class zi {
|
|
10273
10273
|
constructor(e = {}) {
|
|
10274
|
-
this.version =
|
|
10274
|
+
this.version = jt.v0, this.recipientInfos = new Cr(), this.encryptedContentInfo = new Ri(), Object.assign(this, e);
|
|
10275
10275
|
}
|
|
10276
10276
|
}
|
|
10277
10277
|
d([
|
|
@@ -10301,7 +10301,7 @@ Or = la = d([
|
|
|
10301
10301
|
], Or);
|
|
10302
10302
|
class Yn {
|
|
10303
10303
|
constructor(e = {}) {
|
|
10304
|
-
this.version =
|
|
10304
|
+
this.version = jt.v0, this.digestAlgorithms = new Or(), this.encapContentInfo = new Is(), this.signerInfos = new Sr(), Object.assign(this, e);
|
|
10305
10305
|
}
|
|
10306
10306
|
}
|
|
10307
10307
|
d([
|
|
@@ -10366,32 +10366,32 @@ var ua;
|
|
|
10366
10366
|
(function(n) {
|
|
10367
10367
|
n[n.ecpVer1 = 1] = "ecpVer1";
|
|
10368
10368
|
})(ua || (ua = {}));
|
|
10369
|
-
let
|
|
10369
|
+
let Nt = class {
|
|
10370
10370
|
constructor(e = {}) {
|
|
10371
10371
|
this.version = ua.ecpVer1, Object.assign(this, e);
|
|
10372
10372
|
}
|
|
10373
10373
|
};
|
|
10374
10374
|
d([
|
|
10375
10375
|
f({ type: y.Integer })
|
|
10376
|
-
],
|
|
10376
|
+
], Nt.prototype, "version", void 0);
|
|
10377
10377
|
d([
|
|
10378
10378
|
f({ type: ki })
|
|
10379
|
-
],
|
|
10379
|
+
], Nt.prototype, "fieldID", void 0);
|
|
10380
10380
|
d([
|
|
10381
10381
|
f({ type: Mn })
|
|
10382
|
-
],
|
|
10382
|
+
], Nt.prototype, "curve", void 0);
|
|
10383
10383
|
d([
|
|
10384
10384
|
f({ type: y_ })
|
|
10385
|
-
],
|
|
10385
|
+
], Nt.prototype, "base", void 0);
|
|
10386
10386
|
d([
|
|
10387
10387
|
f({ type: y.Integer, converter: ge })
|
|
10388
|
-
],
|
|
10388
|
+
], Nt.prototype, "order", void 0);
|
|
10389
10389
|
d([
|
|
10390
10390
|
f({ type: y.Integer, optional: !0 })
|
|
10391
|
-
],
|
|
10392
|
-
|
|
10391
|
+
], Nt.prototype, "cofactor", void 0);
|
|
10392
|
+
Nt = d([
|
|
10393
10393
|
T({ type: N.Sequence })
|
|
10394
|
-
],
|
|
10394
|
+
], Nt);
|
|
10395
10395
|
let Dt = class {
|
|
10396
10396
|
constructor(e = {}) {
|
|
10397
10397
|
Object.assign(this, e);
|
|
@@ -10404,7 +10404,7 @@ d([
|
|
|
10404
10404
|
f({ type: y.Null })
|
|
10405
10405
|
], Dt.prototype, "implicitCurve", void 0);
|
|
10406
10406
|
d([
|
|
10407
|
-
f({ type:
|
|
10407
|
+
f({ type: Nt })
|
|
10408
10408
|
], Dt.prototype, "specifiedCurve", void 0);
|
|
10409
10409
|
Dt = d([
|
|
10410
10410
|
T({ type: N.Choice })
|
|
@@ -10546,41 +10546,41 @@ let fa = pa = class extends ue {
|
|
|
10546
10546
|
fa = pa = d([
|
|
10547
10547
|
T({ type: N.Sequence, itemType: Ts })
|
|
10548
10548
|
], fa);
|
|
10549
|
-
class
|
|
10549
|
+
class kt {
|
|
10550
10550
|
constructor(e = {}) {
|
|
10551
10551
|
this.version = 0, this.modulus = new ArrayBuffer(0), this.publicExponent = new ArrayBuffer(0), this.privateExponent = new ArrayBuffer(0), this.prime1 = new ArrayBuffer(0), this.prime2 = new ArrayBuffer(0), this.exponent1 = new ArrayBuffer(0), this.exponent2 = new ArrayBuffer(0), this.coefficient = new ArrayBuffer(0), Object.assign(this, e);
|
|
10552
10552
|
}
|
|
10553
10553
|
}
|
|
10554
10554
|
d([
|
|
10555
10555
|
f({ type: y.Integer })
|
|
10556
|
-
],
|
|
10556
|
+
], kt.prototype, "version", void 0);
|
|
10557
10557
|
d([
|
|
10558
10558
|
f({ type: y.Integer, converter: ge })
|
|
10559
|
-
],
|
|
10559
|
+
], kt.prototype, "modulus", void 0);
|
|
10560
10560
|
d([
|
|
10561
10561
|
f({ type: y.Integer, converter: ge })
|
|
10562
|
-
],
|
|
10562
|
+
], kt.prototype, "publicExponent", void 0);
|
|
10563
10563
|
d([
|
|
10564
10564
|
f({ type: y.Integer, converter: ge })
|
|
10565
|
-
],
|
|
10565
|
+
], kt.prototype, "privateExponent", void 0);
|
|
10566
10566
|
d([
|
|
10567
10567
|
f({ type: y.Integer, converter: ge })
|
|
10568
|
-
],
|
|
10568
|
+
], kt.prototype, "prime1", void 0);
|
|
10569
10569
|
d([
|
|
10570
10570
|
f({ type: y.Integer, converter: ge })
|
|
10571
|
-
],
|
|
10571
|
+
], kt.prototype, "prime2", void 0);
|
|
10572
10572
|
d([
|
|
10573
10573
|
f({ type: y.Integer, converter: ge })
|
|
10574
|
-
],
|
|
10574
|
+
], kt.prototype, "exponent1", void 0);
|
|
10575
10575
|
d([
|
|
10576
10576
|
f({ type: y.Integer, converter: ge })
|
|
10577
|
-
],
|
|
10577
|
+
], kt.prototype, "exponent2", void 0);
|
|
10578
10578
|
d([
|
|
10579
10579
|
f({ type: y.Integer, converter: ge })
|
|
10580
|
-
],
|
|
10580
|
+
], kt.prototype, "coefficient", void 0);
|
|
10581
10581
|
d([
|
|
10582
10582
|
f({ type: fa, optional: !0 })
|
|
10583
|
-
],
|
|
10583
|
+
], kt.prototype, "otherPrimeInfos", void 0);
|
|
10584
10584
|
class Ec {
|
|
10585
10585
|
constructor(e = {}) {
|
|
10586
10586
|
this.modulus = new ArrayBuffer(0), this.publicExponent = new ArrayBuffer(0), Object.assign(this, e);
|
|
@@ -11201,7 +11201,7 @@ let ba = va = class extends ue {
|
|
|
11201
11201
|
}
|
|
11202
11202
|
};
|
|
11203
11203
|
ba = va = d([
|
|
11204
|
-
T({ type: N.Sequence, itemType:
|
|
11204
|
+
T({ type: N.Sequence, itemType: Ct })
|
|
11205
11205
|
], ba);
|
|
11206
11206
|
class Fi {
|
|
11207
11207
|
constructor(e = {}) {
|
|
@@ -11434,7 +11434,7 @@ d([
|
|
|
11434
11434
|
ja = d([
|
|
11435
11435
|
T({ type: N.Choice })
|
|
11436
11436
|
], ja);
|
|
11437
|
-
let au = class extends
|
|
11437
|
+
let au = class extends bt {
|
|
11438
11438
|
};
|
|
11439
11439
|
au = d([
|
|
11440
11440
|
T({ type: N.Sequence })
|
|
@@ -11494,7 +11494,7 @@ let qr = Ba = class extends ue {
|
|
|
11494
11494
|
}
|
|
11495
11495
|
};
|
|
11496
11496
|
qr = Ba = d([
|
|
11497
|
-
T({ type: N.Sequence, itemType:
|
|
11497
|
+
T({ type: N.Sequence, itemType: Ct })
|
|
11498
11498
|
], qr);
|
|
11499
11499
|
class Xn {
|
|
11500
11500
|
constructor(e = {}) {
|
|
@@ -12376,7 +12376,7 @@ We.CrlTag = "CRL";
|
|
|
12376
12376
|
We.CertificateRequestTag = "CERTIFICATE REQUEST";
|
|
12377
12377
|
We.PublicKeyTag = "PUBLIC KEY";
|
|
12378
12378
|
We.PrivateKeyTag = "PRIVATE KEY";
|
|
12379
|
-
class
|
|
12379
|
+
class Ot extends qt {
|
|
12380
12380
|
static isAsnEncoded(e) {
|
|
12381
12381
|
return V.isBufferSource(e) || typeof e == "string";
|
|
12382
12382
|
}
|
|
@@ -12397,7 +12397,7 @@ class Nt extends qt {
|
|
|
12397
12397
|
}
|
|
12398
12398
|
}
|
|
12399
12399
|
constructor(...e) {
|
|
12400
|
-
|
|
12400
|
+
Ot.isAsnEncoded(e[0]) ? super(Ot.toArrayBuffer(e[0]), e[1]) : super(e[0]);
|
|
12401
12401
|
}
|
|
12402
12402
|
toString(e = "pem") {
|
|
12403
12403
|
switch (e) {
|
|
@@ -12408,7 +12408,7 @@ class Nt extends qt {
|
|
|
12408
12408
|
}
|
|
12409
12409
|
}
|
|
12410
12410
|
}
|
|
12411
|
-
class lt extends
|
|
12411
|
+
class lt extends Ot {
|
|
12412
12412
|
static async create(e, t = $e.get()) {
|
|
12413
12413
|
if (e instanceof lt)
|
|
12414
12414
|
return e;
|
|
@@ -12426,7 +12426,7 @@ class lt extends Nt {
|
|
|
12426
12426
|
}
|
|
12427
12427
|
}
|
|
12428
12428
|
constructor(e) {
|
|
12429
|
-
|
|
12429
|
+
Ot.isAsnEncoded(e) ? super(e, ct) : super(e), this.tag = We.PublicKeyTag;
|
|
12430
12430
|
}
|
|
12431
12431
|
async export(...e) {
|
|
12432
12432
|
let t, i = ["verify"], r = { hash: "SHA-256", ...this.algorithm };
|
|
@@ -12740,9 +12740,9 @@ class Qn extends qt {
|
|
|
12740
12740
|
t = V.toArrayBuffer(e[0]);
|
|
12741
12741
|
else {
|
|
12742
12742
|
const i = e[0], r = Array.isArray(e[1]) ? e[1].map((s) => V.toArrayBuffer(s)) : [];
|
|
12743
|
-
t = U.serialize(new
|
|
12743
|
+
t = U.serialize(new Ct({ type: i, values: r }));
|
|
12744
12744
|
}
|
|
12745
|
-
super(t,
|
|
12745
|
+
super(t, Ct);
|
|
12746
12746
|
}
|
|
12747
12747
|
onInit(e) {
|
|
12748
12748
|
this.type = e.type, this.values = e.values;
|
|
@@ -13032,9 +13032,9 @@ Ra = d([
|
|
|
13032
13032
|
Ps()
|
|
13033
13033
|
], Ra);
|
|
13034
13034
|
Oe.registerSingleton(qi, Ra);
|
|
13035
|
-
class o0 extends
|
|
13035
|
+
class o0 extends Ot {
|
|
13036
13036
|
constructor(e) {
|
|
13037
|
-
|
|
13037
|
+
Ot.isAsnEncoded(e) ? super(e, xi) : super(e), this.tag = We.CertificateRequestTag;
|
|
13038
13038
|
}
|
|
13039
13039
|
onInit(e) {
|
|
13040
13040
|
this.tbs = U.serialize(e.certificationRequestInfo), this.publicKey = new lt(e.certificationRequestInfo.subjectPKInfo);
|
|
@@ -13092,9 +13092,9 @@ class o0 extends Nt {
|
|
|
13092
13092
|
}
|
|
13093
13093
|
}
|
|
13094
13094
|
o0.NAME = "PKCS#10 Certificate Request";
|
|
13095
|
-
class Pc extends
|
|
13095
|
+
class Pc extends Ot {
|
|
13096
13096
|
constructor(e) {
|
|
13097
|
-
|
|
13097
|
+
Ot.isAsnEncoded(e) ? super(e, un) : super(e), this.tag = We.CertificateTag;
|
|
13098
13098
|
}
|
|
13099
13099
|
onInit(e) {
|
|
13100
13100
|
const t = e.tbsCertificate;
|
|
@@ -15622,10 +15622,10 @@ zs.omit({
|
|
|
15622
15622
|
at_hash: !0,
|
|
15623
15623
|
c_hash: !0
|
|
15624
15624
|
});
|
|
15625
|
-
function
|
|
15625
|
+
function vt(n) {
|
|
15626
15626
|
return n.UNIVERSAL_LOGIN_URL || `${n.ISSUER}u/`;
|
|
15627
15627
|
}
|
|
15628
|
-
function
|
|
15628
|
+
function xt(n) {
|
|
15629
15629
|
return n.OAUTH_API_URL || n.ISSUER;
|
|
15630
15630
|
}
|
|
15631
15631
|
function Of(n) {
|
|
@@ -15642,7 +15642,7 @@ async function am(n, e) {
|
|
|
15642
15642
|
t.team_id,
|
|
15643
15643
|
t.kid,
|
|
15644
15644
|
i,
|
|
15645
|
-
`${
|
|
15645
|
+
`${xt(n.env)}callback`
|
|
15646
15646
|
), s = Ge(), o = await r.createAuthorizationURL(
|
|
15647
15647
|
s,
|
|
15648
15648
|
((l = t.scope) == null ? void 0 : l.split(" ")) || ["name", "email"]
|
|
@@ -15658,7 +15658,7 @@ async function cm(n, e, t) {
|
|
|
15658
15658
|
i.team_id,
|
|
15659
15659
|
i.kid,
|
|
15660
15660
|
r,
|
|
15661
|
-
`${
|
|
15661
|
+
`${xt(n.env)}callback`
|
|
15662
15662
|
).validateAuthorizationCode(t), c = Uc(o.idToken());
|
|
15663
15663
|
if (!c)
|
|
15664
15664
|
throw new Error("Invalid ID token");
|
|
@@ -15686,7 +15686,7 @@ async function um(n, e) {
|
|
|
15686
15686
|
const i = new jf(
|
|
15687
15687
|
t.client_id,
|
|
15688
15688
|
t.client_secret,
|
|
15689
|
-
`${
|
|
15689
|
+
`${xt(n.env)}callback`
|
|
15690
15690
|
), r = Ge();
|
|
15691
15691
|
return {
|
|
15692
15692
|
redirectUrl: i.createAuthorizationURL(
|
|
@@ -15703,7 +15703,7 @@ async function dm(n, e, t) {
|
|
|
15703
15703
|
const s = await new jf(
|
|
15704
15704
|
i.client_id,
|
|
15705
15705
|
i.client_secret,
|
|
15706
|
-
`${
|
|
15706
|
+
`${xt(n.env)}callback`
|
|
15707
15707
|
).validateAuthorizationCode(t), o = await fetch(
|
|
15708
15708
|
"https://graph.facebook.com/v16.0/me?fields=id,email,name",
|
|
15709
15709
|
{
|
|
@@ -15734,7 +15734,7 @@ async function fm(n, e) {
|
|
|
15734
15734
|
const i = new Nf(
|
|
15735
15735
|
t.client_id,
|
|
15736
15736
|
t.client_secret,
|
|
15737
|
-
`${
|
|
15737
|
+
`${xt(n.env)}callback`
|
|
15738
15738
|
), r = Ge(), s = H0();
|
|
15739
15739
|
return {
|
|
15740
15740
|
redirectUrl: i.createAuthorizationURL(
|
|
@@ -15753,7 +15753,7 @@ async function hm(n, e, t, i) {
|
|
|
15753
15753
|
const o = await new Nf(
|
|
15754
15754
|
r.client_id,
|
|
15755
15755
|
r.client_secret,
|
|
15756
|
-
`${
|
|
15756
|
+
`${xt(n.env)}callback`
|
|
15757
15757
|
).validateAuthorizationCode(t, i);
|
|
15758
15758
|
console.log("got here");
|
|
15759
15759
|
const c = Uc(o.idToken());
|
|
@@ -15783,7 +15783,7 @@ async function _m(n, e) {
|
|
|
15783
15783
|
const i = new Rc(
|
|
15784
15784
|
t.client_id,
|
|
15785
15785
|
t.client_secret,
|
|
15786
|
-
`${
|
|
15786
|
+
`${xt(n.env)}callback`
|
|
15787
15787
|
), r = Ge(), s = i.createAuthorizationURL(
|
|
15788
15788
|
"https://api.vipps.no/access-management-1.0/access/oauth2/auth",
|
|
15789
15789
|
r,
|
|
@@ -15808,7 +15808,7 @@ async function mm(n, e, t) {
|
|
|
15808
15808
|
const s = await new Rc(
|
|
15809
15809
|
i.client_id,
|
|
15810
15810
|
i.client_secret,
|
|
15811
|
-
`${
|
|
15811
|
+
`${xt(n.env)}callback`
|
|
15812
15812
|
).validateAuthorizationCode(
|
|
15813
15813
|
"https://api.vipps.no/access-management-1.0/access/oauth2/token",
|
|
15814
15814
|
t,
|
|
@@ -15872,7 +15872,7 @@ async function Vc(n, e) {
|
|
|
15872
15872
|
web_origins: [
|
|
15873
15873
|
...(i == null ? void 0 : i.web_origins) || [],
|
|
15874
15874
|
...t.web_origins || [],
|
|
15875
|
-
`${
|
|
15875
|
+
`${vt(n)}login`
|
|
15876
15876
|
],
|
|
15877
15877
|
allowed_logout_urls: [
|
|
15878
15878
|
...(i == null ? void 0 : i.allowed_logout_urls) || [],
|
|
@@ -15882,7 +15882,7 @@ async function Vc(n, e) {
|
|
|
15882
15882
|
callbacks: [
|
|
15883
15883
|
...(i == null ? void 0 : i.callbacks) || [],
|
|
15884
15884
|
...t.callbacks || [],
|
|
15885
|
-
`${
|
|
15885
|
+
`${vt(n)}info`
|
|
15886
15886
|
],
|
|
15887
15887
|
connections: o,
|
|
15888
15888
|
domains: [...t.domains || [], ...(i == null ? void 0 : i.domains) || []],
|
|
@@ -16047,11 +16047,11 @@ zc.validate = function(n, e) {
|
|
|
16047
16047
|
l += n[s];
|
|
16048
16048
|
if (l = l.trim(), l[l.length - 1] === "/" && (l = l.substring(0, l.length - 1), s--), !Om(l)) {
|
|
16049
16049
|
let g;
|
|
16050
|
-
return l.trim().length === 0 ? g = "Invalid space after '<'." : g = "Tag '" + l + "' is an invalid name.",
|
|
16050
|
+
return l.trim().length === 0 ? g = "Invalid space after '<'." : g = "Tag '" + l + "' is an invalid name.", we("InvalidTag", g, Pe(n, s));
|
|
16051
16051
|
}
|
|
16052
16052
|
const u = Em(n, s);
|
|
16053
16053
|
if (u === !1)
|
|
16054
|
-
return
|
|
16054
|
+
return we("InvalidAttr", "Attributes for '" + l + "' have open quote.", Pe(n, s));
|
|
16055
16055
|
let p = u.value;
|
|
16056
16056
|
if (s = u.index, p[p.length - 1] === "/") {
|
|
16057
16057
|
const g = s - p.length;
|
|
@@ -16060,18 +16060,18 @@ zc.validate = function(n, e) {
|
|
|
16060
16060
|
if (m === !0)
|
|
16061
16061
|
i = !0;
|
|
16062
16062
|
else
|
|
16063
|
-
return
|
|
16063
|
+
return we(m.err.code, m.err.msg, Pe(n, g + m.err.line));
|
|
16064
16064
|
} else if (c)
|
|
16065
16065
|
if (u.tagClosed) {
|
|
16066
16066
|
if (p.trim().length > 0)
|
|
16067
|
-
return
|
|
16067
|
+
return we("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", Pe(n, o));
|
|
16068
16068
|
if (t.length === 0)
|
|
16069
|
-
return
|
|
16069
|
+
return we("InvalidTag", "Closing tag '" + l + "' has not been opened.", Pe(n, o));
|
|
16070
16070
|
{
|
|
16071
16071
|
const g = t.pop();
|
|
16072
16072
|
if (l !== g.tagName) {
|
|
16073
16073
|
let m = Pe(n, g.tagStartPos);
|
|
16074
|
-
return
|
|
16074
|
+
return we(
|
|
16075
16075
|
"InvalidTag",
|
|
16076
16076
|
"Expected closing tag '" + g.tagName + "' (opened in line " + m.line + ", col " + m.col + ") instead of closing tag '" + l + "'.",
|
|
16077
16077
|
Pe(n, o)
|
|
@@ -16079,13 +16079,13 @@ zc.validate = function(n, e) {
|
|
|
16079
16079
|
}
|
|
16080
16080
|
t.length == 0 && (r = !0);
|
|
16081
16081
|
}
|
|
16082
|
-
} else return
|
|
16082
|
+
} else return we("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", Pe(n, s));
|
|
16083
16083
|
else {
|
|
16084
16084
|
const g = ld(p, e);
|
|
16085
16085
|
if (g !== !0)
|
|
16086
|
-
return
|
|
16086
|
+
return we(g.err.code, g.err.msg, Pe(n, s - p.length + g.err.line));
|
|
16087
16087
|
if (r === !0)
|
|
16088
|
-
return
|
|
16088
|
+
return we("InvalidXml", "Multiple possible root nodes found.", Pe(n, s));
|
|
16089
16089
|
e.unpairedTags.indexOf(l) !== -1 || t.push({ tagName: l, tagStartPos: o }), i = !0;
|
|
16090
16090
|
}
|
|
16091
16091
|
for (s++; s < n.length; s++)
|
|
@@ -16100,23 +16100,23 @@ zc.validate = function(n, e) {
|
|
|
16100
16100
|
else if (n[s] === "&") {
|
|
16101
16101
|
const g = jm(n, s);
|
|
16102
16102
|
if (g == -1)
|
|
16103
|
-
return
|
|
16103
|
+
return we("InvalidChar", "char '&' is not expected.", Pe(n, s));
|
|
16104
16104
|
s = g;
|
|
16105
16105
|
} else if (r === !0 && !od(n[s]))
|
|
16106
|
-
return
|
|
16106
|
+
return we("InvalidXml", "Extra text at the end", Pe(n, s));
|
|
16107
16107
|
n[s] === "<" && s--;
|
|
16108
16108
|
}
|
|
16109
16109
|
} else {
|
|
16110
16110
|
if (od(n[s]))
|
|
16111
16111
|
continue;
|
|
16112
|
-
return
|
|
16112
|
+
return we("InvalidChar", "char '" + n[s] + "' is not expected.", Pe(n, s));
|
|
16113
16113
|
}
|
|
16114
16114
|
if (i) {
|
|
16115
16115
|
if (t.length == 1)
|
|
16116
|
-
return
|
|
16116
|
+
return we("InvalidTag", "Unclosed tag '" + t[0].tagName + "'.", Pe(n, t[0].tagStartPos));
|
|
16117
16117
|
if (t.length > 0)
|
|
16118
|
-
return
|
|
16119
|
-
} else return
|
|
16118
|
+
return we("InvalidXml", "Invalid '" + JSON.stringify(t.map((s) => s.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
|
|
16119
|
+
} else return we("InvalidXml", "Start tag expected.", 1);
|
|
16120
16120
|
return !0;
|
|
16121
16121
|
};
|
|
16122
16122
|
function od(n) {
|
|
@@ -16129,7 +16129,7 @@ function ad(n, e) {
|
|
|
16129
16129
|
if (n[e] == "?" || n[e] == " ") {
|
|
16130
16130
|
const i = n.substr(t, e - t);
|
|
16131
16131
|
if (e > 5 && i === "xml")
|
|
16132
|
-
return
|
|
16132
|
+
return we("InvalidXml", "XML declaration allowed only at the start of the document.", Pe(n, e));
|
|
16133
16133
|
if (n[e] == "?" && n[e + 1] == ">") {
|
|
16134
16134
|
e++;
|
|
16135
16135
|
break;
|
|
@@ -16184,18 +16184,18 @@ function ld(n, e) {
|
|
|
16184
16184
|
const t = Dc.getAllMatches(n, $m), i = {};
|
|
16185
16185
|
for (let r = 0; r < t.length; r++) {
|
|
16186
16186
|
if (t[r][1].length === 0)
|
|
16187
|
-
return
|
|
16187
|
+
return we("InvalidAttr", "Attribute '" + t[r][2] + "' has no space in starting.", ii(t[r]));
|
|
16188
16188
|
if (t[r][3] !== void 0 && t[r][4] === void 0)
|
|
16189
|
-
return
|
|
16189
|
+
return we("InvalidAttr", "Attribute '" + t[r][2] + "' is without value.", ii(t[r]));
|
|
16190
16190
|
if (t[r][3] === void 0 && !e.allowBooleanAttributes)
|
|
16191
|
-
return
|
|
16191
|
+
return we("InvalidAttr", "boolean attribute '" + t[r][2] + "' is not allowed.", ii(t[r]));
|
|
16192
16192
|
const s = t[r][2];
|
|
16193
16193
|
if (!Nm(s))
|
|
16194
|
-
return
|
|
16194
|
+
return we("InvalidAttr", "Attribute '" + s + "' is an invalid name.", ii(t[r]));
|
|
16195
16195
|
if (!i.hasOwnProperty(s))
|
|
16196
16196
|
i[s] = 1;
|
|
16197
16197
|
else
|
|
16198
|
-
return
|
|
16198
|
+
return we("InvalidAttr", "Attribute '" + s + "' is repeated.", ii(t[r]));
|
|
16199
16199
|
}
|
|
16200
16200
|
return !0;
|
|
16201
16201
|
}
|
|
@@ -16223,7 +16223,7 @@ function jm(n, e) {
|
|
|
16223
16223
|
}
|
|
16224
16224
|
return e;
|
|
16225
16225
|
}
|
|
16226
|
-
function
|
|
16226
|
+
function we(n, e, t) {
|
|
16227
16227
|
return {
|
|
16228
16228
|
err: {
|
|
16229
16229
|
code: n,
|
|
@@ -17433,27 +17433,39 @@ async function Hf(n, e, t) {
|
|
|
17433
17433
|
});
|
|
17434
17434
|
}
|
|
17435
17435
|
async function Gi(n, e) {
|
|
17436
|
-
const { authParams: t, user: i, client: r } = e, s =
|
|
17436
|
+
const { authParams: t, user: i, client: r } = e, s = xe(n, {
|
|
17437
|
+
type: ye.SUCCESS_LOGIN,
|
|
17438
|
+
description: `Successful login for ${i.user_id}`,
|
|
17439
|
+
userId: i.user_id
|
|
17440
|
+
});
|
|
17441
|
+
_t(n, n.env.data.logs.create(r.tenant.id, s)), _t(
|
|
17442
|
+
n,
|
|
17443
|
+
n.env.data.users.update(r.tenant.id, i.user_id, {
|
|
17444
|
+
last_login: (/* @__PURE__ */ new Date()).toISOString(),
|
|
17445
|
+
last_ip: n.req.header("x-real-ip") || ""
|
|
17446
|
+
})
|
|
17447
|
+
);
|
|
17448
|
+
const o = e.sid || (await Hf(n, i, r)).session_id;
|
|
17437
17449
|
if (e.authParams.response_mode === jn.SAML_POST)
|
|
17438
|
-
return Fy(n, e.client, e.authParams, i,
|
|
17439
|
-
const
|
|
17450
|
+
return Fy(n, e.client, e.authParams, i, o);
|
|
17451
|
+
const c = await Hc(n, {
|
|
17440
17452
|
authParams: t,
|
|
17441
17453
|
user: i,
|
|
17442
17454
|
client: r,
|
|
17443
|
-
sid:
|
|
17444
|
-
}),
|
|
17445
|
-
"set-cookie": Rf(r.tenant.id,
|
|
17455
|
+
sid: o
|
|
17456
|
+
}), l = new Headers({
|
|
17457
|
+
"set-cookie": Rf(r.tenant.id, o)
|
|
17446
17458
|
});
|
|
17447
17459
|
if (t.response_mode === jn.WEB_MESSAGE)
|
|
17448
|
-
return n.json(
|
|
17449
|
-
headers:
|
|
17460
|
+
return n.json(c, {
|
|
17461
|
+
headers: l
|
|
17450
17462
|
});
|
|
17451
17463
|
if ((t.response_type || nn.CODE) === nn.CODE) {
|
|
17452
17464
|
if (!e.loginSession)
|
|
17453
17465
|
throw new O(500, {
|
|
17454
17466
|
message: "Login session not found"
|
|
17455
17467
|
});
|
|
17456
|
-
const
|
|
17468
|
+
const p = await n.env.data.codes.create(r.tenant.id, {
|
|
17457
17469
|
code_id: Ge(),
|
|
17458
17470
|
user_id: i.user_id,
|
|
17459
17471
|
code_type: "authorization_code",
|
|
@@ -17462,14 +17474,14 @@ async function Gi(n, e) {
|
|
|
17462
17474
|
Date.now() + B0 * 1e3
|
|
17463
17475
|
).toISOString()
|
|
17464
17476
|
});
|
|
17465
|
-
|
|
17477
|
+
l.set(
|
|
17466
17478
|
"location",
|
|
17467
|
-
`${t.redirect_uri}?state=${e.authParams.state}&code=${
|
|
17479
|
+
`${t.redirect_uri}?state=${e.authParams.state}&code=${p.code_id}`
|
|
17468
17480
|
);
|
|
17469
17481
|
}
|
|
17470
17482
|
return new Response("Redirecting", {
|
|
17471
17483
|
status: 302,
|
|
17472
|
-
headers:
|
|
17484
|
+
headers: l
|
|
17473
17485
|
});
|
|
17474
17486
|
}
|
|
17475
17487
|
function qy(n) {
|
|
@@ -17496,8 +17508,8 @@ async function qf(n, e, t) {
|
|
|
17496
17508
|
},
|
|
17497
17509
|
body: JSON.stringify(t)
|
|
17498
17510
|
})).ok) {
|
|
17499
|
-
const s =
|
|
17500
|
-
type:
|
|
17511
|
+
const s = xe(n, {
|
|
17512
|
+
type: ye.FAILED_LOGIN_INCORRECT_PASSWORD,
|
|
17501
17513
|
description: "Invalid password"
|
|
17502
17514
|
});
|
|
17503
17515
|
await t.logs.create(n.var.tenant_id, s);
|
|
@@ -17540,8 +17552,8 @@ async function Jy(n, e, t, i) {
|
|
|
17540
17552
|
tenant_id: e.tenant.id,
|
|
17541
17553
|
email: i
|
|
17542
17554
|
})) {
|
|
17543
|
-
const s =
|
|
17544
|
-
type:
|
|
17555
|
+
const s = xe(n, {
|
|
17556
|
+
type: ye.FAILED_SIGNUP,
|
|
17545
17557
|
description: "Public signup is disabled"
|
|
17546
17558
|
});
|
|
17547
17559
|
throw await n.env.data.logs.create(e.tenant.id, s), new O(400, {
|
|
@@ -17562,8 +17574,8 @@ async function Yy(n, e, t, i) {
|
|
|
17562
17574
|
const r = e.connections.find((l) => l.name === t);
|
|
17563
17575
|
if (!r) {
|
|
17564
17576
|
n.set("client_id", e.id);
|
|
17565
|
-
const l =
|
|
17566
|
-
type:
|
|
17577
|
+
const l = xe(n, {
|
|
17578
|
+
type: ye.FAILED_LOGIN,
|
|
17567
17579
|
description: "Connection not found"
|
|
17568
17580
|
});
|
|
17569
17581
|
throw await n.env.data.logs.create(e.tenant.id, l), new O(403, { message: "Connection Not Found" });
|
|
@@ -17615,15 +17627,15 @@ async function pd(n, { code: e, state: t }) {
|
|
|
17615
17627
|
(_) => _.id === r.connection_id
|
|
17616
17628
|
);
|
|
17617
17629
|
if (!c) {
|
|
17618
|
-
const _ =
|
|
17619
|
-
type:
|
|
17630
|
+
const _ = xe(n, {
|
|
17631
|
+
type: ye.FAILED_LOGIN,
|
|
17620
17632
|
description: "Connection not found"
|
|
17621
17633
|
});
|
|
17622
17634
|
throw await i.data.logs.create(o.tenant.id, _), new O(403, { message: "Connection not found" });
|
|
17623
17635
|
}
|
|
17624
17636
|
if (n.set("connection", c.name), !s.authParams.redirect_uri) {
|
|
17625
|
-
const _ =
|
|
17626
|
-
type:
|
|
17637
|
+
const _ = xe(n, {
|
|
17638
|
+
type: ye.FAILED_LOGIN,
|
|
17627
17639
|
description: "Redirect URI not defined"
|
|
17628
17640
|
});
|
|
17629
17641
|
throw await i.data.logs.create(o.tenant.id, _), new O(403, { message: "Redirect URI not defined" });
|
|
@@ -17633,8 +17645,8 @@ async function pd(n, { code: e, state: t }) {
|
|
|
17633
17645
|
o.callbacks || [],
|
|
17634
17646
|
{ allowPathWildcards: !0 }
|
|
17635
17647
|
)) {
|
|
17636
|
-
const _ = `Invalid redirect URI - ${s.authParams.redirect_uri}`, b =
|
|
17637
|
-
type:
|
|
17648
|
+
const _ = `Invalid redirect URI - ${s.authParams.redirect_uri}`, b = xe(n, {
|
|
17649
|
+
type: ye.FAILED_LOGIN,
|
|
17638
17650
|
description: _
|
|
17639
17651
|
});
|
|
17640
17652
|
throw await i.data.logs.create(o.tenant.id, b), new O(403, {
|
|
@@ -17703,11 +17715,11 @@ async function fd(n, e, t, i, r, s) {
|
|
|
17703
17715
|
const { redirect_uri: l } = c.authParams;
|
|
17704
17716
|
if (!l)
|
|
17705
17717
|
throw new O(400, { message: "Redirect uri not found" });
|
|
17706
|
-
const u =
|
|
17707
|
-
type:
|
|
17718
|
+
const u = xe(n, {
|
|
17719
|
+
type: ye.FAILED_LOGIN,
|
|
17708
17720
|
description: `Failed connection login: ${r} ${t}, ${i}`
|
|
17709
17721
|
});
|
|
17710
|
-
|
|
17722
|
+
_t(n, n.env.data.logs.create(n.var.tenant_id, u));
|
|
17711
17723
|
const p = new URL(l);
|
|
17712
17724
|
return N0(p, {
|
|
17713
17725
|
error: t,
|
|
@@ -17716,7 +17728,7 @@ async function fd(n, e, t, i, r, s) {
|
|
|
17716
17728
|
error_code: r,
|
|
17717
17729
|
state: c.authParams.state
|
|
17718
17730
|
}), n.redirect(
|
|
17719
|
-
`${
|
|
17731
|
+
`${vt(n.env)}enter-email?state=${c.login_id}&error=${t}`
|
|
17720
17732
|
);
|
|
17721
17733
|
}
|
|
17722
17734
|
const Xy = new _e().openapi(
|
|
@@ -17879,8 +17891,8 @@ const Xy = new _e().openapi(
|
|
|
17879
17891
|
await n.env.data.sessions.remove(i.tenant.id, l);
|
|
17880
17892
|
}
|
|
17881
17893
|
}
|
|
17882
|
-
const c =
|
|
17883
|
-
type:
|
|
17894
|
+
const c = xe(n, {
|
|
17895
|
+
type: ye.SUCCESS_LOGOUT,
|
|
17884
17896
|
description: "User successfully logged out"
|
|
17885
17897
|
});
|
|
17886
17898
|
return await n.env.data.logs.create(i.tenant.id, c), new Response("Redirecting", {
|
|
@@ -18325,14 +18337,14 @@ async function uv(n, e, t, i) {
|
|
|
18325
18337
|
const r = await n.env.data.tenants.get(n.var.tenant_id);
|
|
18326
18338
|
if (!r)
|
|
18327
18339
|
throw new O(500, { message: "Tenant not found" });
|
|
18328
|
-
const s = `${
|
|
18340
|
+
const s = `${vt(n.env)}reset-password?state=${i}&code=${t}`, o = {
|
|
18329
18341
|
vendorName: r.name,
|
|
18330
18342
|
lng: r.language || "en"
|
|
18331
18343
|
};
|
|
18332
18344
|
await Hs(n, {
|
|
18333
18345
|
to: e,
|
|
18334
18346
|
subject: "Reset your password",
|
|
18335
|
-
html: `Click here to reset your password: ${
|
|
18347
|
+
html: `Click here to reset your password: ${vt(n.env)}reset-password?state=${i}&code=${t}`,
|
|
18336
18348
|
template: "auth-password-reset",
|
|
18337
18349
|
data: {
|
|
18338
18350
|
vendorName: r.name,
|
|
@@ -18364,14 +18376,14 @@ async function dv(n, e, t) {
|
|
|
18364
18376
|
await Hs(n, {
|
|
18365
18377
|
to: e,
|
|
18366
18378
|
subject: de("code_email_subject", r),
|
|
18367
|
-
html: `Click here to validate your email: ${
|
|
18379
|
+
html: `Click here to validate your email: ${vt(n.env)}validate-email`,
|
|
18368
18380
|
template: "auth-link",
|
|
18369
18381
|
data: {
|
|
18370
18382
|
code: t,
|
|
18371
18383
|
vendorName: i.name,
|
|
18372
18384
|
logo: i.logo || "",
|
|
18373
18385
|
supportUrl: i.support_url || "",
|
|
18374
|
-
magicLink: `${
|
|
18386
|
+
magicLink: `${xt(n.env)}passwordless/verify_redirect?ticket=${t}`,
|
|
18375
18387
|
buttonColor: i.primary_color || "",
|
|
18376
18388
|
welcomeToYourAccount: de("welcome_to_your_account", r),
|
|
18377
18389
|
linkEmailClickToLogin: de("link_email_click_to_login", r),
|
|
@@ -18383,11 +18395,11 @@ async function dv(n, e, t) {
|
|
|
18383
18395
|
copyright: de("copyright", r)
|
|
18384
18396
|
}
|
|
18385
18397
|
});
|
|
18386
|
-
const s =
|
|
18387
|
-
type:
|
|
18398
|
+
const s = xe(n, {
|
|
18399
|
+
type: ye.CODE_LINK_SENT,
|
|
18388
18400
|
description: e
|
|
18389
18401
|
});
|
|
18390
|
-
|
|
18402
|
+
_t(n, n.env.data.logs.create(i.id, s));
|
|
18391
18403
|
}
|
|
18392
18404
|
async function Gf(n, e, t) {
|
|
18393
18405
|
const i = await n.env.data.tenants.get(n.var.tenant_id);
|
|
@@ -18401,14 +18413,14 @@ async function Gf(n, e, t) {
|
|
|
18401
18413
|
await Hs(n, {
|
|
18402
18414
|
to: e,
|
|
18403
18415
|
subject: de("code_email_subject", r),
|
|
18404
|
-
html: `Click here to validate your email: ${
|
|
18416
|
+
html: `Click here to validate your email: ${vt(n.env)}validate-email`,
|
|
18405
18417
|
template: "auth-link",
|
|
18406
18418
|
data: {
|
|
18407
18419
|
code: t,
|
|
18408
18420
|
vendorName: i.name,
|
|
18409
18421
|
logo: i.logo || "",
|
|
18410
18422
|
supportUrl: i.support_url || "",
|
|
18411
|
-
magicLink: `${
|
|
18423
|
+
magicLink: `${xt(n.env)}passwordless/verify_redirect?ticket=${t}`,
|
|
18412
18424
|
buttonColor: i.primary_color || "",
|
|
18413
18425
|
welcomeToYourAccount: de("welcome_to_your_account", r),
|
|
18414
18426
|
linkEmailClickToLogin: de("link_email_click_to_login", r),
|
|
@@ -18420,11 +18432,11 @@ async function Gf(n, e, t) {
|
|
|
18420
18432
|
copyright: de("copyright", r)
|
|
18421
18433
|
}
|
|
18422
18434
|
});
|
|
18423
|
-
const s =
|
|
18424
|
-
type:
|
|
18435
|
+
const s = xe(n, {
|
|
18436
|
+
type: ye.CODE_LINK_SENT,
|
|
18425
18437
|
description: e
|
|
18426
18438
|
});
|
|
18427
|
-
|
|
18439
|
+
_t(n, n.env.data.logs.create(i.id, s));
|
|
18428
18440
|
}
|
|
18429
18441
|
async function Jf(n, e) {
|
|
18430
18442
|
const t = await n.env.data.tenants.get(n.var.tenant_id);
|
|
@@ -18437,12 +18449,12 @@ async function Jf(n, e) {
|
|
|
18437
18449
|
await Hs(n, {
|
|
18438
18450
|
to: e.email,
|
|
18439
18451
|
subject: "Validate your email address",
|
|
18440
|
-
html: `Click here to validate your email: ${
|
|
18452
|
+
html: `Click here to validate your email: ${vt(n.env)}validate-email`,
|
|
18441
18453
|
template: "auth-verify-email",
|
|
18442
18454
|
data: {
|
|
18443
18455
|
vendorName: t.name,
|
|
18444
18456
|
logo: t.logo || "",
|
|
18445
|
-
emailValidationUrl: `${
|
|
18457
|
+
emailValidationUrl: `${vt(n.env)}validate-email`,
|
|
18446
18458
|
supportUrl: t.support_url || "https://support.sesamy.com",
|
|
18447
18459
|
buttonColor: t.primary_color || "#7d68f4",
|
|
18448
18460
|
welcomeToYourAccount: de("welcome_to_your_account", i),
|
|
@@ -18521,8 +18533,8 @@ const pv = new _e().openapi(
|
|
|
18521
18533
|
password: c,
|
|
18522
18534
|
algorithm: "bcrypt"
|
|
18523
18535
|
}), await Jf(n, o);
|
|
18524
|
-
const l =
|
|
18525
|
-
type:
|
|
18536
|
+
const l = xe(n, {
|
|
18537
|
+
type: ye.SUCCESS_SIGNUP,
|
|
18526
18538
|
description: "Successful signup"
|
|
18527
18539
|
});
|
|
18528
18540
|
return await n.env.data.logs.create(r.tenant.id, l), n.json({
|
|
@@ -18706,7 +18718,7 @@ const fv = new _e().openapi(
|
|
|
18706
18718
|
const h = Dn(n.req);
|
|
18707
18719
|
if (x.ip !== h.ip)
|
|
18708
18720
|
return n.redirect(
|
|
18709
|
-
`${
|
|
18721
|
+
`${vt(n.env)}invalid-session?state=${x.login_id}`
|
|
18710
18722
|
);
|
|
18711
18723
|
if (!Ds(s, g.callbacks, {
|
|
18712
18724
|
allowPathWildcards: !0
|
|
@@ -18761,11 +18773,11 @@ async function hv(n, e, t) {
|
|
|
18761
18773
|
provider: "auth2"
|
|
18762
18774
|
});
|
|
18763
18775
|
if (!s) {
|
|
18764
|
-
const m =
|
|
18765
|
-
type:
|
|
18776
|
+
const m = xe(n, {
|
|
18777
|
+
type: ye.FAILED_LOGIN_INCORRECT_PASSWORD,
|
|
18766
18778
|
description: "Invalid user"
|
|
18767
18779
|
});
|
|
18768
|
-
throw
|
|
18780
|
+
throw _t(n, n.env.data.logs.create(e.tenant.id, m)), new si(403, {
|
|
18769
18781
|
message: "User not found",
|
|
18770
18782
|
code: "USER_NOT_FOUND"
|
|
18771
18783
|
});
|
|
@@ -18782,11 +18794,11 @@ async function hv(n, e, t) {
|
|
|
18782
18794
|
s.user_id
|
|
18783
18795
|
);
|
|
18784
18796
|
if (!await Ha.compare(t.password, c)) {
|
|
18785
|
-
const m =
|
|
18786
|
-
type:
|
|
18797
|
+
const m = xe(n, {
|
|
18798
|
+
type: ye.FAILED_LOGIN_INCORRECT_PASSWORD,
|
|
18787
18799
|
description: "Invalid password"
|
|
18788
18800
|
});
|
|
18789
|
-
throw
|
|
18801
|
+
throw _t(n, n.env.data.logs.create(e.tenant.id, m)), new si(403, {
|
|
18790
18802
|
message: "Invalid password",
|
|
18791
18803
|
code: "INVALID_PASSWORD"
|
|
18792
18804
|
});
|
|
@@ -18797,22 +18809,22 @@ async function hv(n, e, t) {
|
|
|
18797
18809
|
include_totals: !1,
|
|
18798
18810
|
q: `user_id:${o.user_id}`
|
|
18799
18811
|
})).logs.filter(
|
|
18800
|
-
(m) => m.type ===
|
|
18812
|
+
(m) => m.type === ye.FAILED_LOGIN_INCORRECT_PASSWORD && new Date(m.date) > new Date(Date.now() - 1e3 * 60 * 5)
|
|
18801
18813
|
).length >= 3) {
|
|
18802
|
-
const m =
|
|
18814
|
+
const m = xe(n, {
|
|
18803
18815
|
// TODO: change to BLOCKED_ACCOUNT_EMAIL
|
|
18804
|
-
type:
|
|
18816
|
+
type: ye.FAILED_LOGIN,
|
|
18805
18817
|
description: "Too many failed login attempts"
|
|
18806
18818
|
});
|
|
18807
|
-
throw
|
|
18819
|
+
throw _t(n, n.env.data.logs.create(e.tenant.id, m)), new si(403, {
|
|
18808
18820
|
message: "Too many failed login attempts",
|
|
18809
18821
|
code: "TOO_MANY_FAILED_LOGINS"
|
|
18810
18822
|
});
|
|
18811
18823
|
}
|
|
18812
18824
|
if (!s.email_verified && e.email_validation === "enforced") {
|
|
18813
18825
|
await Jf(n, s);
|
|
18814
|
-
const m =
|
|
18815
|
-
type:
|
|
18826
|
+
const m = xe(n, {
|
|
18827
|
+
type: ye.FAILED_LOGIN,
|
|
18816
18828
|
description: "Email not verified"
|
|
18817
18829
|
});
|
|
18818
18830
|
throw await n.env.data.logs.create(e.tenant.id, m), new si(403, {
|
|
@@ -18820,13 +18832,13 @@ async function hv(n, e, t) {
|
|
|
18820
18832
|
code: "EMAIL_NOT_VERIFIED"
|
|
18821
18833
|
});
|
|
18822
18834
|
}
|
|
18823
|
-
const g =
|
|
18824
|
-
type:
|
|
18835
|
+
const g = xe(n, {
|
|
18836
|
+
type: ye.SUCCESS_LOGIN,
|
|
18825
18837
|
description: "Successful login",
|
|
18826
18838
|
strategy_type: "Username-Password-Authentication",
|
|
18827
18839
|
strategy: "Username-Password-Authentication"
|
|
18828
18840
|
});
|
|
18829
|
-
return
|
|
18841
|
+
return _t(n, n.env.data.logs.create(e.tenant.id, g)), o;
|
|
18830
18842
|
}
|
|
18831
18843
|
function gv() {
|
|
18832
18844
|
const n = new Uint8Array(32);
|
|
@@ -19150,8 +19162,8 @@ async function bv({
|
|
|
19150
19162
|
await p.data.sessions.update(e.tenant.id, t.session_id, {
|
|
19151
19163
|
used_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
19152
19164
|
});
|
|
19153
|
-
const S =
|
|
19154
|
-
type:
|
|
19165
|
+
const S = xe(n, {
|
|
19166
|
+
type: ye.SUCCESS_SILENT_AUTH,
|
|
19155
19167
|
description: "Successful silent authentication"
|
|
19156
19168
|
});
|
|
19157
19169
|
return await n.env.data.logs.create(e.tenant.id, S), n.html(
|
|
@@ -19165,8 +19177,8 @@ async function bv({
|
|
|
19165
19177
|
);
|
|
19166
19178
|
}
|
|
19167
19179
|
}
|
|
19168
|
-
const m =
|
|
19169
|
-
type:
|
|
19180
|
+
const m = xe(n, {
|
|
19181
|
+
type: ye.FAILED_SILENT_AUTH,
|
|
19170
19182
|
description: "Login required"
|
|
19171
19183
|
});
|
|
19172
19184
|
return await n.env.data.logs.create(e.tenant.id, m), n.html(
|
|
@@ -20256,10 +20268,10 @@ export {
|
|
|
20256
20268
|
nn as AuthorizationResponseType,
|
|
20257
20269
|
Fa as CodeChallengeMethod,
|
|
20258
20270
|
vo as GrantType,
|
|
20259
|
-
|
|
20271
|
+
ye as LogTypes,
|
|
20260
20272
|
ho as applicationInsertSchema,
|
|
20261
20273
|
An as applicationSchema,
|
|
20262
|
-
|
|
20274
|
+
St as auth0UserResponseSchema,
|
|
20263
20275
|
kd as authParamsSchema,
|
|
20264
20276
|
Da as baseUserSchema,
|
|
20265
20277
|
Hh as bordersSchema,
|