zudoku 0.3.0-dev.58 → 0.3.0-dev.59
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/entry.client.js +1 -1
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +2 -0
- package/dist/app/entry.server.js +1 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +8 -2
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/validate.d.ts +121 -102
- package/dist/config/validators/validate.js +4 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/AuthenticationPlugin.d.ts +16 -0
- package/dist/lib/authentication/AuthenticationPlugin.js +31 -0
- package/dist/lib/authentication/AuthenticationPlugin.js.map +1 -0
- package/dist/lib/authentication/authentication.d.ts +3 -4
- package/dist/lib/authentication/components/Login.d.ts +1 -0
- package/dist/lib/authentication/components/Login.js +10 -0
- package/dist/lib/authentication/components/Login.js.map +1 -0
- package/dist/lib/authentication/components/Logout.d.ts +1 -0
- package/dist/lib/authentication/components/Logout.js +10 -0
- package/dist/lib/authentication/components/Logout.js.map +1 -0
- package/dist/lib/authentication/providers/clerk.js +43 -27
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +11 -3
- package/dist/lib/authentication/providers/openid.js +22 -11
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/authentication/routes.d.ts +5 -0
- package/dist/lib/authentication/routes.js +12 -0
- package/dist/lib/authentication/routes.js.map +1 -0
- package/dist/lib/components/Bootstrap.d.ts +2 -1
- package/dist/lib/components/Bootstrap.js +4 -1
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/DevPortal.js +14 -2
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Header.js +16 -3
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/InlineCode.js +1 -1
- package/dist/lib/components/InlineCode.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +1 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/DevPortalProvider.js +18 -1
- package/dist/lib/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/index.d.ts +5 -1
- package/dist/lib/components/index.js +4 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js +1 -1
- package/dist/lib/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +1 -1
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +10 -1
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +2 -2
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +2 -2
- package/dist/lib/plugins/api-keys/index.js +6 -0
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/custom-page/index.d.ts +8 -0
- package/dist/lib/plugins/custom-page/index.js +12 -0
- package/dist/lib/plugins/custom-page/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.js +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js +1 -1
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js +1 -1
- package/dist/lib/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/lib/plugins/openapi/SchemaListViewItem.js +3 -3
- package/dist/lib/plugins/openapi/SchemaListViewItem.js.map +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -1
- package/dist/lib/plugins/openapi/StaggeredRender.d.ts +3 -0
- package/dist/lib/plugins/openapi/StaggeredRender.js +10 -5
- package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +2 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/ui/Card.js +1 -1
- package/dist/lib/ui/Card.js.map +1 -1
- package/dist/lib/ui/DropdownMenu.d.ts +27 -0
- package/dist/lib/ui/DropdownMenu.js +36 -0
- package/dist/lib/ui/DropdownMenu.js.map +1 -0
- package/dist/lib/ui/button-variants.d.ts +2 -2
- package/dist/lib/ui/button-variants.js +1 -0
- package/dist/lib/ui/button-variants.js.map +1 -1
- package/dist/lib/util/MdxComponents.js +1 -1
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinPath.js +2 -1
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/vite/build.js +5 -2
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +8 -1
- package/dist/vite/config.js +13 -6
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -0
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/prerender.d.ts +1 -1
- package/dist/vite/prerender.js +23 -3
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{AnchorLink-B4IgsA83.js → AnchorLink-Bj1hwDuD.js} +3 -3
- package/lib/{AnchorLink-B4IgsA83.js.map → AnchorLink-Bj1hwDuD.js.map} +1 -1
- package/lib/AuthenticationPlugin-CG6Bw32B.js +46 -0
- package/lib/AuthenticationPlugin-CG6Bw32B.js.map +1 -0
- package/lib/CategoryHeading-DMkTmmBh.js +10 -0
- package/lib/CategoryHeading-DMkTmmBh.js.map +1 -0
- package/lib/Combination-lAFQBd6U.js +2774 -0
- package/lib/Combination-lAFQBd6U.js.map +1 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js +1125 -0
- package/lib/DevPortalProvider-BBhQ8kgI.js.map +1 -0
- package/lib/{Markdown-DQrAhTkw.js → Markdown-BjRJKl_E.js} +1376 -1379
- package/lib/Markdown-BjRJKl_E.js.map +1 -0
- package/lib/{MdxPage-DMP-pM_g.js → MdxPage-DJTFOCbZ.js} +17 -17
- package/lib/{MdxPage-DMP-pM_g.js.map → MdxPage-DJTFOCbZ.js.map} +1 -1
- package/lib/OperationList-DDTtK3I7.js +5403 -0
- package/lib/OperationList-DDTtK3I7.js.map +1 -0
- package/lib/{Route-C1LyvITr.js → Route-Bsrd0acQ.js} +2 -2
- package/lib/{Route-C1LyvITr.js.map → Route-Bsrd0acQ.js.map} +1 -1
- package/lib/Select-CEnkyfyn.js +2223 -0
- package/lib/Select-CEnkyfyn.js.map +1 -0
- package/lib/Spinner-Ciq_pWU7.js +359 -0
- package/lib/Spinner-Ciq_pWU7.js.map +1 -0
- package/lib/{hook-CrQMC_eg.js → hook-Q_gAL2NZ.js} +20 -19
- package/lib/{hook-CrQMC_eg.js.map → hook-Q_gAL2NZ.js.map} +1 -1
- package/lib/{index-tOwoT-uJ.js → index-BE2a6gGC.js} +24 -23
- package/lib/{index-tOwoT-uJ.js.map → index-BE2a6gGC.js.map} +1 -1
- package/lib/{jsx-runtime-CJZJivg2.js → jsx-runtime-BIr0WBt_.js} +119 -119
- package/lib/jsx-runtime-BIr0WBt_.js.map +1 -0
- package/lib/{router-CBw2vqJE.js → router-BiRCp01d.js} +671 -673
- package/lib/router-BiRCp01d.js.map +1 -0
- package/lib/zudoku.auth-clerk.js +47 -32
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +170 -159
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +1494 -591
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +31 -25
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-page.js +13 -0
- package/lib/zudoku.plugin-custom-page.js.map +1 -0
- package/lib/zudoku.plugin-markdown.js +19 -20
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-redirect.js +3 -3
- package/package.json +29 -14
- package/src/app/entry.client.tsx +1 -1
- package/src/app/entry.server.tsx +2 -0
- package/src/app/main.css +6 -0
- package/src/app/main.tsx +8 -2
- package/src/lib/authentication/AuthenticationPlugin.tsx +36 -0
- package/src/lib/authentication/authentication.ts +3 -4
- package/src/lib/authentication/components/Login.tsx +11 -0
- package/src/lib/authentication/components/Logout.tsx +11 -0
- package/src/lib/authentication/providers/clerk.tsx +43 -27
- package/src/lib/authentication/providers/openid.tsx +25 -13
- package/src/lib/authentication/routes.tsx +10 -0
- package/src/lib/components/Bootstrap.tsx +14 -7
- package/src/lib/components/DevPortal.tsx +29 -9
- package/src/lib/components/Header.tsx +63 -24
- package/src/lib/components/InlineCode.tsx +1 -1
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/context/DevPortalProvider.ts +22 -2
- package/src/lib/components/index.ts +4 -0
- package/src/lib/components/navigation/SideNavigationItem.tsx +1 -1
- package/src/lib/core/DevPortalContext.ts +1 -1
- package/src/lib/core/plugins.ts +16 -0
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +1 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +4 -4
- package/src/lib/plugins/api-keys/index.tsx +8 -1
- package/src/lib/plugins/custom-page/index.tsx +22 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -2
- package/src/lib/plugins/openapi/OperationListItem.tsx +1 -4
- package/src/lib/plugins/openapi/ParameterList.tsx +1 -1
- package/src/lib/plugins/openapi/SchemaListViewItem.tsx +3 -3
- package/src/lib/plugins/openapi/SidecarBox.tsx +1 -1
- package/src/lib/plugins/openapi/StaggeredRender.tsx +19 -5
- package/src/lib/plugins/openapi/playground/Playground.tsx +2 -2
- package/src/lib/ui/Card.tsx +1 -1
- package/src/lib/ui/DropdownMenu.tsx +199 -0
- package/src/lib/ui/button-variants.ts +1 -0
- package/src/lib/util/MdxComponents.tsx +1 -1
- package/src/lib/util/joinPath.tsx +2 -1
- package/dist/app/zudoku-manifest.d.ts +0 -1
- package/dist/app/zudoku-manifest.js +0 -20
- package/dist/app/zudoku-manifest.js.map +0 -1
- package/lib/Button-CnuhSW99.js +0 -4571
- package/lib/Button-CnuhSW99.js.map +0 -1
- package/lib/DevPortalProvider-Do9oJqme.js +0 -1081
- package/lib/DevPortalProvider-Do9oJqme.js.map +0 -1
- package/lib/Markdown-DQrAhTkw.js.map +0 -1
- package/lib/OperationList-Dw2SadHL.js +0 -5578
- package/lib/OperationList-Dw2SadHL.js.map +0 -1
- package/lib/Spinner-BuBOzK_8.js +0 -182
- package/lib/Spinner-BuBOzK_8.js.map +0 -1
- package/lib/index-gsAuUwQh.js +0 -418
- package/lib/index-gsAuUwQh.js.map +0 -1
- package/lib/jsx-runtime-CJZJivg2.js.map +0 -1
- package/lib/router-CBw2vqJE.js.map +0 -1
- package/lib/util-_jwUlTBU.js +0 -41
- package/lib/util-_jwUlTBU.js.map +0 -1
- package/src/app/zudoku-manifest.ts +0 -22
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
var Re = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var S = (e, t, n) =>
|
|
4
|
-
import {
|
|
2
|
+
var Pe = (e, t, n) => t in e ? Re(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var S = (e, t, n) => Pe(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import { b as xe, j as T } from "./jsx-runtime-BIr0WBt_.js";
|
|
5
5
|
import { c as Le, a as Ue } from "./_commonjsHelpers-BVfed4GL.js";
|
|
6
|
-
import {
|
|
6
|
+
import { A as Ce } from "./AuthenticationPlugin-CG6Bw32B.js";
|
|
7
|
+
import { useRef as je, useState as Je, useEffect as ze } from "react";
|
|
7
8
|
import { u as re } from "./state-DKdaQzvh.js";
|
|
8
9
|
var he = { exports: {} };
|
|
9
10
|
(function(e) {
|
|
@@ -36,7 +37,7 @@ var he = { exports: {} };
|
|
|
36
37
|
function m(u) {
|
|
37
38
|
return u === "debug" && (u = "log"), typeof console === n ? !1 : u === "trace" && o ? g : console[u] !== void 0 ? d(console, u) : console.log !== void 0 ? d(console, "log") : t;
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function b() {
|
|
40
41
|
for (var u = this.getLevel(), f = 0; f < s.length; f++) {
|
|
41
42
|
var c = s[f];
|
|
42
43
|
this[c] = f < u ? t : this.methodFactory(c, u, this.name);
|
|
@@ -46,39 +47,39 @@ var he = { exports: {} };
|
|
|
46
47
|
}
|
|
47
48
|
function y(u) {
|
|
48
49
|
return function() {
|
|
49
|
-
typeof console !== n && (
|
|
50
|
+
typeof console !== n && (b.call(this), this[u].apply(this, arguments));
|
|
50
51
|
};
|
|
51
52
|
}
|
|
52
53
|
function h(u, f, c) {
|
|
53
54
|
return m(u) || y.apply(this, arguments);
|
|
54
55
|
}
|
|
55
56
|
function L(u, f) {
|
|
56
|
-
var c = this,
|
|
57
|
-
typeof u == "string" ?
|
|
58
|
-
function
|
|
57
|
+
var c = this, z, $, P, _ = "loglevel";
|
|
58
|
+
typeof u == "string" ? _ += ":" + u : typeof u == "symbol" && (_ = void 0);
|
|
59
|
+
function Ee(l) {
|
|
59
60
|
var p = (s[l] || "silent").toUpperCase();
|
|
60
|
-
if (!(typeof window === n || !
|
|
61
|
+
if (!(typeof window === n || !_)) {
|
|
61
62
|
try {
|
|
62
|
-
window.localStorage[
|
|
63
|
+
window.localStorage[_] = p;
|
|
63
64
|
return;
|
|
64
65
|
} catch {
|
|
65
66
|
}
|
|
66
67
|
try {
|
|
67
|
-
window.document.cookie = encodeURIComponent(
|
|
68
|
+
window.document.cookie = encodeURIComponent(_) + "=" + p + ";";
|
|
68
69
|
} catch {
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
function ee() {
|
|
73
74
|
var l;
|
|
74
|
-
if (!(typeof window === n || !
|
|
75
|
+
if (!(typeof window === n || !_)) {
|
|
75
76
|
try {
|
|
76
|
-
l = window.localStorage[
|
|
77
|
+
l = window.localStorage[_];
|
|
77
78
|
} catch {
|
|
78
79
|
}
|
|
79
80
|
if (typeof l === n)
|
|
80
81
|
try {
|
|
81
|
-
var p = window.document.cookie, O = encodeURIComponent(
|
|
82
|
+
var p = window.document.cookie, O = encodeURIComponent(_), ne = p.indexOf(O + "=");
|
|
82
83
|
ne !== -1 && (l = /^([^;]+)/.exec(
|
|
83
84
|
p.slice(ne + O.length + 1)
|
|
84
85
|
)[1]);
|
|
@@ -88,13 +89,13 @@ var he = { exports: {} };
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
function Te() {
|
|
91
|
-
if (!(typeof window === n || !
|
|
92
|
+
if (!(typeof window === n || !_)) {
|
|
92
93
|
try {
|
|
93
|
-
window.localStorage.removeItem(
|
|
94
|
+
window.localStorage.removeItem(_);
|
|
94
95
|
} catch {
|
|
95
96
|
}
|
|
96
97
|
try {
|
|
97
|
-
window.document.cookie = encodeURIComponent(
|
|
98
|
+
window.document.cookie = encodeURIComponent(_) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC";
|
|
98
99
|
} catch {
|
|
99
100
|
}
|
|
100
101
|
}
|
|
@@ -113,26 +114,26 @@ var he = { exports: {} };
|
|
|
113
114
|
ERROR: 4,
|
|
114
115
|
SILENT: 5
|
|
115
116
|
}, c.methodFactory = f || h, c.getLevel = function() {
|
|
116
|
-
return
|
|
117
|
+
return P ?? $ ?? z;
|
|
117
118
|
}, c.setLevel = function(l, p) {
|
|
118
|
-
return
|
|
119
|
+
return P = U(l), p !== !1 && Ee(P), b.call(c);
|
|
119
120
|
}, c.setDefaultLevel = function(l) {
|
|
120
121
|
$ = U(l), ee() || c.setLevel(l, !1);
|
|
121
122
|
}, c.resetLevel = function() {
|
|
122
|
-
|
|
123
|
+
P = null, Te(), b.call(c);
|
|
123
124
|
}, c.enableAll = function(l) {
|
|
124
125
|
c.setLevel(c.levels.TRACE, l);
|
|
125
126
|
}, c.disableAll = function(l) {
|
|
126
127
|
c.setLevel(c.levels.SILENT, l);
|
|
127
128
|
}, c.rebuild = function() {
|
|
128
|
-
if (i !== c && (
|
|
129
|
+
if (i !== c && (z = U(i.getLevel())), b.call(c), i === c)
|
|
129
130
|
for (var l in r)
|
|
130
131
|
r[l].rebuild();
|
|
131
|
-
},
|
|
132
|
+
}, z = U(
|
|
132
133
|
i ? i.getLevel() : "WARN"
|
|
133
134
|
);
|
|
134
135
|
var te = ee();
|
|
135
|
-
te != null && (
|
|
136
|
+
te != null && (P = U(te)), b.call(c);
|
|
136
137
|
}
|
|
137
138
|
i = new L(), i.getLogger = function(f) {
|
|
138
139
|
if (typeof f != "symbol" && typeof f != "string" || f === "")
|
|
@@ -151,8 +152,8 @@ var he = { exports: {} };
|
|
|
151
152
|
}, i.default = i, i;
|
|
152
153
|
});
|
|
153
154
|
})(he);
|
|
154
|
-
var
|
|
155
|
-
const oe = /* @__PURE__ */ Ue(
|
|
155
|
+
var Oe = he.exports;
|
|
156
|
+
const oe = /* @__PURE__ */ Ue(Oe);
|
|
156
157
|
let M;
|
|
157
158
|
var I, de;
|
|
158
159
|
(typeof navigator > "u" || !((de = (I = navigator.userAgent) == null ? void 0 : I.startsWith) != null && de.call(I, "Mozilla/5.0 "))) && (M = "oauth4webapi/v2.11.1");
|
|
@@ -165,19 +166,19 @@ function q(e, t) {
|
|
|
165
166
|
return !1;
|
|
166
167
|
}
|
|
167
168
|
}
|
|
168
|
-
const K = Symbol(),
|
|
169
|
+
const K = Symbol(), Ie = Symbol(), V = Symbol(), Ne = new TextEncoder(), Ke = new TextDecoder();
|
|
169
170
|
function A(e) {
|
|
170
|
-
return typeof e == "string" ?
|
|
171
|
+
return typeof e == "string" ? Ne.encode(e) : Ke.decode(e);
|
|
171
172
|
}
|
|
172
173
|
const ie = 32768;
|
|
173
|
-
function
|
|
174
|
+
function We(e) {
|
|
174
175
|
e instanceof ArrayBuffer && (e = new Uint8Array(e));
|
|
175
176
|
const t = [];
|
|
176
177
|
for (let n = 0; n < e.byteLength; n += ie)
|
|
177
178
|
t.push(String.fromCharCode.apply(null, e.subarray(n, n + ie)));
|
|
178
179
|
return btoa(t.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function De(e) {
|
|
181
182
|
try {
|
|
182
183
|
const t = atob(e.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(t.length);
|
|
183
184
|
for (let o = 0; o < t.length; o++)
|
|
@@ -187,10 +188,10 @@ function We(e) {
|
|
|
187
188
|
throw new a("The input to be decoded is not correctly encoded.", { cause: t });
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
-
return typeof e == "string" ?
|
|
191
|
+
function E(e) {
|
|
192
|
+
return typeof e == "string" ? De(e) : We(e);
|
|
192
193
|
}
|
|
193
|
-
class
|
|
194
|
+
class He {
|
|
194
195
|
constructor(t) {
|
|
195
196
|
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = t;
|
|
196
197
|
}
|
|
@@ -220,20 +221,20 @@ class v extends Error {
|
|
|
220
221
|
super(t ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
|
|
221
222
|
}
|
|
222
223
|
}
|
|
223
|
-
class
|
|
224
|
+
class $e extends Error {
|
|
224
225
|
constructor(t, n) {
|
|
225
226
|
var o;
|
|
226
227
|
super(t, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
const a =
|
|
230
|
+
const a = $e, fe = new He(100);
|
|
230
231
|
function pe(e) {
|
|
231
232
|
return e instanceof CryptoKey;
|
|
232
233
|
}
|
|
233
234
|
function we(e) {
|
|
234
235
|
return pe(e) && e.type === "private";
|
|
235
236
|
}
|
|
236
|
-
function
|
|
237
|
+
function Fe(e) {
|
|
237
238
|
return pe(e) && e.type === "public";
|
|
238
239
|
}
|
|
239
240
|
function Y(e) {
|
|
@@ -261,7 +262,7 @@ function Z(e) {
|
|
|
261
262
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
262
263
|
return e;
|
|
263
264
|
}
|
|
264
|
-
async function
|
|
265
|
+
async function Me(e, t) {
|
|
265
266
|
if (!(e instanceof URL))
|
|
266
267
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
267
268
|
if (e.protocol !== "https:" && e.protocol !== "http:")
|
|
@@ -289,7 +290,7 @@ async function Fe(e, t) {
|
|
|
289
290
|
function w(e) {
|
|
290
291
|
return typeof e == "string" && e.length !== 0;
|
|
291
292
|
}
|
|
292
|
-
async function
|
|
293
|
+
async function Be(e, t) {
|
|
293
294
|
if (!(e instanceof URL))
|
|
294
295
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
295
296
|
if (!q(t, Response))
|
|
@@ -312,20 +313,20 @@ async function Me(e, t) {
|
|
|
312
313
|
return n;
|
|
313
314
|
}
|
|
314
315
|
function D() {
|
|
315
|
-
return
|
|
316
|
+
return E(crypto.getRandomValues(new Uint8Array(32)));
|
|
316
317
|
}
|
|
317
|
-
function
|
|
318
|
+
function Ge() {
|
|
318
319
|
return D();
|
|
319
320
|
}
|
|
320
|
-
function
|
|
321
|
+
function qe() {
|
|
321
322
|
return D();
|
|
322
323
|
}
|
|
323
|
-
async function
|
|
324
|
+
async function Ve(e) {
|
|
324
325
|
if (!w(e))
|
|
325
326
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
326
|
-
return
|
|
327
|
+
return E(await crypto.subtle.digest("SHA-256", A(e)));
|
|
327
328
|
}
|
|
328
|
-
function
|
|
329
|
+
function Ye(e) {
|
|
329
330
|
if (e instanceof CryptoKey)
|
|
330
331
|
return { key: e };
|
|
331
332
|
if (!((e == null ? void 0 : e.key) instanceof CryptoKey))
|
|
@@ -337,11 +338,11 @@ function Ve(e) {
|
|
|
337
338
|
function se(e) {
|
|
338
339
|
return encodeURIComponent(e).replace(/%20/g, "+");
|
|
339
340
|
}
|
|
340
|
-
function
|
|
341
|
+
function Ze(e, t) {
|
|
341
342
|
const n = se(e), o = se(t);
|
|
342
343
|
return `Basic ${btoa(`${n}:${o}`)}`;
|
|
343
344
|
}
|
|
344
|
-
function
|
|
345
|
+
function Qe(e) {
|
|
345
346
|
switch (e.algorithm.hash.name) {
|
|
346
347
|
case "SHA-256":
|
|
347
348
|
return "PS256";
|
|
@@ -353,7 +354,7 @@ function Ze(e) {
|
|
|
353
354
|
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
354
355
|
}
|
|
355
356
|
}
|
|
356
|
-
function
|
|
357
|
+
function Xe(e) {
|
|
357
358
|
switch (e.algorithm.hash.name) {
|
|
358
359
|
case "SHA-256":
|
|
359
360
|
return "RS256";
|
|
@@ -365,7 +366,7 @@ function Qe(e) {
|
|
|
365
366
|
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
366
367
|
}
|
|
367
368
|
}
|
|
368
|
-
function
|
|
369
|
+
function et(e) {
|
|
369
370
|
switch (e.algorithm.namedCurve) {
|
|
370
371
|
case "P-256":
|
|
371
372
|
return "ES256";
|
|
@@ -380,11 +381,11 @@ function Xe(e) {
|
|
|
380
381
|
function ge(e) {
|
|
381
382
|
switch (e.algorithm.name) {
|
|
382
383
|
case "RSA-PSS":
|
|
383
|
-
return Ze(e);
|
|
384
|
-
case "RSASSA-PKCS1-v1_5":
|
|
385
384
|
return Qe(e);
|
|
386
|
-
case "
|
|
385
|
+
case "RSASSA-PKCS1-v1_5":
|
|
387
386
|
return Xe(e);
|
|
387
|
+
case "ECDSA":
|
|
388
|
+
return et(e);
|
|
388
389
|
case "Ed25519":
|
|
389
390
|
case "Ed448":
|
|
390
391
|
return "EdDSA";
|
|
@@ -396,14 +397,14 @@ function H(e) {
|
|
|
396
397
|
const t = e == null ? void 0 : e[K];
|
|
397
398
|
return typeof t == "number" && Number.isFinite(t) ? t : 0;
|
|
398
399
|
}
|
|
399
|
-
function
|
|
400
|
-
const t = e == null ? void 0 : e[
|
|
400
|
+
function tt(e) {
|
|
401
|
+
const t = e == null ? void 0 : e[Ie];
|
|
401
402
|
return typeof t == "number" && Number.isFinite(t) && Math.sign(t) !== -1 ? t : 30;
|
|
402
403
|
}
|
|
403
404
|
function Q() {
|
|
404
405
|
return Math.floor(Date.now() / 1e3);
|
|
405
406
|
}
|
|
406
|
-
function
|
|
407
|
+
function nt(e, t) {
|
|
407
408
|
const n = Q() + H(t);
|
|
408
409
|
return {
|
|
409
410
|
jti: D(),
|
|
@@ -415,11 +416,11 @@ function tt(e, t) {
|
|
|
415
416
|
sub: t.client_id
|
|
416
417
|
};
|
|
417
418
|
}
|
|
418
|
-
async function
|
|
419
|
+
async function rt(e, t, n, o) {
|
|
419
420
|
return me({
|
|
420
421
|
alg: ge(n),
|
|
421
422
|
kid: o
|
|
422
|
-
},
|
|
423
|
+
}, nt(e, t), n);
|
|
423
424
|
}
|
|
424
425
|
function j(e) {
|
|
425
426
|
if (typeof e != "object" || e === null)
|
|
@@ -428,7 +429,7 @@ function j(e) {
|
|
|
428
429
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
429
430
|
return !0;
|
|
430
431
|
}
|
|
431
|
-
function
|
|
432
|
+
function J(e) {
|
|
432
433
|
if (typeof e != "object" || e === null)
|
|
433
434
|
throw new TypeError('"client" must be an object');
|
|
434
435
|
if (!w(e.client_id))
|
|
@@ -448,11 +449,11 @@ function ce(e, t) {
|
|
|
448
449
|
if (t !== void 0)
|
|
449
450
|
throw new TypeError(`"client.client_secret" property must not be provided when ${e} client authentication method is used.`);
|
|
450
451
|
}
|
|
451
|
-
async function
|
|
452
|
+
async function ot(e, t, n, o, s) {
|
|
452
453
|
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), t.token_endpoint_auth_method) {
|
|
453
454
|
case void 0:
|
|
454
455
|
case "client_secret_basic": {
|
|
455
|
-
F("client_secret_basic", s), o.set("authorization",
|
|
456
|
+
F("client_secret_basic", s), o.set("authorization", Ze(t.client_id, ae(t.client_secret)));
|
|
456
457
|
break;
|
|
457
458
|
}
|
|
458
459
|
case "client_secret_post": {
|
|
@@ -462,10 +463,10 @@ async function rt(e, t, n, o, s) {
|
|
|
462
463
|
case "private_key_jwt": {
|
|
463
464
|
if (ce("private_key_jwt", t.client_secret), s === void 0)
|
|
464
465
|
throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
465
|
-
const { key: r, kid: i } =
|
|
466
|
+
const { key: r, kid: i } = Ye(s);
|
|
466
467
|
if (!we(r))
|
|
467
468
|
throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
|
|
468
|
-
n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await
|
|
469
|
+
n.set("client_id", t.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await rt(e, t, r, i));
|
|
469
470
|
break;
|
|
470
471
|
}
|
|
471
472
|
case "tls_client_auth":
|
|
@@ -481,59 +482,59 @@ async function rt(e, t, n, o, s) {
|
|
|
481
482
|
async function me(e, t, n) {
|
|
482
483
|
if (!n.usages.includes("sign"))
|
|
483
484
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
484
|
-
const o = `${
|
|
485
|
+
const o = `${E(A(JSON.stringify(e)))}.${E(A(JSON.stringify(t)))}`, s = E(await crypto.subtle.sign(Se(n), n, A(o)));
|
|
485
486
|
return `${o}.${s}`;
|
|
486
487
|
}
|
|
487
|
-
async function
|
|
488
|
+
async function it(e, t, n, o, s, r) {
|
|
488
489
|
const { privateKey: i, publicKey: d, nonce: g = fe.get(n.origin) } = t;
|
|
489
490
|
if (!we(i))
|
|
490
491
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
491
|
-
if (
|
|
492
|
+
if (!Fe(d))
|
|
492
493
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
493
494
|
if (g !== void 0 && !w(g))
|
|
494
495
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
495
496
|
if (!d.extractable)
|
|
496
497
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
497
|
-
const m = Q() + s,
|
|
498
|
+
const m = Q() + s, b = await me({
|
|
498
499
|
alg: ge(i),
|
|
499
500
|
typ: "dpop+jwt",
|
|
500
|
-
jwk: await
|
|
501
|
+
jwk: await at(d)
|
|
501
502
|
}, {
|
|
502
503
|
iat: m,
|
|
503
504
|
jti: D(),
|
|
504
505
|
htm: o,
|
|
505
506
|
nonce: g,
|
|
506
507
|
htu: `${n.origin}${n.pathname}`,
|
|
507
|
-
ath: r ?
|
|
508
|
+
ath: r ? E(await crypto.subtle.digest("SHA-256", A(r))) : void 0
|
|
508
509
|
}, i);
|
|
509
|
-
e.set("dpop",
|
|
510
|
+
e.set("dpop", b);
|
|
510
511
|
}
|
|
511
512
|
let N;
|
|
512
|
-
async function
|
|
513
|
+
async function st(e) {
|
|
513
514
|
const { kty: t, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", e), d = { kty: t, e: n, n: o, x: s, y: r, crv: i };
|
|
514
515
|
return N.set(e, d), d;
|
|
515
516
|
}
|
|
516
|
-
async function
|
|
517
|
-
return N || (N = /* @__PURE__ */ new WeakMap()), N.get(e) ||
|
|
517
|
+
async function at(e) {
|
|
518
|
+
return N || (N = /* @__PURE__ */ new WeakMap()), N.get(e) || st(e);
|
|
518
519
|
}
|
|
519
|
-
function
|
|
520
|
+
function ct(e, t, n) {
|
|
520
521
|
if (typeof e != "string")
|
|
521
522
|
throw new TypeError(`"as.${t}" must be a string`);
|
|
522
523
|
return new URL(e);
|
|
523
524
|
}
|
|
524
525
|
function ye(e, t, n) {
|
|
525
|
-
return
|
|
526
|
+
return ct(e[t], t);
|
|
526
527
|
}
|
|
527
528
|
function B(e) {
|
|
528
529
|
const t = e;
|
|
529
530
|
return typeof t != "object" || Array.isArray(t) || t === null ? !1 : t.error !== void 0;
|
|
530
531
|
}
|
|
531
|
-
async function
|
|
532
|
+
async function ut(e, t, n, o, s, r) {
|
|
532
533
|
if (!w(e))
|
|
533
534
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
534
535
|
if (!(n instanceof URL))
|
|
535
536
|
throw new TypeError('"url" must be an instance of URL');
|
|
536
|
-
return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${e}`) : (await
|
|
537
|
+
return o = W(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${e}`) : (await it(o, r.DPoP, n, "GET", H({ [K]: r == null ? void 0 : r[K] }), e), o.set("authorization", `DPoP ${e}`)), ((r == null ? void 0 : r[V]) || fetch)(n.href, {
|
|
537
538
|
body: s,
|
|
538
539
|
headers: Object.fromEntries(o.entries()),
|
|
539
540
|
method: t,
|
|
@@ -541,16 +542,16 @@ async function ct(e, t, n, o, s, r) {
|
|
|
541
542
|
signal: r != null && r.signal ? Z(r.signal) : null
|
|
542
543
|
}).then(Y);
|
|
543
544
|
}
|
|
544
|
-
async function
|
|
545
|
-
j(e),
|
|
545
|
+
async function lt(e, t, n, o) {
|
|
546
|
+
j(e), J(t);
|
|
546
547
|
const s = ye(e, "userinfo_endpoint"), r = W(o == null ? void 0 : o.headers);
|
|
547
|
-
return t.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")),
|
|
548
|
+
return t.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), ut(n, "GET", s, r, null, {
|
|
548
549
|
...o,
|
|
549
550
|
[K]: H(t)
|
|
550
551
|
});
|
|
551
552
|
}
|
|
552
|
-
async function
|
|
553
|
-
return await
|
|
553
|
+
async function dt(e, t, n, o, s, r, i) {
|
|
554
|
+
return await ot(e, t, s, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[V]) || fetch)(o.href, {
|
|
554
555
|
body: s,
|
|
555
556
|
headers: Object.fromEntries(r.entries()),
|
|
556
557
|
method: n,
|
|
@@ -558,25 +559,25 @@ async function lt(e, t, n, o, s, r, i) {
|
|
|
558
559
|
signal: i != null && i.signal ? Z(i.signal) : null
|
|
559
560
|
}).then(Y);
|
|
560
561
|
}
|
|
561
|
-
async function
|
|
562
|
+
async function be(e, t, n, o, s) {
|
|
562
563
|
const r = ye(e, "token_endpoint");
|
|
563
564
|
o.set("grant_type", n);
|
|
564
565
|
const i = W(s == null ? void 0 : s.headers);
|
|
565
|
-
return i.set("accept", "application/json"),
|
|
566
|
+
return i.set("accept", "application/json"), dt(e, t, "POST", r, o, i, s);
|
|
566
567
|
}
|
|
567
|
-
async function
|
|
568
|
-
if (j(e),
|
|
568
|
+
async function ht(e, t, n, o) {
|
|
569
|
+
if (j(e), J(t), !w(n))
|
|
569
570
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
570
571
|
const s = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
571
|
-
return s.set("refresh_token", n),
|
|
572
|
+
return s.set("refresh_token", n), be(e, t, "refresh_token", s, o);
|
|
572
573
|
}
|
|
573
|
-
const
|
|
574
|
-
async function
|
|
575
|
-
if (j(e),
|
|
574
|
+
const ft = /* @__PURE__ */ new WeakMap();
|
|
575
|
+
async function _e(e, t, n, o = !1, s = !1) {
|
|
576
|
+
if (j(e), J(t), !q(n, Response))
|
|
576
577
|
throw new TypeError('"response" must be an instance of Response');
|
|
577
578
|
if (n.status !== 200) {
|
|
578
579
|
let i;
|
|
579
|
-
if (i = await
|
|
580
|
+
if (i = await St(n))
|
|
580
581
|
return i;
|
|
581
582
|
throw new a('"response" is not a conform Token Endpoint response');
|
|
582
583
|
}
|
|
@@ -605,20 +606,20 @@ async function be(e, t, n, o = !1, s = !1) {
|
|
|
605
606
|
if (r.id_token !== void 0 && !w(r.id_token))
|
|
606
607
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
607
608
|
if (r.id_token) {
|
|
608
|
-
const { claims: i } = await Et(r.id_token,
|
|
609
|
+
const { claims: i } = await Et(r.id_token, Tt.bind(void 0, t.id_token_signed_response_alg, e.id_token_signing_alg_values_supported), ke, H(t), tt(t)).then(_t.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(gt.bind(void 0, e.issuer)).then(wt.bind(void 0, t.client_id));
|
|
609
610
|
if (Array.isArray(i.aud) && i.aud.length !== 1 && i.azp !== t.client_id)
|
|
610
611
|
throw new a('unexpected ID Token "azp" (authorized party) claim value');
|
|
611
612
|
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
612
613
|
throw new a('ID Token "auth_time" (authentication time) must be a positive number');
|
|
613
|
-
|
|
614
|
+
ft.set(r, i);
|
|
614
615
|
}
|
|
615
616
|
}
|
|
616
617
|
return r;
|
|
617
618
|
}
|
|
618
|
-
async function
|
|
619
|
-
return
|
|
619
|
+
async function pt(e, t, n) {
|
|
620
|
+
return _e(e, t, n);
|
|
620
621
|
}
|
|
621
|
-
function
|
|
622
|
+
function wt(e, t) {
|
|
622
623
|
if (Array.isArray(t.claims.aud)) {
|
|
623
624
|
if (!t.claims.aud.includes(e))
|
|
624
625
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
@@ -626,29 +627,29 @@ function pt(e, t) {
|
|
|
626
627
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
627
628
|
return t;
|
|
628
629
|
}
|
|
629
|
-
function
|
|
630
|
+
function gt(e, t) {
|
|
630
631
|
if (t.claims.iss !== e)
|
|
631
632
|
throw new a('unexpected JWT "iss" (issuer) claim value');
|
|
632
633
|
return t;
|
|
633
634
|
}
|
|
634
635
|
const ve = /* @__PURE__ */ new WeakSet();
|
|
635
|
-
function
|
|
636
|
+
function mt(e) {
|
|
636
637
|
return ve.add(e), e;
|
|
637
638
|
}
|
|
638
|
-
async function
|
|
639
|
-
if (j(e),
|
|
639
|
+
async function yt(e, t, n, o, s, r) {
|
|
640
|
+
if (j(e), J(t), !ve.has(n))
|
|
640
641
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
641
642
|
if (!w(o))
|
|
642
643
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
643
644
|
if (!w(s))
|
|
644
645
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
645
|
-
const i =
|
|
646
|
+
const i = k(n, "code");
|
|
646
647
|
if (!i)
|
|
647
648
|
throw new a('no authorization code in "callbackParameters"');
|
|
648
649
|
const d = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
|
|
649
|
-
return d.set("redirect_uri", o), d.set("code_verifier", s), d.set("code", i),
|
|
650
|
+
return d.set("redirect_uri", o), d.set("code_verifier", s), d.set("code", i), be(e, t, "authorization_code", d, r);
|
|
650
651
|
}
|
|
651
|
-
const
|
|
652
|
+
const bt = {
|
|
652
653
|
aud: "audience",
|
|
653
654
|
c_hash: "code hash",
|
|
654
655
|
client_id: "client id",
|
|
@@ -667,11 +668,11 @@ const yt = {
|
|
|
667
668
|
function _t(e, t) {
|
|
668
669
|
for (const n of e)
|
|
669
670
|
if (t.claims[n] === void 0)
|
|
670
|
-
throw new a(`JWT "${n}" (${
|
|
671
|
+
throw new a(`JWT "${n}" (${bt[n]}) claim missing`);
|
|
671
672
|
return t;
|
|
672
673
|
}
|
|
673
|
-
async function
|
|
674
|
-
const o = await
|
|
674
|
+
async function vt(e, t, n) {
|
|
675
|
+
const o = await _e(e, t, n, !0);
|
|
675
676
|
if (B(o))
|
|
676
677
|
return o;
|
|
677
678
|
if (o.id_token !== void 0) {
|
|
@@ -685,7 +686,7 @@ function X(e) {
|
|
|
685
686
|
if (e.bodyUsed)
|
|
686
687
|
throw new TypeError('"response" body has been used already');
|
|
687
688
|
}
|
|
688
|
-
async function
|
|
689
|
+
async function St(e) {
|
|
689
690
|
if (e.status > 399 && e.status < 500) {
|
|
690
691
|
X(e);
|
|
691
692
|
try {
|
|
@@ -700,7 +701,7 @@ function ue(e) {
|
|
|
700
701
|
if (typeof e.modulusLength != "number" || e.modulusLength < 2048)
|
|
701
702
|
throw new a(`${e.name} modulusLength must be at least 2048 bits`);
|
|
702
703
|
}
|
|
703
|
-
function
|
|
704
|
+
function kt(e) {
|
|
704
705
|
switch (e) {
|
|
705
706
|
case "P-256":
|
|
706
707
|
return "SHA-256";
|
|
@@ -717,7 +718,7 @@ function Se(e) {
|
|
|
717
718
|
case "ECDSA":
|
|
718
719
|
return {
|
|
719
720
|
name: e.algorithm.name,
|
|
720
|
-
hash:
|
|
721
|
+
hash: kt(e.algorithm.namedCurve)
|
|
721
722
|
};
|
|
722
723
|
case "RSA-PSS":
|
|
723
724
|
switch (ue(e.algorithm), e.algorithm.hash.name) {
|
|
@@ -739,7 +740,7 @@ function Se(e) {
|
|
|
739
740
|
}
|
|
740
741
|
throw new v();
|
|
741
742
|
}
|
|
742
|
-
const
|
|
743
|
+
const ke = Symbol();
|
|
743
744
|
async function Et(e, t, n, o, s) {
|
|
744
745
|
const { 0: r, 1: i, 2: d, length: g } = e.split(".");
|
|
745
746
|
if (g === 5)
|
|
@@ -748,7 +749,7 @@ async function Et(e, t, n, o, s) {
|
|
|
748
749
|
throw new a("Invalid JWT");
|
|
749
750
|
let m;
|
|
750
751
|
try {
|
|
751
|
-
m = JSON.parse(A(
|
|
752
|
+
m = JSON.parse(A(E(r)));
|
|
752
753
|
} catch (R) {
|
|
753
754
|
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: R });
|
|
754
755
|
}
|
|
@@ -756,17 +757,17 @@ async function Et(e, t, n, o, s) {
|
|
|
756
757
|
throw new a("JWT Header must be a top level object");
|
|
757
758
|
if (t(m), m.crit !== void 0)
|
|
758
759
|
throw new a('unexpected JWT "crit" header parameter');
|
|
759
|
-
const
|
|
760
|
+
const b = E(d);
|
|
760
761
|
let y;
|
|
761
|
-
if (n !==
|
|
762
|
+
if (n !== ke) {
|
|
762
763
|
y = await n(m);
|
|
763
764
|
const R = `${r}.${i}`;
|
|
764
|
-
if (!await crypto.subtle.verify(Se(y), y,
|
|
765
|
+
if (!await crypto.subtle.verify(Se(y), y, b, A(R)))
|
|
765
766
|
throw new a("JWT signature verification failed");
|
|
766
767
|
}
|
|
767
768
|
let h;
|
|
768
769
|
try {
|
|
769
|
-
h = JSON.parse(A(
|
|
770
|
+
h = JSON.parse(A(E(i)));
|
|
770
771
|
} catch (R) {
|
|
771
772
|
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: R });
|
|
772
773
|
}
|
|
@@ -791,9 +792,9 @@ async function Et(e, t, n, o, s) {
|
|
|
791
792
|
}
|
|
792
793
|
if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
|
|
793
794
|
throw new a('unexpected JWT "aud" (audience) claim type');
|
|
794
|
-
return { header: m, claims: h, signature:
|
|
795
|
+
return { header: m, claims: h, signature: b, key: y };
|
|
795
796
|
}
|
|
796
|
-
function
|
|
797
|
+
function Tt(e, t, n) {
|
|
797
798
|
if (e !== void 0) {
|
|
798
799
|
if (n.alg !== e)
|
|
799
800
|
throw new a('unexpected JWT "alg" header parameter');
|
|
@@ -807,30 +808,30 @@ function kt(e, t, n) {
|
|
|
807
808
|
if (n.alg !== "RS256")
|
|
808
809
|
throw new a('unexpected JWT "alg" header parameter');
|
|
809
810
|
}
|
|
810
|
-
function
|
|
811
|
+
function k(e, t) {
|
|
811
812
|
const { 0: n, length: o } = e.getAll(t);
|
|
812
813
|
if (o > 1)
|
|
813
814
|
throw new a(`"${t}" parameter must be provided only once`);
|
|
814
815
|
return n;
|
|
815
816
|
}
|
|
816
|
-
const
|
|
817
|
-
function
|
|
818
|
-
if (j(e),
|
|
817
|
+
const At = Symbol(), Rt = Symbol();
|
|
818
|
+
function Pt(e, t, n, o) {
|
|
819
|
+
if (j(e), J(t), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
819
820
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
820
|
-
if (
|
|
821
|
+
if (k(n, "response"))
|
|
821
822
|
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
822
|
-
const s =
|
|
823
|
+
const s = k(n, "iss"), r = k(n, "state");
|
|
823
824
|
if (!s && e.authorization_response_iss_parameter_supported)
|
|
824
825
|
throw new a('response parameter "iss" (issuer) missing');
|
|
825
826
|
if (s && s !== e.issuer)
|
|
826
827
|
throw new a('unexpected "iss" (issuer) response parameter value');
|
|
827
828
|
switch (o) {
|
|
828
829
|
case void 0:
|
|
829
|
-
case
|
|
830
|
+
case Rt:
|
|
830
831
|
if (r !== void 0)
|
|
831
832
|
throw new a('unexpected "state" response parameter encountered');
|
|
832
833
|
break;
|
|
833
|
-
case
|
|
834
|
+
case At:
|
|
834
835
|
break;
|
|
835
836
|
default:
|
|
836
837
|
if (!w(o))
|
|
@@ -840,21 +841,21 @@ function Rt(e, t, n, o) {
|
|
|
840
841
|
if (r !== o)
|
|
841
842
|
throw new a('unexpected "state" response parameter value');
|
|
842
843
|
}
|
|
843
|
-
const i =
|
|
844
|
+
const i = k(n, "error");
|
|
844
845
|
if (i)
|
|
845
846
|
return {
|
|
846
847
|
error: i,
|
|
847
|
-
error_description:
|
|
848
|
-
error_uri:
|
|
848
|
+
error_description: k(n, "error_description"),
|
|
849
|
+
error_uri: k(n, "error_uri")
|
|
849
850
|
};
|
|
850
|
-
const d =
|
|
851
|
+
const d = k(n, "id_token"), g = k(n, "token");
|
|
851
852
|
if (d !== void 0 || g !== void 0)
|
|
852
853
|
throw new v("implicit and hybrid flows are not supported");
|
|
853
|
-
return
|
|
854
|
+
return mt(new URLSearchParams(n));
|
|
854
855
|
}
|
|
855
|
-
class
|
|
856
|
+
class x extends Error {
|
|
856
857
|
}
|
|
857
|
-
class G extends
|
|
858
|
+
class G extends x {
|
|
858
859
|
constructor(t, n, o) {
|
|
859
860
|
super(t, o), this.error = n;
|
|
860
861
|
}
|
|
@@ -862,7 +863,7 @@ class G extends P {
|
|
|
862
863
|
function xt({
|
|
863
864
|
handleCallback: e
|
|
864
865
|
}) {
|
|
865
|
-
const t =
|
|
866
|
+
const t = je(!1), [n, o] = Je(void 0), s = xe();
|
|
866
867
|
return ze(() => {
|
|
867
868
|
t.current || (t.current = !0, e().then(() => {
|
|
868
869
|
s("/");
|
|
@@ -885,7 +886,21 @@ function xt({
|
|
|
885
886
|
] }) : /* @__PURE__ */ T.jsx("div", { children: "Loading..." });
|
|
886
887
|
}
|
|
887
888
|
const le = "code-verifier";
|
|
888
|
-
class
|
|
889
|
+
class Lt extends Ce {
|
|
890
|
+
constructor(t, n) {
|
|
891
|
+
super(), this.callbackUrlPath = t, this.handleCallback = n;
|
|
892
|
+
}
|
|
893
|
+
getRoutes() {
|
|
894
|
+
return [
|
|
895
|
+
...super.getRoutes(),
|
|
896
|
+
{
|
|
897
|
+
path: this.callbackUrlPath,
|
|
898
|
+
element: /* @__PURE__ */ T.jsx(xt, { handleCallback: this.handleCallback })
|
|
899
|
+
}
|
|
900
|
+
];
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
class Ut {
|
|
889
904
|
constructor({
|
|
890
905
|
issuer: t,
|
|
891
906
|
authorizationEndpoint: n,
|
|
@@ -903,10 +918,10 @@ class Pt {
|
|
|
903
918
|
S(this, "handleCallback", async () => {
|
|
904
919
|
const t = new URL(window.location.href), n = t.searchParams.get("state"), o = localStorage.getItem(le);
|
|
905
920
|
if (!o)
|
|
906
|
-
throw new
|
|
921
|
+
throw new x(
|
|
907
922
|
"Code verifier not found. Invalid auth state."
|
|
908
923
|
);
|
|
909
|
-
const s = await this.getAuthServer(), r =
|
|
924
|
+
const s = await this.getAuthServer(), r = Pt(
|
|
910
925
|
s,
|
|
911
926
|
this.client,
|
|
912
927
|
t.searchParams,
|
|
@@ -919,19 +934,19 @@ class Pt {
|
|
|
919
934
|
);
|
|
920
935
|
const i = new URL(t);
|
|
921
936
|
i.pathname = this.callbackUrlPath, i.search = "";
|
|
922
|
-
const d = await
|
|
937
|
+
const d = await yt(
|
|
923
938
|
s,
|
|
924
939
|
this.client,
|
|
925
940
|
r,
|
|
926
941
|
i.toString(),
|
|
927
942
|
o
|
|
928
|
-
), g = await
|
|
943
|
+
), g = await vt(
|
|
929
944
|
s,
|
|
930
945
|
this.client,
|
|
931
946
|
d
|
|
932
947
|
);
|
|
933
948
|
this.setTokensFromResponse(g);
|
|
934
|
-
const m = await this.getAccessToken(), y = await (await
|
|
949
|
+
const m = await this.getAccessToken(), y = await (await lt(
|
|
935
950
|
s,
|
|
936
951
|
this.client,
|
|
937
952
|
m
|
|
@@ -963,8 +978,8 @@ class Pt {
|
|
|
963
978
|
code_challenge_methods_supported: []
|
|
964
979
|
};
|
|
965
980
|
else {
|
|
966
|
-
const t = new URL(this.issuer), n = await
|
|
967
|
-
this.authorizationServer = await
|
|
981
|
+
const t = new URL(this.issuer), n = await Me(t);
|
|
982
|
+
this.authorizationServer = await Be(
|
|
968
983
|
t,
|
|
969
984
|
n
|
|
970
985
|
);
|
|
@@ -979,7 +994,7 @@ class Pt {
|
|
|
979
994
|
if (B(t))
|
|
980
995
|
throw oe.error("Bad Token Response", t), new G("Bad Token Response", t);
|
|
981
996
|
if (!t.expires_in)
|
|
982
|
-
throw new
|
|
997
|
+
throw new x("No expires_in in response");
|
|
983
998
|
this.tokens = {
|
|
984
999
|
accessToken: t.access_token,
|
|
985
1000
|
refreshToken: t.refresh_token,
|
|
@@ -987,14 +1002,12 @@ class Pt {
|
|
|
987
1002
|
tokenType: t.token_type
|
|
988
1003
|
};
|
|
989
1004
|
}
|
|
990
|
-
async initialize() {
|
|
991
|
-
}
|
|
992
1005
|
async login() {
|
|
993
1006
|
var d;
|
|
994
1007
|
const t = "S256", n = await this.getAuthServer();
|
|
995
1008
|
if (!n.authorization_endpoint)
|
|
996
|
-
throw new
|
|
997
|
-
const o =
|
|
1009
|
+
throw new x("No authorization endpoint");
|
|
1010
|
+
const o = Ge(), s = await Ve(o);
|
|
998
1011
|
localStorage.setItem(le, o);
|
|
999
1012
|
const r = new URL(
|
|
1000
1013
|
n.authorization_endpoint
|
|
@@ -1003,7 +1016,7 @@ class Pt {
|
|
|
1003
1016
|
"code_challenge_method",
|
|
1004
1017
|
t
|
|
1005
1018
|
), ((d = n.code_challenge_methods_supported) == null ? void 0 : d.includes("S256")) !== !0) {
|
|
1006
|
-
const g =
|
|
1019
|
+
const g = qe();
|
|
1007
1020
|
r.searchParams.set("state", g);
|
|
1008
1021
|
}
|
|
1009
1022
|
location.href = r.href;
|
|
@@ -1011,17 +1024,17 @@ class Pt {
|
|
|
1011
1024
|
async getAccessToken() {
|
|
1012
1025
|
const t = await this.getAuthServer();
|
|
1013
1026
|
if (!this.tokens)
|
|
1014
|
-
throw new
|
|
1027
|
+
throw new x("User is not authenticated");
|
|
1015
1028
|
if (this.tokens.expiresOn < /* @__PURE__ */ new Date()) {
|
|
1016
1029
|
if (!this.tokens.refreshToken)
|
|
1017
|
-
throw new
|
|
1030
|
+
throw new x(
|
|
1018
1031
|
"Token expired and no refresh token available"
|
|
1019
1032
|
);
|
|
1020
|
-
const n = await
|
|
1033
|
+
const n = await ht(
|
|
1021
1034
|
t,
|
|
1022
1035
|
this.client,
|
|
1023
1036
|
this.tokens.refreshToken
|
|
1024
|
-
), o = await
|
|
1037
|
+
), o = await pt(
|
|
1025
1038
|
t,
|
|
1026
1039
|
this.client,
|
|
1027
1040
|
n
|
|
@@ -1044,18 +1057,16 @@ class Pt {
|
|
|
1044
1057
|
n.toString()
|
|
1045
1058
|
)) : o = n;
|
|
1046
1059
|
}
|
|
1047
|
-
|
|
1048
|
-
return
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
}
|
|
1053
|
-
];
|
|
1060
|
+
getAuthenticationPlugin() {
|
|
1061
|
+
return new Lt(
|
|
1062
|
+
this.callbackUrlPath,
|
|
1063
|
+
() => this.handleCallback()
|
|
1064
|
+
);
|
|
1054
1065
|
}
|
|
1055
1066
|
}
|
|
1056
|
-
const
|
|
1067
|
+
const Nt = (e) => new Ut(e);
|
|
1057
1068
|
export {
|
|
1058
|
-
|
|
1059
|
-
|
|
1069
|
+
Ut as OpenIDAuthenticationProvider,
|
|
1070
|
+
Nt as default
|
|
1060
1071
|
};
|
|
1061
1072
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|