zudoku 0.12.2 → 0.13.1
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/app/main.js +3 -3
- package/dist/app/main.js.map +1 -1
- package/dist/cli/dev/handler.js +2 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/validators/validate.d.ts +42 -23
- package/dist/config/validators/validate.js +6 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/lib/components/Banner.js +7 -1
- package/dist/lib/components/Banner.js.map +1 -1
- package/dist/lib/components/Header.js +1 -1
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/Search.js +1 -1
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +9 -2
- package/dist/lib/components/SlotletProvider.js +4 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +2 -1
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +1 -1
- package/dist/lib/oas/graphql/index.js +2 -6
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/custom-pages/CustomPage.d.ts +2 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js +10 -0
- package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -0
- package/dist/lib/plugins/custom-pages/index.d.ts +10 -0
- package/dist/lib/plugins/custom-pages/index.js +11 -0
- package/dist/lib/plugins/custom-pages/index.js.map +1 -0
- package/dist/lib/plugins/openapi/Endpoint.js +1 -1
- package/dist/lib/plugins/openapi/Endpoint.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +1 -1
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/Route.d.ts +1 -1
- package/dist/lib/plugins/openapi/Route.js +1 -1
- package/dist/lib/plugins/openapi/Route.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createMemoryClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js +1 -1
- package/dist/lib/plugins/openapi/client/createWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/ui/Callout.d.ts +36 -35
- package/dist/lib/ui/Callout.js.map +1 -1
- package/dist/lib/ui/Drawer.d.ts +8 -10
- package/dist/lib/ui/Drawer.js.map +1 -1
- package/dist/lib/util/useExposedProps.d.ts +2 -0
- package/dist/lib/util/useExposedProps.js +8 -0
- package/dist/lib/util/useExposedProps.js.map +1 -0
- package/dist/vite/config.js +2 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.d.ts +6 -1
- package/dist/vite/dev-server.js +13 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-component.js +0 -1
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-custom-pages.d.ts +4 -0
- package/dist/vite/plugin-custom-pages.js +30 -0
- package/dist/vite/plugin-custom-pages.js.map +1 -0
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{AuthenticationPlugin-Bx9FK124.js → AuthenticationPlugin-CbgJ5SAh.js} +3 -3
- package/lib/{AuthenticationPlugin-Bx9FK124.js.map → AuthenticationPlugin-CbgJ5SAh.js.map} +1 -1
- package/lib/{DeveloperHint-YeWHKvyr.js → DeveloperHint-CiXPc9Xm.js} +2 -2
- package/lib/{DeveloperHint-YeWHKvyr.js.map → DeveloperHint-CiXPc9Xm.js.map} +1 -1
- package/lib/ErrorPage-B-zoPPVx.js +15 -0
- package/lib/{ErrorPage-CsZAN_za.js.map → ErrorPage-B-zoPPVx.js.map} +1 -1
- package/lib/Input-QMLhK7Rb.js +2229 -0
- package/lib/Input-QMLhK7Rb.js.map +1 -0
- package/lib/{Markdown-DapSf3wG.js → Markdown-D6Nze6qq.js} +3281 -5392
- package/lib/Markdown-D6Nze6qq.js.map +1 -0
- package/lib/{MdxPage-BqBWsXZ1.js → MdxPage-DBhq6-5F.js} +15 -15
- package/lib/{MdxPage-BqBWsXZ1.js.map → MdxPage-DBhq6-5F.js.map} +1 -1
- package/lib/{OperationList-CYrmxPa8.js → OperationList-Ba24gUd2.js} +50 -51
- package/lib/OperationList-Ba24gUd2.js.map +1 -0
- package/lib/{Route-Q5mqNQrv.js → Route-DI38nxYt.js} +3 -4
- package/lib/Route-DI38nxYt.js.map +1 -0
- package/lib/SidebarBadge-B9-VJSQr.js +503 -0
- package/lib/SidebarBadge-B9-VJSQr.js.map +1 -0
- package/lib/{SlotletProvider-D3UD5Go3.js → SlotletProvider-Cb8mGpBO.js} +46 -46
- package/lib/{SlotletProvider-D3UD5Go3.js.map → SlotletProvider-Cb8mGpBO.js.map} +1 -1
- package/lib/ZudokuContext-BEmsYQoq.js +1173 -0
- package/lib/ZudokuContext-BEmsYQoq.js.map +1 -0
- package/lib/assets/{index-B9EWVYfo.js → index-B_Jk_Yzp.js} +968 -938
- package/lib/assets/index-B_Jk_Yzp.js.map +1 -0
- package/lib/assets/{worker-Bcj4NA2p.js → worker-Bf8vjASY.js} +4582 -4303
- package/lib/assets/worker-Bf8vjASY.js.map +1 -0
- package/lib/cn-BmFQLtkS.js +2279 -0
- package/lib/cn-BmFQLtkS.js.map +1 -0
- package/lib/{index-BG0g4WW0.js → index-BRCiYFaL.js} +747 -737
- package/lib/index-BRCiYFaL.js.map +1 -0
- package/lib/{index-CLd8ycZz.js → index-CkwDvuPt.js} +947 -917
- package/lib/index-CkwDvuPt.js.map +1 -0
- package/lib/{index-LNp6rxyU.js → index-D06ATMgg.js} +2 -2
- package/lib/{index-LNp6rxyU.js.map → index-D06ATMgg.js.map} +1 -1
- package/lib/{index-BlJ2rj99.js → index-DA74gNq3.js} +1124 -974
- package/lib/index-DA74gNq3.js.map +1 -0
- package/lib/index-DJqnphbT.js +35 -0
- package/lib/{index-Bn6Lc9tq.js.map → index-DJqnphbT.js.map} +1 -1
- package/lib/{index-BngPzhKn.js → index-dgcPryXi.js} +3 -3
- package/lib/{index-BngPzhKn.js.map → index-dgcPryXi.js.map} +1 -1
- package/lib/{index-Dolisrci.js → index-g_JJcuFg.js} +603 -549
- package/lib/index-g_JJcuFg.js.map +1 -0
- package/lib/router-Oe6YmY6B.js +3024 -0
- package/lib/router-Oe6YmY6B.js.map +1 -0
- package/lib/state-CsuHT8ZO.js +183 -0
- package/lib/state-CsuHT8ZO.js.map +1 -0
- package/lib/urql-core-KJnLL26g.js +1455 -0
- package/lib/urql-core-KJnLL26g.js.map +1 -0
- package/lib/useExposedProps-Csw8oAlt.js +9 -0
- package/lib/useExposedProps-Csw8oAlt.js.map +1 -0
- package/lib/{utils-ByIc_KIM.js → utils-Chi3p5nE.js} +4 -4
- package/lib/utils-Chi3p5nE.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-openid.js +363 -350
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1697 -1623
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +4599 -4319
- package/lib/zudoku.openapi-worker.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +7 -7
- package/lib/zudoku.plugin-custom-pages.js +21 -0
- package/lib/zudoku.plugin-custom-pages.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +8 -8
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +61 -68
- package/src/app/main.tsx +3 -3
- package/src/lib/components/Banner.tsx +12 -2
- package/src/lib/components/Header.tsx +4 -2
- package/src/lib/components/Layout.tsx +1 -0
- package/src/lib/components/MobileTopNavigation.tsx +4 -0
- package/src/lib/components/Search.tsx +1 -1
- package/src/lib/components/SlotletProvider.tsx +27 -4
- package/src/lib/components/index.ts +1 -1
- package/src/lib/core/DevPortalContext.ts +1 -1
- package/src/lib/oas/graphql/index.ts +3 -11
- package/src/lib/plugins/custom-pages/CustomPage.tsx +15 -0
- package/src/lib/plugins/custom-pages/index.tsx +24 -0
- package/src/lib/plugins/openapi/Endpoint.tsx +1 -1
- package/src/lib/plugins/openapi/OperationList.tsx +1 -1
- package/src/lib/plugins/openapi/Route.tsx +1 -2
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
- package/src/lib/plugins/openapi/client/createMemoryClient.ts +1 -6
- package/src/lib/plugins/openapi/client/createWorkerClient.ts +1 -6
- package/src/lib/plugins/openapi/index.tsx +1 -5
- package/src/lib/ui/Callout.tsx +7 -6
- package/src/lib/ui/Drawer.tsx +38 -36
- package/src/lib/util/useExposedProps.tsx +10 -0
- package/dist/lib/plugins/custom-page/index.d.ts +0 -8
- package/dist/lib/plugins/custom-page/index.js +0 -12
- package/dist/lib/plugins/custom-page/index.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.d.ts +0 -1
- package/dist/lib/plugins/openapi/playground/Editor.js +0 -5
- package/dist/lib/plugins/openapi/playground/Editor.js.map +0 -1
- package/dist/lib/plugins/openapi/util/urql.d.ts +0 -7
- package/dist/lib/plugins/openapi/util/urql.js +0 -8
- package/dist/lib/plugins/openapi/util/urql.js.map +0 -1
- package/lib/CategoryHeading-ovR-zHRq.js +0 -10
- package/lib/CategoryHeading-ovR-zHRq.js.map +0 -1
- package/lib/ErrorPage-CsZAN_za.js +0 -16
- package/lib/Input-CtVUl3eT.js +0 -2198
- package/lib/Input-CtVUl3eT.js.map +0 -1
- package/lib/Markdown-DapSf3wG.js.map +0 -1
- package/lib/OperationList-CYrmxPa8.js.map +0 -1
- package/lib/Route-Q5mqNQrv.js.map +0 -1
- package/lib/SidebarBadge-Dx7jtnoA.js +0 -498
- package/lib/SidebarBadge-Dx7jtnoA.js.map +0 -1
- package/lib/ZudokuContext-cr-pTRY1.js +0 -1084
- package/lib/ZudokuContext-cr-pTRY1.js.map +0 -1
- package/lib/_commonjsHelpers-BkfeUUK-.js +0 -29
- package/lib/_commonjsHelpers-BkfeUUK-.js.map +0 -1
- package/lib/assets/index-B9EWVYfo.js.map +0 -1
- package/lib/assets/worker-Bcj4NA2p.js.map +0 -1
- package/lib/index-BG0g4WW0.js.map +0 -1
- package/lib/index-BlJ2rj99.js.map +0 -1
- package/lib/index-Bn6Lc9tq.js +0 -9
- package/lib/index-CLd8ycZz.js.map +0 -1
- package/lib/index-Dolisrci.js.map +0 -1
- package/lib/router-D2p7Olpn.js +0 -2971
- package/lib/router-D2p7Olpn.js.map +0 -1
- package/lib/state-hNe1dw4B.js +0 -548
- package/lib/state-hNe1dw4B.js.map +0 -1
- package/lib/urql-YhcsXYy8.js +0 -1591
- package/lib/urql-YhcsXYy8.js.map +0 -1
- package/lib/utils-ByIc_KIM.js.map +0 -1
- package/lib/zudoku.plugin-custom-page.js +0 -13
- package/lib/zudoku.plugin-custom-page.js.map +0 -1
- package/src/lib/plugins/custom-page/index.tsx +0 -22
- package/src/lib/plugins/openapi/playground/Editor.tsx +0 -4
- package/src/lib/plugins/openapi/util/urql.ts +0 -8
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var _ = (t, e, r) =>
|
|
4
|
-
import { j as
|
|
5
|
-
import { c as
|
|
6
|
-
import { A as
|
|
7
|
-
import { useState as
|
|
8
|
-
import { D as
|
|
9
|
-
import { E as
|
|
10
|
-
import { S as
|
|
11
|
-
import { S as
|
|
12
|
-
import { a as
|
|
13
|
-
import { u as
|
|
14
|
-
var
|
|
1
|
+
var Ie = Object.defineProperty;
|
|
2
|
+
var je = (t, e, r) => e in t ? Ie(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var _ = (t, e, r) => je(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { j as A } from "./jsx-runtime-B6kdoens.js";
|
|
5
|
+
import { c as Je, g as Oe } from "./index-DJqnphbT.js";
|
|
6
|
+
import { A as ze } from "./AuthenticationPlugin-CbgJ5SAh.js";
|
|
7
|
+
import { useState as Ne, useRef as De, useEffect as Ke } from "react";
|
|
8
|
+
import { D as We } from "./DeveloperHint-CiXPc9Xm.js";
|
|
9
|
+
import { E as He } from "./ErrorPage-B-zoPPVx.js";
|
|
10
|
+
import { S as $e } from "./Spinner-3cQDBVGr.js";
|
|
11
|
+
import { S as Fe } from "./Markdown-D6Nze6qq.js";
|
|
12
|
+
import { a as Me } from "./index-BRCiYFaL.js";
|
|
13
|
+
import { u as N } from "./state-CsuHT8ZO.js";
|
|
14
|
+
var pe = { exports: {} };
|
|
15
15
|
(function(t) {
|
|
16
16
|
(function(e, r) {
|
|
17
17
|
t.exports ? t.exports = r() : e.log = r();
|
|
18
|
-
})(
|
|
18
|
+
})(Je, function() {
|
|
19
19
|
var e = function() {
|
|
20
20
|
}, r = "undefined", o = typeof window !== r && typeof window.navigator !== r && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
|
|
21
21
|
"trace",
|
|
@@ -24,144 +24,144 @@ var fe = { exports: {} };
|
|
|
24
24
|
"warn",
|
|
25
25
|
"error"
|
|
26
26
|
], n = {}, i = null;
|
|
27
|
-
function
|
|
28
|
-
var
|
|
29
|
-
if (typeof
|
|
30
|
-
return
|
|
27
|
+
function c(l, g) {
|
|
28
|
+
var u = l[g];
|
|
29
|
+
if (typeof u.bind == "function")
|
|
30
|
+
return u.bind(l);
|
|
31
31
|
try {
|
|
32
|
-
return Function.prototype.bind.call(
|
|
32
|
+
return Function.prototype.bind.call(u, l);
|
|
33
33
|
} catch {
|
|
34
34
|
return function() {
|
|
35
|
-
return Function.prototype.apply.apply(
|
|
35
|
+
return Function.prototype.apply.apply(u, [l, arguments]);
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function p() {
|
|
40
40
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return l === "debug" && (l = "log"), typeof console === r ? !1 : l === "trace" && o ?
|
|
42
|
+
function b(l) {
|
|
43
|
+
return l === "debug" && (l = "log"), typeof console === r ? !1 : l === "trace" && o ? p : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
for (var l = this.getLevel(),
|
|
47
|
-
var
|
|
48
|
-
this[
|
|
45
|
+
function f() {
|
|
46
|
+
for (var l = this.getLevel(), g = 0; g < s.length; g++) {
|
|
47
|
+
var u = s[g];
|
|
48
|
+
this[u] = g < l ? e : this.methodFactory(u, l, this.name);
|
|
49
49
|
}
|
|
50
50
|
if (this.log = this.debug, typeof console === r && l < this.levels.SILENT)
|
|
51
51
|
return "No console available for logging";
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function y(l) {
|
|
54
54
|
return function() {
|
|
55
|
-
typeof console !== r && (
|
|
55
|
+
typeof console !== r && (f.call(this), this[l].apply(this, arguments));
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function T(l, g, u) {
|
|
59
|
+
return b(l) || y.apply(this, arguments);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
var
|
|
63
|
-
typeof l == "string" ?
|
|
64
|
-
function
|
|
65
|
-
var
|
|
66
|
-
if (!(typeof window === r || !
|
|
61
|
+
function h(l, g) {
|
|
62
|
+
var u = this, O, B, P, S = "loglevel";
|
|
63
|
+
typeof l == "string" ? S += ":" + l : typeof l == "symbol" && (S = void 0);
|
|
64
|
+
function xe(d) {
|
|
65
|
+
var m = (s[d] || "silent").toUpperCase();
|
|
66
|
+
if (!(typeof window === r || !S)) {
|
|
67
67
|
try {
|
|
68
|
-
window.localStorage[
|
|
68
|
+
window.localStorage[S] = m;
|
|
69
69
|
return;
|
|
70
70
|
} catch {
|
|
71
71
|
}
|
|
72
72
|
try {
|
|
73
|
-
window.document.cookie = encodeURIComponent(
|
|
73
|
+
window.document.cookie = encodeURIComponent(S) + "=" + m + ";";
|
|
74
74
|
} catch {
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
function ne() {
|
|
79
79
|
var d;
|
|
80
|
-
if (!(typeof window === r || !
|
|
80
|
+
if (!(typeof window === r || !S)) {
|
|
81
81
|
try {
|
|
82
|
-
d = window.localStorage[
|
|
82
|
+
d = window.localStorage[S];
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
85
|
if (typeof d === r)
|
|
86
86
|
try {
|
|
87
|
-
var
|
|
87
|
+
var m = window.document.cookie, z = encodeURIComponent(S), ie = m.indexOf(z + "=");
|
|
88
88
|
ie !== -1 && (d = /^([^;]+)/.exec(
|
|
89
|
-
|
|
89
|
+
m.slice(ie + z.length + 1)
|
|
90
90
|
)[1]);
|
|
91
91
|
} catch {
|
|
92
92
|
}
|
|
93
|
-
return
|
|
93
|
+
return u.levels[d] === void 0 && (d = void 0), d;
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
if (!(typeof window === r || !
|
|
96
|
+
function Le() {
|
|
97
|
+
if (!(typeof window === r || !S)) {
|
|
98
98
|
try {
|
|
99
|
-
window.localStorage.removeItem(
|
|
99
|
+
window.localStorage.removeItem(S);
|
|
100
100
|
} catch {
|
|
101
101
|
}
|
|
102
102
|
try {
|
|
103
|
-
window.document.cookie = encodeURIComponent(
|
|
103
|
+
window.document.cookie = encodeURIComponent(S) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
104
104
|
} catch {
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
var
|
|
110
|
-
if (typeof
|
|
111
|
-
return
|
|
108
|
+
function x(d) {
|
|
109
|
+
var m = d;
|
|
110
|
+
if (typeof m == "string" && u.levels[m.toUpperCase()] !== void 0 && (m = u.levels[m.toUpperCase()]), typeof m == "number" && m >= 0 && m <= u.levels.SILENT)
|
|
111
|
+
return m;
|
|
112
112
|
throw new TypeError("log.setLevel() called with invalid level: " + d);
|
|
113
113
|
}
|
|
114
|
-
|
|
114
|
+
u.name = l, u.levels = {
|
|
115
115
|
TRACE: 0,
|
|
116
116
|
DEBUG: 1,
|
|
117
117
|
INFO: 2,
|
|
118
118
|
WARN: 3,
|
|
119
119
|
ERROR: 4,
|
|
120
120
|
SILENT: 5
|
|
121
|
-
},
|
|
122
|
-
return
|
|
123
|
-
},
|
|
124
|
-
return
|
|
125
|
-
},
|
|
126
|
-
B =
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
if (i !==
|
|
121
|
+
}, u.methodFactory = g || T, u.getLevel = function() {
|
|
122
|
+
return P ?? B ?? O;
|
|
123
|
+
}, u.setLevel = function(d, m) {
|
|
124
|
+
return P = x(d), m !== !1 && xe(P), f.call(u);
|
|
125
|
+
}, u.setDefaultLevel = function(d) {
|
|
126
|
+
B = x(d), ne() || u.setLevel(d, !1);
|
|
127
|
+
}, u.resetLevel = function() {
|
|
128
|
+
P = null, Le(), f.call(u);
|
|
129
|
+
}, u.enableAll = function(d) {
|
|
130
|
+
u.setLevel(u.levels.TRACE, d);
|
|
131
|
+
}, u.disableAll = function(d) {
|
|
132
|
+
u.setLevel(u.levels.SILENT, d);
|
|
133
|
+
}, u.rebuild = function() {
|
|
134
|
+
if (i !== u && (O = x(i.getLevel())), f.call(u), i === u)
|
|
135
135
|
for (var d in n)
|
|
136
136
|
n[d].rebuild();
|
|
137
|
-
}, O =
|
|
137
|
+
}, O = x(
|
|
138
138
|
i ? i.getLevel() : "WARN"
|
|
139
139
|
);
|
|
140
140
|
var oe = ne();
|
|
141
|
-
oe != null && (
|
|
141
|
+
oe != null && (P = x(oe)), f.call(u);
|
|
142
142
|
}
|
|
143
|
-
i = new
|
|
144
|
-
if (typeof
|
|
143
|
+
i = new h(), i.getLogger = function(g) {
|
|
144
|
+
if (typeof g != "symbol" && typeof g != "string" || g === "")
|
|
145
145
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
146
|
-
var
|
|
147
|
-
return
|
|
148
|
-
|
|
146
|
+
var u = n[g];
|
|
147
|
+
return u || (u = n[g] = new h(
|
|
148
|
+
g,
|
|
149
149
|
i.methodFactory
|
|
150
|
-
)),
|
|
150
|
+
)), u;
|
|
151
151
|
};
|
|
152
|
-
var
|
|
152
|
+
var J = typeof window !== r ? window.log : void 0;
|
|
153
153
|
return i.noConflict = function() {
|
|
154
|
-
return typeof window !== r && window.log === i && (window.log =
|
|
154
|
+
return typeof window !== r && window.log === i && (window.log = J), i;
|
|
155
155
|
}, i.getLoggers = function() {
|
|
156
156
|
return n;
|
|
157
157
|
}, i.default = i, i;
|
|
158
158
|
});
|
|
159
|
-
})(
|
|
160
|
-
var
|
|
161
|
-
const K = /* @__PURE__ */
|
|
159
|
+
})(pe);
|
|
160
|
+
var Be = pe.exports;
|
|
161
|
+
const K = /* @__PURE__ */ Oe(Be);
|
|
162
162
|
let Y;
|
|
163
|
-
var D,
|
|
164
|
-
(typeof navigator > "u" || !((
|
|
163
|
+
var D, fe;
|
|
164
|
+
(typeof navigator > "u" || !((fe = (D = navigator.userAgent) == null ? void 0 : D.startsWith) != null && fe.call(D, "Mozilla/5.0 "))) && (Y = "oauth4webapi/v2.17.0");
|
|
165
165
|
function Q(t, e) {
|
|
166
166
|
if (t == null)
|
|
167
167
|
return !1;
|
|
@@ -171,19 +171,19 @@ function Q(t, e) {
|
|
|
171
171
|
return !1;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
const H = Symbol(),
|
|
175
|
-
function
|
|
176
|
-
return typeof t == "string" ?
|
|
174
|
+
const H = Symbol(), qe = Symbol(), X = Symbol(), we = Symbol(), Ve = Symbol(), Ge = Symbol(), Ye = new TextEncoder(), Ze = new TextDecoder();
|
|
175
|
+
function R(t) {
|
|
176
|
+
return typeof t == "string" ? Ye.encode(t) : Ze.decode(t);
|
|
177
177
|
}
|
|
178
178
|
const se = 32768;
|
|
179
|
-
function
|
|
179
|
+
function Qe(t) {
|
|
180
180
|
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
181
181
|
const e = [];
|
|
182
182
|
for (let r = 0; r < t.byteLength; r += se)
|
|
183
183
|
e.push(String.fromCharCode.apply(null, t.subarray(r, r + se)));
|
|
184
184
|
return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
185
185
|
}
|
|
186
|
-
function
|
|
186
|
+
function Xe(t) {
|
|
187
187
|
try {
|
|
188
188
|
const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), r = new Uint8Array(e.length);
|
|
189
189
|
for (let o = 0; o < e.length; o++)
|
|
@@ -193,10 +193,10 @@ function Ge(t) {
|
|
|
193
193
|
throw new a("The input to be decoded is not correctly encoded.", { cause: e });
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
return typeof t == "string" ?
|
|
196
|
+
function E(t) {
|
|
197
|
+
return typeof t == "string" ? Xe(t) : Qe(t);
|
|
198
198
|
}
|
|
199
|
-
class
|
|
199
|
+
class et {
|
|
200
200
|
constructor(e) {
|
|
201
201
|
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
|
|
202
202
|
}
|
|
@@ -220,37 +220,37 @@ class Ve {
|
|
|
220
220
|
this.cache.set(e, r), this.cache.size >= this.maxSize && (this._cache = this.cache, this.cache = /* @__PURE__ */ new Map());
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
class
|
|
223
|
+
class v extends Error {
|
|
224
224
|
constructor(e) {
|
|
225
225
|
var r;
|
|
226
226
|
super(e ?? "operation not supported"), this.name = this.constructor.name, (r = Error.captureStackTrace) == null || r.call(Error, this, this.constructor);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
class
|
|
229
|
+
class tt extends Error {
|
|
230
230
|
constructor(e, r) {
|
|
231
231
|
var o;
|
|
232
232
|
super(e, r), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
|
-
const a =
|
|
236
|
-
function
|
|
235
|
+
const a = tt, ge = new et(100);
|
|
236
|
+
function me(t) {
|
|
237
237
|
return t instanceof CryptoKey;
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
239
|
+
function ye(t) {
|
|
240
|
+
return me(t) && t.type === "private";
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
242
|
+
function rt(t) {
|
|
243
|
+
return me(t) && t.type === "public";
|
|
244
244
|
}
|
|
245
245
|
function ee(t) {
|
|
246
246
|
try {
|
|
247
247
|
const e = t.headers.get("dpop-nonce");
|
|
248
|
-
e &&
|
|
248
|
+
e && ge.set(new URL(t.url).origin, e);
|
|
249
249
|
} catch {
|
|
250
250
|
}
|
|
251
251
|
return t;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function L(t) {
|
|
254
254
|
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
255
255
|
}
|
|
256
256
|
function $(t) {
|
|
@@ -267,7 +267,7 @@ function te(t) {
|
|
|
267
267
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
268
268
|
return t;
|
|
269
269
|
}
|
|
270
|
-
async function
|
|
270
|
+
async function nt(t, e) {
|
|
271
271
|
if (!(t instanceof URL))
|
|
272
272
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
273
273
|
if (t.protocol !== "https:" && t.protocol !== "http:")
|
|
@@ -292,10 +292,10 @@ async function Qe(t, e) {
|
|
|
292
292
|
signal: e != null && e.signal ? te(e.signal) : null
|
|
293
293
|
}).then(ee);
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function w(t) {
|
|
296
296
|
return typeof t == "string" && t.length !== 0;
|
|
297
297
|
}
|
|
298
|
-
async function
|
|
298
|
+
async function ot(t, e) {
|
|
299
299
|
if (!(t instanceof URL))
|
|
300
300
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
301
301
|
if (!Q(e, Response))
|
|
@@ -309,45 +309,49 @@ async function Xe(t, e) {
|
|
|
309
309
|
} catch (o) {
|
|
310
310
|
throw new a('failed to parse "response" body as JSON', { cause: o });
|
|
311
311
|
}
|
|
312
|
-
if (!
|
|
312
|
+
if (!L(r))
|
|
313
313
|
throw new a('"response" body must be a top level object');
|
|
314
|
-
if (!
|
|
314
|
+
if (!w(r.issuer))
|
|
315
315
|
throw new a('"response" body "issuer" property must be a non-empty string');
|
|
316
316
|
if (new URL(r.issuer).href !== t.href)
|
|
317
317
|
throw new a('"response" body "issuer" does not match "expectedIssuer"');
|
|
318
318
|
return r;
|
|
319
319
|
}
|
|
320
320
|
function F() {
|
|
321
|
-
return
|
|
321
|
+
return E(crypto.getRandomValues(new Uint8Array(32)));
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function it() {
|
|
324
324
|
return F();
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function st() {
|
|
327
327
|
return F();
|
|
328
328
|
}
|
|
329
|
-
async function
|
|
330
|
-
if (!
|
|
329
|
+
async function at(t) {
|
|
330
|
+
if (!w(t))
|
|
331
331
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
332
|
-
return
|
|
332
|
+
return E(await crypto.subtle.digest("SHA-256", R(t)));
|
|
333
333
|
}
|
|
334
|
-
function
|
|
334
|
+
function ct(t) {
|
|
335
335
|
if (t instanceof CryptoKey)
|
|
336
336
|
return { key: t };
|
|
337
337
|
if (!((t == null ? void 0 : t.key) instanceof CryptoKey))
|
|
338
338
|
return {};
|
|
339
|
-
if (t.kid !== void 0 && !
|
|
339
|
+
if (t.kid !== void 0 && !w(t.kid))
|
|
340
340
|
throw new TypeError('"kid" must be a non-empty string');
|
|
341
|
-
return {
|
|
341
|
+
return {
|
|
342
|
+
key: t.key,
|
|
343
|
+
kid: t.kid,
|
|
344
|
+
modifyAssertion: t[we]
|
|
345
|
+
};
|
|
342
346
|
}
|
|
343
347
|
function ae(t) {
|
|
344
348
|
return encodeURIComponent(t).replace(/%20/g, "+");
|
|
345
349
|
}
|
|
346
|
-
function
|
|
350
|
+
function ut(t, e) {
|
|
347
351
|
const r = ae(t), o = ae(e);
|
|
348
352
|
return `Basic ${btoa(`${r}:${o}`)}`;
|
|
349
353
|
}
|
|
350
|
-
function
|
|
354
|
+
function lt(t) {
|
|
351
355
|
switch (t.algorithm.hash.name) {
|
|
352
356
|
case "SHA-256":
|
|
353
357
|
return "PS256";
|
|
@@ -356,10 +360,10 @@ function it(t) {
|
|
|
356
360
|
case "SHA-512":
|
|
357
361
|
return "PS512";
|
|
358
362
|
default:
|
|
359
|
-
throw new
|
|
363
|
+
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
360
364
|
}
|
|
361
365
|
}
|
|
362
|
-
function
|
|
366
|
+
function dt(t) {
|
|
363
367
|
switch (t.algorithm.hash.name) {
|
|
364
368
|
case "SHA-256":
|
|
365
369
|
return "RS256";
|
|
@@ -368,10 +372,10 @@ function st(t) {
|
|
|
368
372
|
case "SHA-512":
|
|
369
373
|
return "RS512";
|
|
370
374
|
default:
|
|
371
|
-
throw new
|
|
375
|
+
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
372
376
|
}
|
|
373
377
|
}
|
|
374
|
-
function
|
|
378
|
+
function ht(t) {
|
|
375
379
|
switch (t.algorithm.namedCurve) {
|
|
376
380
|
case "P-256":
|
|
377
381
|
return "ES256";
|
|
@@ -380,37 +384,37 @@ function at(t) {
|
|
|
380
384
|
case "P-521":
|
|
381
385
|
return "ES512";
|
|
382
386
|
default:
|
|
383
|
-
throw new
|
|
387
|
+
throw new v("unsupported EcKeyAlgorithm namedCurve");
|
|
384
388
|
}
|
|
385
389
|
}
|
|
386
|
-
function
|
|
390
|
+
function _e(t) {
|
|
387
391
|
switch (t.algorithm.name) {
|
|
388
392
|
case "RSA-PSS":
|
|
389
|
-
return
|
|
393
|
+
return lt(t);
|
|
390
394
|
case "RSASSA-PKCS1-v1_5":
|
|
391
|
-
return
|
|
395
|
+
return dt(t);
|
|
392
396
|
case "ECDSA":
|
|
393
|
-
return
|
|
397
|
+
return ht(t);
|
|
394
398
|
case "Ed25519":
|
|
395
399
|
case "Ed448":
|
|
396
400
|
return "EdDSA";
|
|
397
401
|
default:
|
|
398
|
-
throw new
|
|
402
|
+
throw new v("unsupported CryptoKey algorithm name");
|
|
399
403
|
}
|
|
400
404
|
}
|
|
401
|
-
function
|
|
405
|
+
function C(t) {
|
|
402
406
|
const e = t == null ? void 0 : t[H];
|
|
403
407
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
404
408
|
}
|
|
405
|
-
function
|
|
406
|
-
const e = t == null ? void 0 : t[
|
|
409
|
+
function be(t) {
|
|
410
|
+
const e = t == null ? void 0 : t[qe];
|
|
407
411
|
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
408
412
|
}
|
|
409
413
|
function M() {
|
|
410
414
|
return Math.floor(Date.now() / 1e3);
|
|
411
415
|
}
|
|
412
|
-
function
|
|
413
|
-
const r = M() +
|
|
416
|
+
function ft(t, e) {
|
|
417
|
+
const r = M() + C(e);
|
|
414
418
|
return {
|
|
415
419
|
jti: F(),
|
|
416
420
|
aud: [t.issuer, t.token_endpoint],
|
|
@@ -421,28 +425,26 @@ function ct(t, e) {
|
|
|
421
425
|
sub: e.client_id
|
|
422
426
|
};
|
|
423
427
|
}
|
|
424
|
-
async function
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
kid: o
|
|
428
|
-
}, ct(t, e), r);
|
|
428
|
+
async function pt(t, e, r, o, s) {
|
|
429
|
+
const n = { alg: _e(r), kid: o }, i = ft(t, e);
|
|
430
|
+
return s == null || s(n, i), Se(n, i, r);
|
|
429
431
|
}
|
|
430
|
-
function
|
|
432
|
+
function I(t) {
|
|
431
433
|
if (typeof t != "object" || t === null)
|
|
432
434
|
throw new TypeError('"as" must be an object');
|
|
433
|
-
if (!
|
|
435
|
+
if (!w(t.issuer))
|
|
434
436
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
435
437
|
return !0;
|
|
436
438
|
}
|
|
437
|
-
function
|
|
439
|
+
function j(t) {
|
|
438
440
|
if (typeof t != "object" || t === null)
|
|
439
441
|
throw new TypeError('"client" must be an object');
|
|
440
|
-
if (!
|
|
442
|
+
if (!w(t.client_id))
|
|
441
443
|
throw new TypeError('"client.client_id" property must be a non-empty string');
|
|
442
444
|
return !0;
|
|
443
445
|
}
|
|
444
446
|
function ce(t) {
|
|
445
|
-
if (!
|
|
447
|
+
if (!w(t))
|
|
446
448
|
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
447
449
|
return t;
|
|
448
450
|
}
|
|
@@ -454,11 +456,11 @@ function ue(t, e) {
|
|
|
454
456
|
if (e !== void 0)
|
|
455
457
|
throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
|
|
456
458
|
}
|
|
457
|
-
async function
|
|
459
|
+
async function wt(t, e, r, o, s) {
|
|
458
460
|
switch (r.delete("client_secret"), r.delete("client_assertion_type"), r.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
459
461
|
case void 0:
|
|
460
462
|
case "client_secret_basic": {
|
|
461
|
-
q("client_secret_basic", s), o.set("authorization",
|
|
463
|
+
q("client_secret_basic", s), o.set("authorization", ut(e.client_id, ce(e.client_secret)));
|
|
462
464
|
break;
|
|
463
465
|
}
|
|
464
466
|
case "client_secret_post": {
|
|
@@ -468,10 +470,10 @@ async function lt(t, e, r, o, s) {
|
|
|
468
470
|
case "private_key_jwt": {
|
|
469
471
|
if (ue("private_key_jwt", e.client_secret), s === void 0)
|
|
470
472
|
throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
471
|
-
const { key: n, kid: i } =
|
|
472
|
-
if (!
|
|
473
|
+
const { key: n, kid: i, modifyAssertion: c } = ct(s);
|
|
474
|
+
if (!ye(n))
|
|
473
475
|
throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
|
|
474
|
-
r.set("client_id", e.client_id), r.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), r.set("client_assertion", await
|
|
476
|
+
r.set("client_id", e.client_id), r.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), r.set("client_assertion", await pt(t, e, n, i, c));
|
|
475
477
|
break;
|
|
476
478
|
}
|
|
477
479
|
case "tls_client_auth":
|
|
@@ -481,65 +483,69 @@ async function lt(t, e, r, o, s) {
|
|
|
481
483
|
break;
|
|
482
484
|
}
|
|
483
485
|
default:
|
|
484
|
-
throw new
|
|
486
|
+
throw new v("unsupported client token_endpoint_auth_method");
|
|
485
487
|
}
|
|
486
488
|
}
|
|
487
|
-
async function
|
|
489
|
+
async function Se(t, e, r) {
|
|
488
490
|
if (!r.usages.includes("sign"))
|
|
489
491
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
490
|
-
const o = `${
|
|
492
|
+
const o = `${E(R(JSON.stringify(t)))}.${E(R(JSON.stringify(e)))}`, s = E(await crypto.subtle.sign(Pe(r), r, R(o)));
|
|
491
493
|
return `${o}.${s}`;
|
|
492
494
|
}
|
|
493
|
-
async function
|
|
494
|
-
|
|
495
|
-
|
|
495
|
+
async function gt(t, e, r, o, s, n) {
|
|
496
|
+
var T;
|
|
497
|
+
const { privateKey: i, publicKey: c, nonce: p = ge.get(r.origin) } = e;
|
|
498
|
+
if (!ye(i))
|
|
496
499
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
497
|
-
if (!
|
|
500
|
+
if (!rt(c))
|
|
498
501
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
499
|
-
if (
|
|
502
|
+
if (p !== void 0 && !w(p))
|
|
500
503
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
501
|
-
if (!
|
|
504
|
+
if (!c.extractable)
|
|
502
505
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
503
|
-
const
|
|
504
|
-
alg:
|
|
506
|
+
const b = M() + s, f = {
|
|
507
|
+
alg: _e(i),
|
|
505
508
|
typ: "dpop+jwt",
|
|
506
|
-
jwk: await
|
|
507
|
-
}, {
|
|
508
|
-
iat:
|
|
509
|
+
jwk: await yt(c)
|
|
510
|
+
}, y = {
|
|
511
|
+
iat: b,
|
|
509
512
|
jti: F(),
|
|
510
513
|
htm: o,
|
|
511
|
-
nonce:
|
|
514
|
+
nonce: p,
|
|
512
515
|
htu: `${r.origin}${r.pathname}`,
|
|
513
|
-
ath: n ?
|
|
514
|
-
}
|
|
515
|
-
t.set("dpop", y);
|
|
516
|
+
ath: n ? E(await crypto.subtle.digest("SHA-256", R(n))) : void 0
|
|
517
|
+
};
|
|
518
|
+
(T = e[we]) == null || T.call(e, f, y), t.set("dpop", await Se(f, y, i));
|
|
516
519
|
}
|
|
517
520
|
let W;
|
|
518
|
-
async function
|
|
519
|
-
const { kty: e, e: r, n: o, x: s, y: n, crv: i } = await crypto.subtle.exportKey("jwk", t),
|
|
520
|
-
return W.set(t,
|
|
521
|
+
async function mt(t) {
|
|
522
|
+
const { kty: e, e: r, n: o, x: s, y: n, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: r, n: o, x: s, y: n, crv: i };
|
|
523
|
+
return W.set(t, c), c;
|
|
521
524
|
}
|
|
522
|
-
async function
|
|
523
|
-
return W || (W = /* @__PURE__ */ new WeakMap()), W.get(t) ||
|
|
525
|
+
async function yt(t) {
|
|
526
|
+
return W || (W = /* @__PURE__ */ new WeakMap()), W.get(t) || mt(t);
|
|
524
527
|
}
|
|
525
|
-
function
|
|
528
|
+
function le(t, e, r) {
|
|
526
529
|
if (typeof t != "string")
|
|
527
|
-
throw new TypeError(`"as.${e}" must be a string`);
|
|
530
|
+
throw r ? new TypeError(`"as.mtls_endpoint_aliases.${e}" must be a string`) : new TypeError(`"as.${e}" must be a string`);
|
|
528
531
|
return new URL(t);
|
|
529
532
|
}
|
|
530
|
-
function
|
|
531
|
-
return
|
|
533
|
+
function ve(t, e, r = !1) {
|
|
534
|
+
return r && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? le(t.mtls_endpoint_aliases[e], e, r) : le(t[e], e, r);
|
|
535
|
+
}
|
|
536
|
+
function Te(t, e) {
|
|
537
|
+
return !!(t.use_mtls_endpoint_aliases || e != null && e[Ge]);
|
|
532
538
|
}
|
|
533
539
|
function Z(t) {
|
|
534
540
|
const e = t;
|
|
535
541
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
536
542
|
}
|
|
537
|
-
async function
|
|
538
|
-
if (!
|
|
543
|
+
async function _t(t, e, r, o, s, n) {
|
|
544
|
+
if (!w(t))
|
|
539
545
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
540
546
|
if (!(r instanceof URL))
|
|
541
547
|
throw new TypeError('"url" must be an instance of URL');
|
|
542
|
-
return o = $(o), (n == null ? void 0 : n.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await
|
|
548
|
+
return o = $(o), (n == null ? void 0 : n.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await gt(o, n.DPoP, r, e.toUpperCase(), C({ [H]: n == null ? void 0 : n[H] }), t), o.set("authorization", `DPoP ${t}`)), ((n == null ? void 0 : n[X]) || fetch)(r.href, {
|
|
543
549
|
body: s,
|
|
544
550
|
headers: Object.fromEntries(o.entries()),
|
|
545
551
|
method: e,
|
|
@@ -547,16 +553,16 @@ async function wt(t, e, r, o, s, n) {
|
|
|
547
553
|
signal: n != null && n.signal ? te(n.signal) : null
|
|
548
554
|
}).then(ee);
|
|
549
555
|
}
|
|
550
|
-
async function
|
|
551
|
-
|
|
552
|
-
const s =
|
|
553
|
-
return e.userinfo_signed_response_alg ? n.set("accept", "application/jwt") : (n.set("accept", "application/json"), n.append("accept", "application/jwt")),
|
|
556
|
+
async function bt(t, e, r, o) {
|
|
557
|
+
I(t), j(e);
|
|
558
|
+
const s = ve(t, "userinfo_endpoint", Te(e, o)), n = $(o == null ? void 0 : o.headers);
|
|
559
|
+
return e.userinfo_signed_response_alg ? n.set("accept", "application/jwt") : (n.set("accept", "application/json"), n.append("accept", "application/jwt")), _t(r, "GET", s, n, null, {
|
|
554
560
|
...o,
|
|
555
|
-
[H]:
|
|
561
|
+
[H]: C(e)
|
|
556
562
|
});
|
|
557
563
|
}
|
|
558
|
-
async function
|
|
559
|
-
return await
|
|
564
|
+
async function St(t, e, r, o, s, n, i) {
|
|
565
|
+
return await wt(t, e, s, n, i == null ? void 0 : i.clientPrivateKey), n.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[X]) || fetch)(o.href, {
|
|
560
566
|
body: s,
|
|
561
567
|
headers: Object.fromEntries(n.entries()),
|
|
562
568
|
method: r,
|
|
@@ -564,33 +570,33 @@ async function mt(t, e, r, o, s, n, i) {
|
|
|
564
570
|
signal: i != null && i.signal ? te(i.signal) : null
|
|
565
571
|
}).then(ee);
|
|
566
572
|
}
|
|
567
|
-
async function
|
|
568
|
-
const n =
|
|
573
|
+
async function ke(t, e, r, o, s) {
|
|
574
|
+
const n = ve(t, "token_endpoint", Te(e, s));
|
|
569
575
|
o.set("grant_type", r);
|
|
570
576
|
const i = $(s == null ? void 0 : s.headers);
|
|
571
|
-
return i.set("accept", "application/json"),
|
|
577
|
+
return i.set("accept", "application/json"), St(t, e, "POST", n, o, i, s);
|
|
572
578
|
}
|
|
573
|
-
async function
|
|
574
|
-
if (
|
|
579
|
+
async function vt(t, e, r, o) {
|
|
580
|
+
if (I(t), j(e), !w(r))
|
|
575
581
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
576
582
|
const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
577
|
-
return s.set("refresh_token", r),
|
|
583
|
+
return s.set("refresh_token", r), ke(t, e, "refresh_token", s, o);
|
|
578
584
|
}
|
|
579
|
-
const
|
|
580
|
-
function
|
|
585
|
+
const Ee = /* @__PURE__ */ new WeakMap();
|
|
586
|
+
function Tt(t) {
|
|
581
587
|
if (!t.id_token)
|
|
582
588
|
return;
|
|
583
|
-
const e =
|
|
589
|
+
const e = Ee.get(t);
|
|
584
590
|
if (!e)
|
|
585
591
|
throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
|
|
586
|
-
return e;
|
|
592
|
+
return e[0];
|
|
587
593
|
}
|
|
588
|
-
async function
|
|
589
|
-
if (
|
|
594
|
+
async function Ae(t, e, r, o = !1, s = !1) {
|
|
595
|
+
if (I(t), j(e), !Q(r, Response))
|
|
590
596
|
throw new TypeError('"response" must be an instance of Response');
|
|
591
597
|
if (r.status !== 200) {
|
|
592
598
|
let i;
|
|
593
|
-
if (i = await
|
|
599
|
+
if (i = await It(r))
|
|
594
600
|
return i;
|
|
595
601
|
throw new a('"response" is not a conform Token Endpoint response');
|
|
596
602
|
}
|
|
@@ -601,38 +607,42 @@ async function Te(t, e, r, o = !1, s = !1) {
|
|
|
601
607
|
} catch (i) {
|
|
602
608
|
throw new a('failed to parse "response" body as JSON', { cause: i });
|
|
603
609
|
}
|
|
604
|
-
if (!
|
|
610
|
+
if (!L(n))
|
|
605
611
|
throw new a('"response" body must be a top level object');
|
|
606
|
-
if (!
|
|
612
|
+
if (!w(n.access_token))
|
|
607
613
|
throw new a('"response" body "access_token" property must be a non-empty string');
|
|
608
|
-
if (!
|
|
614
|
+
if (!w(n.token_type))
|
|
609
615
|
throw new a('"response" body "token_type" property must be a non-empty string');
|
|
610
616
|
if (n.token_type = n.token_type.toLowerCase(), n.token_type !== "dpop" && n.token_type !== "bearer")
|
|
611
|
-
throw new
|
|
617
|
+
throw new v("unsupported `token_type` value");
|
|
612
618
|
if (n.expires_in !== void 0 && (typeof n.expires_in != "number" || n.expires_in <= 0))
|
|
613
619
|
throw new a('"response" body "expires_in" property must be a positive number');
|
|
614
|
-
if (!s && n.refresh_token !== void 0 && !
|
|
620
|
+
if (!s && n.refresh_token !== void 0 && !w(n.refresh_token))
|
|
615
621
|
throw new a('"response" body "refresh_token" property must be a non-empty string');
|
|
616
622
|
if (n.scope !== void 0 && typeof n.scope != "string")
|
|
617
623
|
throw new a('"response" body "scope" property must be a string');
|
|
618
624
|
if (!o) {
|
|
619
|
-
if (n.id_token !== void 0 && !
|
|
625
|
+
if (n.id_token !== void 0 && !w(n.id_token))
|
|
620
626
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
621
627
|
if (n.id_token) {
|
|
622
|
-
const { claims: i } = await
|
|
623
|
-
if (Array.isArray(i.aud) && i.aud.length !== 1
|
|
624
|
-
|
|
628
|
+
const { claims: i, jwt: c } = await Ot(n.id_token, zt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ue, C(e), be(e), e[Ve]).then(xt.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(At.bind(void 0, t.issuer)).then(Et.bind(void 0, e.client_id));
|
|
629
|
+
if (Array.isArray(i.aud) && i.aud.length !== 1) {
|
|
630
|
+
if (i.azp === void 0)
|
|
631
|
+
throw new a('ID Token "aud" (audience) claim includes additional untrusted audiences');
|
|
632
|
+
if (i.azp !== e.client_id)
|
|
633
|
+
throw new a('unexpected ID Token "azp" (authorized party) claim value');
|
|
634
|
+
}
|
|
625
635
|
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
626
636
|
throw new a('ID Token "auth_time" (authentication time) must be a positive number');
|
|
627
|
-
|
|
637
|
+
Ee.set(n, [i, c]);
|
|
628
638
|
}
|
|
629
639
|
}
|
|
630
640
|
return n;
|
|
631
641
|
}
|
|
632
|
-
async function
|
|
633
|
-
return
|
|
642
|
+
async function kt(t, e, r) {
|
|
643
|
+
return Ae(t, e, r);
|
|
634
644
|
}
|
|
635
|
-
function
|
|
645
|
+
function Et(t, e) {
|
|
636
646
|
if (Array.isArray(e.claims.aud)) {
|
|
637
647
|
if (!e.claims.aud.includes(t))
|
|
638
648
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
@@ -640,29 +650,29 @@ function vt(t, e) {
|
|
|
640
650
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
641
651
|
return e;
|
|
642
652
|
}
|
|
643
|
-
function
|
|
653
|
+
function At(t, e) {
|
|
644
654
|
if (e.claims.iss !== t)
|
|
645
655
|
throw new a('unexpected JWT "iss" (issuer) claim value');
|
|
646
656
|
return e;
|
|
647
657
|
}
|
|
648
|
-
const
|
|
649
|
-
function
|
|
650
|
-
return
|
|
658
|
+
const Re = /* @__PURE__ */ new WeakSet();
|
|
659
|
+
function Rt(t) {
|
|
660
|
+
return Re.add(t), t;
|
|
651
661
|
}
|
|
652
|
-
async function
|
|
653
|
-
if (
|
|
662
|
+
async function Pt(t, e, r, o, s, n) {
|
|
663
|
+
if (I(t), j(e), !Re.has(r))
|
|
654
664
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
655
|
-
if (!
|
|
665
|
+
if (!w(o))
|
|
656
666
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
657
|
-
if (!
|
|
667
|
+
if (!w(s))
|
|
658
668
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
659
|
-
const i =
|
|
669
|
+
const i = k(r, "code");
|
|
660
670
|
if (!i)
|
|
661
671
|
throw new a('no authorization code in "callbackParameters"');
|
|
662
|
-
const
|
|
663
|
-
return
|
|
672
|
+
const c = new URLSearchParams(n == null ? void 0 : n.additionalParameters);
|
|
673
|
+
return c.set("redirect_uri", o), c.set("code_verifier", s), c.set("code", i), ke(t, e, "authorization_code", c, n);
|
|
664
674
|
}
|
|
665
|
-
const
|
|
675
|
+
const Ut = {
|
|
666
676
|
aud: "audience",
|
|
667
677
|
c_hash: "code hash",
|
|
668
678
|
client_id: "client id",
|
|
@@ -678,38 +688,38 @@ const Et = {
|
|
|
678
688
|
htu: "http uri",
|
|
679
689
|
cnf: "confirmation"
|
|
680
690
|
};
|
|
681
|
-
function
|
|
691
|
+
function xt(t, e) {
|
|
682
692
|
for (const r of t)
|
|
683
693
|
if (e.claims[r] === void 0)
|
|
684
|
-
throw new a(`JWT "${r}" (${
|
|
694
|
+
throw new a(`JWT "${r}" (${Ut[r]}) claim missing`);
|
|
685
695
|
return e;
|
|
686
696
|
}
|
|
687
|
-
const
|
|
688
|
-
async function
|
|
689
|
-
const n = await
|
|
697
|
+
const Lt = Symbol(), V = Symbol();
|
|
698
|
+
async function Ct(t, e, r, o, s) {
|
|
699
|
+
const n = await Ae(t, e, r);
|
|
690
700
|
if (Z(n))
|
|
691
701
|
return n;
|
|
692
|
-
if (!
|
|
702
|
+
if (!w(n.id_token))
|
|
693
703
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
694
|
-
s ?? (s = e.default_max_age ??
|
|
695
|
-
const i =
|
|
696
|
-
if ((e.require_auth_time || s !==
|
|
704
|
+
s ?? (s = e.default_max_age ?? V);
|
|
705
|
+
const i = Tt(n);
|
|
706
|
+
if ((e.require_auth_time || s !== V) && i.auth_time === void 0)
|
|
697
707
|
throw new a('ID Token "auth_time" (authentication time) claim missing');
|
|
698
|
-
if (s !==
|
|
708
|
+
if (s !== V) {
|
|
699
709
|
if (typeof s != "number" || s < 0)
|
|
700
710
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
701
|
-
const
|
|
702
|
-
if (i.auth_time + s <
|
|
711
|
+
const c = M() + C(e), p = be(e);
|
|
712
|
+
if (i.auth_time + s < c - p)
|
|
703
713
|
throw new a("too much time has elapsed since the last End-User authentication");
|
|
704
714
|
}
|
|
705
715
|
switch (o) {
|
|
706
716
|
case void 0:
|
|
707
|
-
case
|
|
717
|
+
case Lt:
|
|
708
718
|
if (i.nonce !== void 0)
|
|
709
719
|
throw new a('unexpected ID Token "nonce" claim value');
|
|
710
720
|
break;
|
|
711
721
|
default:
|
|
712
|
-
if (!
|
|
722
|
+
if (!w(o))
|
|
713
723
|
throw new TypeError('"expectedNonce" must be a non-empty string');
|
|
714
724
|
if (i.nonce === void 0)
|
|
715
725
|
throw new a('ID Token "nonce" claim missing');
|
|
@@ -722,22 +732,22 @@ function re(t) {
|
|
|
722
732
|
if (t.bodyUsed)
|
|
723
733
|
throw new TypeError('"response" body has been used already');
|
|
724
734
|
}
|
|
725
|
-
async function
|
|
735
|
+
async function It(t) {
|
|
726
736
|
if (t.status > 399 && t.status < 500) {
|
|
727
737
|
re(t);
|
|
728
738
|
try {
|
|
729
739
|
const e = await t.json();
|
|
730
|
-
if (
|
|
740
|
+
if (L(e) && typeof e.error == "string" && e.error.length)
|
|
731
741
|
return e.error_description !== void 0 && typeof e.error_description != "string" && delete e.error_description, e.error_uri !== void 0 && typeof e.error_uri != "string" && delete e.error_uri, e.algs !== void 0 && typeof e.algs != "string" && delete e.algs, e.scope !== void 0 && typeof e.scope != "string" && delete e.scope, e;
|
|
732
742
|
} catch {
|
|
733
743
|
}
|
|
734
744
|
}
|
|
735
745
|
}
|
|
736
|
-
function
|
|
746
|
+
function de(t) {
|
|
737
747
|
if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
|
|
738
748
|
throw new a(`${t.name} modulusLength must be at least 2048 bits`);
|
|
739
749
|
}
|
|
740
|
-
function
|
|
750
|
+
function jt(t) {
|
|
741
751
|
switch (t) {
|
|
742
752
|
case "P-256":
|
|
743
753
|
return "SHA-256";
|
|
@@ -746,18 +756,18 @@ function Ut(t) {
|
|
|
746
756
|
case "P-521":
|
|
747
757
|
return "SHA-512";
|
|
748
758
|
default:
|
|
749
|
-
throw new
|
|
759
|
+
throw new v();
|
|
750
760
|
}
|
|
751
761
|
}
|
|
752
|
-
function
|
|
762
|
+
function Pe(t) {
|
|
753
763
|
switch (t.algorithm.name) {
|
|
754
764
|
case "ECDSA":
|
|
755
765
|
return {
|
|
756
766
|
name: t.algorithm.name,
|
|
757
|
-
hash:
|
|
767
|
+
hash: jt(t.algorithm.namedCurve)
|
|
758
768
|
};
|
|
759
769
|
case "RSA-PSS":
|
|
760
|
-
switch (
|
|
770
|
+
switch (de(t.algorithm), t.algorithm.hash.name) {
|
|
761
771
|
case "SHA-256":
|
|
762
772
|
case "SHA-384":
|
|
763
773
|
case "SHA-512":
|
|
@@ -766,54 +776,57 @@ function Ee(t) {
|
|
|
766
776
|
saltLength: parseInt(t.algorithm.hash.name.slice(-3), 10) >> 3
|
|
767
777
|
};
|
|
768
778
|
default:
|
|
769
|
-
throw new
|
|
779
|
+
throw new v();
|
|
770
780
|
}
|
|
771
781
|
case "RSASSA-PKCS1-v1_5":
|
|
772
|
-
return
|
|
782
|
+
return de(t.algorithm), t.algorithm.name;
|
|
773
783
|
case "Ed448":
|
|
774
784
|
case "Ed25519":
|
|
775
785
|
return t.algorithm.name;
|
|
776
786
|
}
|
|
777
|
-
throw new
|
|
778
|
-
}
|
|
779
|
-
const
|
|
780
|
-
async function
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
throw new
|
|
784
|
-
|
|
787
|
+
throw new v();
|
|
788
|
+
}
|
|
789
|
+
const Ue = Symbol();
|
|
790
|
+
async function Jt(t, e, r, o) {
|
|
791
|
+
const s = `${t}.${e}`;
|
|
792
|
+
if (!await crypto.subtle.verify(Pe(r), r, o, R(s)))
|
|
793
|
+
throw new a("JWT signature verification failed");
|
|
794
|
+
}
|
|
795
|
+
async function Ot(t, e, r, o, s, n) {
|
|
796
|
+
let { 0: i, 1: c, 2: p, length: b } = t.split(".");
|
|
797
|
+
if (b === 5)
|
|
798
|
+
if (n !== void 0)
|
|
799
|
+
t = await n(t), { 0: i, 1: c, 2: p, length: b } = t.split(".");
|
|
800
|
+
else
|
|
801
|
+
throw new v("JWE structure JWTs are not supported");
|
|
802
|
+
if (b !== 3)
|
|
785
803
|
throw new a("Invalid JWT");
|
|
786
|
-
let
|
|
804
|
+
let f;
|
|
787
805
|
try {
|
|
788
|
-
|
|
789
|
-
} catch (
|
|
790
|
-
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause:
|
|
806
|
+
f = JSON.parse(R(E(i)));
|
|
807
|
+
} catch (l) {
|
|
808
|
+
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
791
809
|
}
|
|
792
|
-
if (!
|
|
810
|
+
if (!L(f))
|
|
793
811
|
throw new a("JWT Header must be a top level object");
|
|
794
|
-
if (e(
|
|
812
|
+
if (e(f), f.crit !== void 0)
|
|
795
813
|
throw new a('unexpected JWT "crit" header parameter');
|
|
796
|
-
const y =
|
|
797
|
-
let
|
|
798
|
-
|
|
799
|
-
b = await r(m);
|
|
800
|
-
const P = `${n}.${i}`;
|
|
801
|
-
if (!await crypto.subtle.verify(Ee(b), b, y, A(P)))
|
|
802
|
-
throw new a("JWT signature verification failed");
|
|
803
|
-
}
|
|
814
|
+
const y = E(p);
|
|
815
|
+
let T;
|
|
816
|
+
r !== Ue && (T = await r(f), await Jt(i, c, T, y));
|
|
804
817
|
let h;
|
|
805
818
|
try {
|
|
806
|
-
h = JSON.parse(
|
|
807
|
-
} catch (
|
|
808
|
-
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause:
|
|
819
|
+
h = JSON.parse(R(E(c)));
|
|
820
|
+
} catch (l) {
|
|
821
|
+
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
809
822
|
}
|
|
810
|
-
if (!
|
|
823
|
+
if (!L(h))
|
|
811
824
|
throw new a("JWT Payload must be a top level object");
|
|
812
|
-
const
|
|
825
|
+
const J = M() + o;
|
|
813
826
|
if (h.exp !== void 0) {
|
|
814
827
|
if (typeof h.exp != "number")
|
|
815
828
|
throw new a('unexpected JWT "exp" (expiration time) claim type');
|
|
816
|
-
if (h.exp <=
|
|
829
|
+
if (h.exp <= J - s)
|
|
817
830
|
throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
818
831
|
}
|
|
819
832
|
if (h.iat !== void 0 && typeof h.iat != "number")
|
|
@@ -823,14 +836,14 @@ async function Lt(t, e, r, o, s) {
|
|
|
823
836
|
if (h.nbf !== void 0) {
|
|
824
837
|
if (typeof h.nbf != "number")
|
|
825
838
|
throw new a('unexpected JWT "nbf" (not before) claim type');
|
|
826
|
-
if (h.nbf >
|
|
839
|
+
if (h.nbf > J + s)
|
|
827
840
|
throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
828
841
|
}
|
|
829
842
|
if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
|
|
830
843
|
throw new a('unexpected JWT "aud" (audience) claim type');
|
|
831
|
-
return { header:
|
|
844
|
+
return { header: f, claims: h, signature: y, key: T, jwt: t };
|
|
832
845
|
}
|
|
833
|
-
function
|
|
846
|
+
function zt(t, e, r) {
|
|
834
847
|
if (t !== void 0) {
|
|
835
848
|
if (r.alg !== t)
|
|
836
849
|
throw new a('unexpected JWT "alg" header parameter');
|
|
@@ -844,83 +857,83 @@ function Ct(t, e, r) {
|
|
|
844
857
|
if (r.alg !== "RS256")
|
|
845
858
|
throw new a('unexpected JWT "alg" header parameter');
|
|
846
859
|
}
|
|
847
|
-
function
|
|
860
|
+
function k(t, e) {
|
|
848
861
|
const { 0: r, length: o } = t.getAll(e);
|
|
849
862
|
if (o > 1)
|
|
850
863
|
throw new a(`"${e}" parameter must be provided only once`);
|
|
851
864
|
return r;
|
|
852
865
|
}
|
|
853
|
-
const
|
|
854
|
-
function
|
|
855
|
-
if (
|
|
866
|
+
const Nt = Symbol(), Dt = Symbol();
|
|
867
|
+
function Kt(t, e, r, o) {
|
|
868
|
+
if (I(t), j(e), r instanceof URL && (r = r.searchParams), !(r instanceof URLSearchParams))
|
|
856
869
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
857
|
-
if (
|
|
870
|
+
if (k(r, "response"))
|
|
858
871
|
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
859
|
-
const s =
|
|
872
|
+
const s = k(r, "iss"), n = k(r, "state");
|
|
860
873
|
if (!s && t.authorization_response_iss_parameter_supported)
|
|
861
874
|
throw new a('response parameter "iss" (issuer) missing');
|
|
862
875
|
if (s && s !== t.issuer)
|
|
863
876
|
throw new a('unexpected "iss" (issuer) response parameter value');
|
|
864
877
|
switch (o) {
|
|
865
878
|
case void 0:
|
|
866
|
-
case
|
|
879
|
+
case Dt:
|
|
867
880
|
if (n !== void 0)
|
|
868
881
|
throw new a('unexpected "state" response parameter encountered');
|
|
869
882
|
break;
|
|
870
|
-
case
|
|
883
|
+
case Nt:
|
|
871
884
|
break;
|
|
872
885
|
default:
|
|
873
|
-
if (!
|
|
886
|
+
if (!w(o))
|
|
874
887
|
throw new a('"expectedState" must be a non-empty string');
|
|
875
888
|
if (n === void 0)
|
|
876
889
|
throw new a('response parameter "state" missing');
|
|
877
890
|
if (n !== o)
|
|
878
891
|
throw new a('unexpected "state" response parameter value');
|
|
879
892
|
}
|
|
880
|
-
const i =
|
|
893
|
+
const i = k(r, "error");
|
|
881
894
|
if (i)
|
|
882
895
|
return {
|
|
883
896
|
error: i,
|
|
884
|
-
error_description:
|
|
885
|
-
error_uri:
|
|
897
|
+
error_description: k(r, "error_description"),
|
|
898
|
+
error_uri: k(r, "error_uri")
|
|
886
899
|
};
|
|
887
|
-
const
|
|
888
|
-
if (
|
|
889
|
-
throw new
|
|
890
|
-
return
|
|
900
|
+
const c = k(r, "id_token"), p = k(r, "token");
|
|
901
|
+
if (c !== void 0 || p !== void 0)
|
|
902
|
+
throw new v("implicit and hybrid flows are not supported");
|
|
903
|
+
return Rt(new URLSearchParams(r));
|
|
891
904
|
}
|
|
892
|
-
function
|
|
905
|
+
function Wt({
|
|
893
906
|
handleCallback: t
|
|
894
907
|
}) {
|
|
895
|
-
const [e, r] =
|
|
896
|
-
return
|
|
908
|
+
const [e, r] = Ne(null), o = Me(), s = De(!1);
|
|
909
|
+
return Ke(() => {
|
|
897
910
|
s.current || (s.current = !0, t().then((n) => {
|
|
898
911
|
o(n);
|
|
899
912
|
}).catch((n) => {
|
|
900
913
|
K.error(n), r(n);
|
|
901
914
|
}));
|
|
902
|
-
}, [o, t]), e ? /* @__PURE__ */
|
|
903
|
-
|
|
915
|
+
}, [o, t]), e ? /* @__PURE__ */ A.jsx(
|
|
916
|
+
He,
|
|
904
917
|
{
|
|
905
918
|
category: "Error",
|
|
906
919
|
title: "Authentication Error",
|
|
907
|
-
message: /* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
920
|
+
message: /* @__PURE__ */ A.jsxs(A.Fragment, { children: [
|
|
921
|
+
/* @__PURE__ */ A.jsx(We, { className: "mb-4", children: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly." }),
|
|
909
922
|
"An error occurred while authorizing the user.",
|
|
910
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ A.jsx(Fe, { code: e.toString(), language: "plain" })
|
|
911
924
|
] })
|
|
912
925
|
}
|
|
913
|
-
) : /* @__PURE__ */
|
|
926
|
+
) : /* @__PURE__ */ A.jsx("div", { className: "grid h-full place-items-center", children: /* @__PURE__ */ A.jsx($e, {}) });
|
|
914
927
|
}
|
|
915
928
|
class U extends Error {
|
|
916
929
|
}
|
|
917
|
-
class
|
|
930
|
+
class he extends U {
|
|
918
931
|
constructor(e, r, o) {
|
|
919
932
|
super(e, o), this.error = r;
|
|
920
933
|
}
|
|
921
934
|
}
|
|
922
|
-
const
|
|
923
|
-
class
|
|
935
|
+
const G = "code-verifier";
|
|
936
|
+
class Ht extends ze {
|
|
924
937
|
constructor(e, r) {
|
|
925
938
|
super(), this.callbackUrlPath = e, this.handleCallback = r;
|
|
926
939
|
}
|
|
@@ -929,12 +942,12 @@ class Nt extends je {
|
|
|
929
942
|
...super.getRoutes(),
|
|
930
943
|
{
|
|
931
944
|
path: this.callbackUrlPath,
|
|
932
|
-
element: /* @__PURE__ */
|
|
945
|
+
element: /* @__PURE__ */ A.jsx(Wt, { handleCallback: this.handleCallback })
|
|
933
946
|
}
|
|
934
947
|
];
|
|
935
948
|
}
|
|
936
949
|
}
|
|
937
|
-
class
|
|
950
|
+
class $t {
|
|
938
951
|
constructor({
|
|
939
952
|
issuer: e,
|
|
940
953
|
audience: r,
|
|
@@ -954,7 +967,7 @@ class zt {
|
|
|
954
967
|
_(this, "redirectToAfterSignOut");
|
|
955
968
|
_(this, "audience");
|
|
956
969
|
_(this, "signOut", async () => {
|
|
957
|
-
|
|
970
|
+
N.setState({
|
|
958
971
|
isAuthenticated: !1,
|
|
959
972
|
isPending: !1,
|
|
960
973
|
profile: void 0
|
|
@@ -970,55 +983,55 @@ class zt {
|
|
|
970
983
|
)) : o = r;
|
|
971
984
|
});
|
|
972
985
|
_(this, "handleCallback", async () => {
|
|
973
|
-
const e = new URL(window.location.href), r = e.searchParams.get("state"), o = sessionStorage.getItem(
|
|
974
|
-
if (sessionStorage.removeItem(
|
|
986
|
+
const e = new URL(window.location.href), r = e.searchParams.get("state"), o = sessionStorage.getItem(G);
|
|
987
|
+
if (sessionStorage.removeItem(G), !o)
|
|
975
988
|
throw new U("No code verifier found in state.");
|
|
976
|
-
const s = await this.getAuthServer(), n =
|
|
989
|
+
const s = await this.getAuthServer(), n = Kt(
|
|
977
990
|
s,
|
|
978
991
|
this.client,
|
|
979
992
|
e.searchParams,
|
|
980
993
|
r ?? void 0
|
|
981
994
|
);
|
|
982
995
|
if (Z(n))
|
|
983
|
-
throw K.error("Error validating OAuth response", n), new
|
|
996
|
+
throw K.error("Error validating OAuth response", n), new he(
|
|
984
997
|
"Error validating OAuth response",
|
|
985
998
|
n
|
|
986
999
|
);
|
|
987
1000
|
const i = new URL(e);
|
|
988
1001
|
i.pathname = this.redirectToAfterSignIn, i.search = "";
|
|
989
|
-
const
|
|
1002
|
+
const c = await Pt(
|
|
990
1003
|
s,
|
|
991
1004
|
this.client,
|
|
992
1005
|
n,
|
|
993
1006
|
i.toString(),
|
|
994
1007
|
o
|
|
995
|
-
),
|
|
1008
|
+
), p = await Ct(
|
|
996
1009
|
s,
|
|
997
1010
|
this.client,
|
|
998
|
-
|
|
1011
|
+
c
|
|
999
1012
|
);
|
|
1000
|
-
this.setTokensFromResponse(
|
|
1001
|
-
const
|
|
1013
|
+
this.setTokensFromResponse(p);
|
|
1014
|
+
const b = await this.getAccessToken(), y = await (await bt(
|
|
1002
1015
|
s,
|
|
1003
1016
|
this.client,
|
|
1004
|
-
|
|
1005
|
-
)).json(),
|
|
1006
|
-
sub:
|
|
1007
|
-
email:
|
|
1008
|
-
name:
|
|
1009
|
-
emailVerified:
|
|
1010
|
-
pictureUrl:
|
|
1017
|
+
b
|
|
1018
|
+
)).json(), T = {
|
|
1019
|
+
sub: y.sub,
|
|
1020
|
+
email: y.email,
|
|
1021
|
+
name: y.name,
|
|
1022
|
+
emailVerified: y.email_verified ?? !1,
|
|
1023
|
+
pictureUrl: y.picture
|
|
1011
1024
|
};
|
|
1012
|
-
|
|
1025
|
+
N.setState({
|
|
1013
1026
|
isAuthenticated: !0,
|
|
1014
1027
|
isPending: !1,
|
|
1015
|
-
profile:
|
|
1028
|
+
profile: T
|
|
1016
1029
|
}), sessionStorage.setItem(
|
|
1017
1030
|
"profile-state",
|
|
1018
|
-
JSON.stringify(
|
|
1031
|
+
JSON.stringify(N.getState().profile)
|
|
1019
1032
|
);
|
|
1020
|
-
const
|
|
1021
|
-
return sessionStorage.removeItem("redirect-to"),
|
|
1033
|
+
const h = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1034
|
+
return sessionStorage.removeItem("redirect-to"), h;
|
|
1022
1035
|
});
|
|
1023
1036
|
this.client = {
|
|
1024
1037
|
client_id: o,
|
|
@@ -1027,8 +1040,8 @@ class zt {
|
|
|
1027
1040
|
}
|
|
1028
1041
|
async getAuthServer() {
|
|
1029
1042
|
if (!this.authorizationServer) {
|
|
1030
|
-
const e = new URL(this.issuer), r = await
|
|
1031
|
-
this.authorizationServer = await
|
|
1043
|
+
const e = new URL(this.issuer), r = await nt(e);
|
|
1044
|
+
this.authorizationServer = await ot(
|
|
1032
1045
|
e,
|
|
1033
1046
|
r
|
|
1034
1047
|
);
|
|
@@ -1041,7 +1054,7 @@ class zt {
|
|
|
1041
1054
|
*/
|
|
1042
1055
|
setTokensFromResponse(e) {
|
|
1043
1056
|
if (Z(e))
|
|
1044
|
-
throw K.error("Bad Token Response", e), new
|
|
1057
|
+
throw K.error("Bad Token Response", e), new he("Bad Token Response", e);
|
|
1045
1058
|
if (!e.expires_in)
|
|
1046
1059
|
throw new U("No expires_in in response");
|
|
1047
1060
|
const r = {
|
|
@@ -1067,28 +1080,28 @@ class zt {
|
|
|
1067
1080
|
redirectTo: e,
|
|
1068
1081
|
isSignUp: r = !1
|
|
1069
1082
|
}) {
|
|
1070
|
-
var
|
|
1083
|
+
var b, f;
|
|
1071
1084
|
const o = "S256", s = await this.getAuthServer();
|
|
1072
1085
|
if (!s.authorization_endpoint)
|
|
1073
1086
|
throw new U("No authorization endpoint");
|
|
1074
|
-
const n =
|
|
1075
|
-
sessionStorage.setItem(
|
|
1076
|
-
const
|
|
1087
|
+
const n = it(), i = await at(n);
|
|
1088
|
+
sessionStorage.setItem(G, n);
|
|
1089
|
+
const c = new URL(
|
|
1077
1090
|
s.authorization_endpoint
|
|
1078
1091
|
);
|
|
1079
1092
|
sessionStorage.setItem("redirect-to", e);
|
|
1080
|
-
const
|
|
1081
|
-
if (
|
|
1093
|
+
const p = new URL(window.location.origin);
|
|
1094
|
+
if (p.pathname = this.callbackUrlPath, p.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", p.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", "openid profile email"), c.searchParams.set("code_challenge", i), c.searchParams.set(
|
|
1082
1095
|
"code_challenge_method",
|
|
1083
1096
|
o
|
|
1084
|
-
), this.audience &&
|
|
1097
|
+
), this.audience && c.searchParams.set("audience", this.audience), (b = this.onAuthorizationUrl) == null || b.call(this, c, {
|
|
1085
1098
|
isSignIn: !r,
|
|
1086
1099
|
isSignUp: r
|
|
1087
|
-
}), ((
|
|
1088
|
-
const
|
|
1089
|
-
|
|
1100
|
+
}), ((f = s.code_challenge_methods_supported) == null ? void 0 : f.includes("S256")) !== !0) {
|
|
1101
|
+
const y = st();
|
|
1102
|
+
c.searchParams.set("state", y);
|
|
1090
1103
|
}
|
|
1091
|
-
location.href =
|
|
1104
|
+
location.href = c.href;
|
|
1092
1105
|
}
|
|
1093
1106
|
async getAccessToken() {
|
|
1094
1107
|
const e = await this.getAuthServer(), r = sessionStorage.getItem("token-state");
|
|
@@ -1098,11 +1111,11 @@ class zt {
|
|
|
1098
1111
|
if (o.expiresOn < /* @__PURE__ */ new Date()) {
|
|
1099
1112
|
if (!o.refreshToken)
|
|
1100
1113
|
return await this.signIn(), "";
|
|
1101
|
-
const s = await
|
|
1114
|
+
const s = await vt(
|
|
1102
1115
|
e,
|
|
1103
1116
|
this.client,
|
|
1104
1117
|
o.refreshToken
|
|
1105
|
-
), n = await
|
|
1118
|
+
), n = await kt(
|
|
1106
1119
|
e,
|
|
1107
1120
|
this.client,
|
|
1108
1121
|
s
|
|
@@ -1118,7 +1131,7 @@ class zt {
|
|
|
1118
1131
|
if (e)
|
|
1119
1132
|
try {
|
|
1120
1133
|
const r = JSON.parse(e);
|
|
1121
|
-
|
|
1134
|
+
N.setState({
|
|
1122
1135
|
isAuthenticated: !0,
|
|
1123
1136
|
isPending: !1,
|
|
1124
1137
|
profile: r
|
|
@@ -1128,12 +1141,12 @@ class zt {
|
|
|
1128
1141
|
}
|
|
1129
1142
|
}
|
|
1130
1143
|
getAuthenticationPlugin() {
|
|
1131
|
-
return new
|
|
1144
|
+
return new Ht(this.callbackUrlPath, this.handleCallback);
|
|
1132
1145
|
}
|
|
1133
1146
|
}
|
|
1134
|
-
const
|
|
1147
|
+
const tr = (t) => new $t(t);
|
|
1135
1148
|
export {
|
|
1136
|
-
|
|
1137
|
-
|
|
1149
|
+
$t as OpenIDAuthenticationProvider,
|
|
1150
|
+
tr as default
|
|
1138
1151
|
};
|
|
1139
1152
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|