zudoku 0.53.6 → 0.54.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/config/config.d.ts +1 -0
- package/dist/config/validators/InputNavigationSchema.d.ts +190 -158
- package/dist/config/validators/InputNavigationSchema.js +4 -1
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/ProtectedRoutesSchema.d.ts +12 -0
- package/dist/config/validators/ProtectedRoutesSchema.js +19 -0
- package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -0
- package/dist/config/validators/validate.d.ts +32 -19
- package/dist/config/validators/validate.js +6 -2
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +6 -2
- package/dist/lib/authentication/components/CallbackHandler.js +11 -9
- package/dist/lib/authentication/components/CallbackHandler.js.map +1 -1
- package/dist/lib/authentication/components/OAuthErrorPage.d.ts +3 -0
- package/dist/lib/authentication/components/OAuthErrorPage.js +99 -0
- package/dist/lib/authentication/components/OAuthErrorPage.js.map +1 -0
- package/dist/lib/authentication/errors.d.ts +6 -12
- package/dist/lib/authentication/errors.js +2 -1
- package/dist/lib/authentication/errors.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/azureb2c.js +4 -2
- package/dist/lib/authentication/providers/azureb2c.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +4 -2
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/authentication/providers/openid.js +3 -1
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +5 -3
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +4 -3
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +21 -13
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.d.ts +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +8 -1
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +3 -1
- package/dist/lib/components/navigation/utils.js +6 -3
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/RouteGuard.js +9 -9
- package/dist/lib/core/RouteGuard.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +2 -1
- package/dist/lib/core/ZudokuContext.js +13 -1
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +2 -1
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/plugins/api-keys/CreateApiKey.js +7 -3
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +3 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +1 -0
- package/dist/lib/plugins/api-keys/index.js +3 -7
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +42 -10
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/ui/ActionButton.js +1 -1
- package/dist/lib/ui/ActionButton.js.map +1 -1
- package/dist/lib/ui/Badge.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +2 -2
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/util/invariant.d.ts +6 -5
- package/dist/lib/util/invariant.js +1 -1
- package/dist/lib/util/invariant.js.map +1 -1
- package/dist/vite/dev-server.js +1 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/prerender/worker.js +5 -1
- package/dist/vite/prerender/worker.js.map +1 -1
- package/dist/vite/shadcn-registry.d.ts +8 -8
- package/lib/{Command-C9AC5cf-.js → Command-BYukybsa.js} +2 -2
- package/lib/{Command-C9AC5cf-.js.map → Command-BYukybsa.js.map} +1 -1
- package/lib/{Dialog-DMWw1doX.js → Dialog-u9Uz9sTt.js} +4 -4
- package/lib/{Dialog-DMWw1doX.js.map → Dialog-u9Uz9sTt.js.map} +1 -1
- package/lib/{MdxPage-DVI4iYgW.js → MdxPage-Bsko6_kb.js} +11 -11
- package/lib/{MdxPage-DVI4iYgW.js.map → MdxPage-Bsko6_kb.js.map} +1 -1
- package/lib/OAuthErrorPage-DJzGiIBt.js +150 -0
- package/lib/OAuthErrorPage-DJzGiIBt.js.map +1 -0
- package/lib/{OasProvider-CbwsKPNc.js → OasProvider-DQQRt3oS.js} +3 -3
- package/lib/{OasProvider-CbwsKPNc.js.map → OasProvider-DQQRt3oS.js.map} +1 -1
- package/lib/{OperationList-Bn9ggxw8.js → OperationList-DpmkHf26.js} +45 -43
- package/lib/{OperationList-Bn9ggxw8.js.map → OperationList-DpmkHf26.js.map} +1 -1
- package/lib/{Pagination-bavPec-z.js → Pagination-kqFNgtnI.js} +3 -3
- package/lib/{Pagination-bavPec-z.js.map → Pagination-kqFNgtnI.js.map} +1 -1
- package/lib/{RouteGuard-Vnlz_t51.js → RouteGuard-0wPUKdxJ.js} +166 -165
- package/lib/{RouteGuard-Vnlz_t51.js.map → RouteGuard-0wPUKdxJ.js.map} +1 -1
- package/lib/{SchemaList-DETyCVqu.js → SchemaList-DS-pMd6B.js} +8 -8
- package/lib/{SchemaList-DETyCVqu.js.map → SchemaList-DS-pMd6B.js.map} +1 -1
- package/lib/{SchemaView-Dvxo2RNe.js → SchemaView-BnN6WHjw.js} +4 -4
- package/lib/{SchemaView-Dvxo2RNe.js.map → SchemaView-BnN6WHjw.js.map} +1 -1
- package/lib/Select-BmTTKNPp.js +273 -0
- package/lib/Select-BmTTKNPp.js.map +1 -0
- package/lib/{SignUp-ClYhZq9H.js → SignUp-BwOSCD-6.js} +9 -9
- package/lib/{SignUp-ClYhZq9H.js.map → SignUp-BwOSCD-6.js.map} +1 -1
- package/lib/{Slot-B31yZlfB.js → Slot-DAyXieeZ.js} +1352 -1349
- package/lib/{Slot-B31yZlfB.js.map → Slot-DAyXieeZ.js.map} +1 -1
- package/lib/{SyntaxHighlight-bm761HDo.js → SyntaxHighlight-BMKR4pl6.js} +3 -3
- package/lib/{SyntaxHighlight-bm761HDo.js.map → SyntaxHighlight-BMKR4pl6.js.map} +1 -1
- package/lib/{Toc-D4oBWE8D.js → Toc-BKDRCQzU.js} +2 -2
- package/lib/{Toc-D4oBWE8D.js.map → Toc-BKDRCQzU.js.map} +1 -1
- package/lib/ZudokuContext-CLl5w57E.js +1278 -0
- package/lib/ZudokuContext-CLl5w57E.js.map +1 -0
- package/lib/{chunk-DQRVZFIR-DHK7_Ilc.js → chunk-QMGIS6GS-CEOk3lro.js} +3 -3
- package/lib/chunk-QMGIS6GS-CEOk3lro.js.map +1 -0
- package/lib/{circular-CRbFI6Zl.js → circular-8GWQDvCW.js} +2 -2
- package/lib/{circular-CRbFI6Zl.js.map → circular-8GWQDvCW.js.map} +1 -1
- package/lib/{createServer-DNyGJJNX.js → createServer-BsezSzvV.js} +5 -5
- package/lib/{createServer-DNyGJJNX.js.map → createServer-BsezSzvV.js.map} +1 -1
- package/lib/{errors-C1GlNcV3.js → errors-Cs7hKmdL.js} +11 -10
- package/lib/errors-Cs7hKmdL.js.map +1 -0
- package/lib/hook-DbUCLQNg.js +247 -0
- package/lib/hook-DbUCLQNg.js.map +1 -0
- package/lib/{index-D09PbNex.js → index-A5Qdwj1B.js} +1521 -1420
- package/lib/index-A5Qdwj1B.js.map +1 -0
- package/lib/{index-C_PXQ8Bx.js → index-Bg7Js3jB.js} +832 -912
- package/lib/index-Bg7Js3jB.js.map +1 -0
- package/lib/{index-CZTEgYDd.js → index-BkW9tJ6j.js} +2 -2
- package/lib/{index-CZTEgYDd.js.map → index-BkW9tJ6j.js.map} +1 -1
- package/lib/index.esm-CdzlRw50.js +1254 -0
- package/lib/index.esm-CdzlRw50.js.map +1 -0
- package/lib/{invariant-DAFpPywt.js → invariant-Bm-FVUQE.js} +2 -6
- package/lib/invariant-Bm-FVUQE.js.map +1 -0
- package/lib/ui/ActionButton.js +9 -9
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Command.js +1 -1
- package/lib/ui/Form.js +1 -1
- package/lib/ui/SyntaxHighlight.js +3 -3
- package/lib/{useExposedProps-BIYjecPD.js → useExposedProps-KcgXHKeE.js} +2 -2
- package/lib/{useExposedProps-BIYjecPD.js.map → useExposedProps-KcgXHKeE.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +25 -17
- package/lib/zudoku.auth-azureb2c.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +24 -21
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +213 -205
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.auth-supabase.js +2 -2
- package/lib/zudoku.components.js +29 -28
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +16 -15
- package/lib/zudoku.hooks.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +26 -25
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +409 -297
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +7 -6
- package/lib/zudoku.plugin-openapi.js.map +1 -1
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +28 -27
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +4 -4
- package/src/lib/authentication/components/CallbackHandler.tsx +22 -15
- package/src/lib/authentication/components/OAuthErrorPage.tsx +171 -0
- package/src/lib/authentication/errors.ts +27 -13
- package/src/lib/authentication/hook.ts +2 -0
- package/src/lib/authentication/providers/azureb2c.tsx +8 -3
- package/src/lib/authentication/providers/clerk.tsx +4 -1
- package/src/lib/authentication/providers/openid.tsx +7 -1
- package/src/lib/components/Heading.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +6 -3
- package/src/lib/components/TopNavigation.tsx +4 -4
- package/src/lib/components/context/ZudokuContext.ts +25 -18
- package/src/lib/components/navigation/NavigationItem.tsx +9 -1
- package/src/lib/components/navigation/utils.ts +9 -3
- package/src/lib/core/RouteGuard.tsx +13 -13
- package/src/lib/core/ZudokuContext.ts +18 -5
- package/src/lib/core/plugins.ts +2 -1
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +12 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +24 -4
- package/src/lib/plugins/api-keys/index.tsx +7 -8
- package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
- package/src/lib/plugins/openapi/graphql/graphql.ts +2 -0
- package/src/lib/plugins/openapi/index.tsx +66 -16
- package/src/lib/ui/ActionButton.tsx +3 -1
- package/src/lib/util/invariant.ts +7 -5
- package/lib/Alert-CWApD0CL.js +0 -161
- package/lib/Alert-CWApD0CL.js.map +0 -1
- package/lib/CallbackHandler-Dr5Lva9x.js +0 -38
- package/lib/CallbackHandler-Dr5Lva9x.js.map +0 -1
- package/lib/chunk-DQRVZFIR-DHK7_Ilc.js.map +0 -1
- package/lib/errors-C1GlNcV3.js.map +0 -1
- package/lib/hook-CZjW2buS.js +0 -1510
- package/lib/hook-CZjW2buS.js.map +0 -1
- package/lib/index-C_PXQ8Bx.js.map +0 -1
- package/lib/index-D09PbNex.js.map +0 -1
- package/lib/index.esm-Cp4wkyud.js +0 -1236
- package/lib/index.esm-Cp4wkyud.js.map +0 -1
- package/lib/invariant-DAFpPywt.js.map +0 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { g as Le } from "./invariant-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { C as Ie } from "./
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { j as D } from "./jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { g as Le } from "./invariant-Bm-FVUQE.js";
|
|
3
|
+
import { E as Ue } from "./index-A5Qdwj1B.js";
|
|
4
|
+
import { C as xe } from "./ClientOnly-E7hGysn1.js";
|
|
5
|
+
import { j as Ce } from "./ZudokuContext-CLl5w57E.js";
|
|
6
|
+
import { C as Ie, O as re, A as R } from "./errors-Cs7hKmdL.js";
|
|
7
|
+
import { C as je, O as Oe } from "./OAuthErrorPage-DJzGiIBt.js";
|
|
8
|
+
import { u as S } from "./hook-DbUCLQNg.js";
|
|
9
|
+
var J = { exports: {} }, De = J.exports, oe;
|
|
10
|
+
function Je() {
|
|
9
11
|
return oe || (oe = 1, function(t) {
|
|
10
12
|
(function(e, n) {
|
|
11
13
|
t.exports ? t.exports = n() : e.log = n();
|
|
12
|
-
})(
|
|
14
|
+
})(De, function() {
|
|
13
15
|
var e = function() {
|
|
14
16
|
}, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), s = [
|
|
15
17
|
"trace",
|
|
@@ -52,11 +54,11 @@ function De() {
|
|
|
52
54
|
function b(l, m, c) {
|
|
53
55
|
return y(l) || k.apply(this, arguments);
|
|
54
56
|
}
|
|
55
|
-
function
|
|
56
|
-
var c = this, j,
|
|
57
|
+
function h(l, m) {
|
|
58
|
+
var c = this, j, H, L, _ = "loglevel";
|
|
57
59
|
typeof l == "string" ? _ += ":" + l : typeof l == "symbol" && (_ = void 0);
|
|
58
|
-
function Ee(
|
|
59
|
-
var g = (s[
|
|
60
|
+
function Ee(f) {
|
|
61
|
+
var g = (s[f] || "silent").toUpperCase();
|
|
60
62
|
if (!(typeof window === n || !_)) {
|
|
61
63
|
try {
|
|
62
64
|
window.localStorage[_] = g;
|
|
@@ -69,22 +71,22 @@ function De() {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
|
-
function
|
|
73
|
-
var
|
|
74
|
+
function ee() {
|
|
75
|
+
var f;
|
|
74
76
|
if (!(typeof window === n || !_)) {
|
|
75
77
|
try {
|
|
76
|
-
|
|
78
|
+
f = window.localStorage[_];
|
|
77
79
|
} catch {
|
|
78
80
|
}
|
|
79
|
-
if (typeof
|
|
81
|
+
if (typeof f === n)
|
|
80
82
|
try {
|
|
81
|
-
var g = window.document.cookie,
|
|
82
|
-
|
|
83
|
-
g.slice(
|
|
83
|
+
var g = window.document.cookie, O = encodeURIComponent(_), ne = g.indexOf(O + "=");
|
|
84
|
+
ne !== -1 && (f = /^([^;]+)/.exec(
|
|
85
|
+
g.slice(ne + O.length + 1)
|
|
84
86
|
)[1]);
|
|
85
87
|
} catch {
|
|
86
88
|
}
|
|
87
|
-
return c.levels[
|
|
89
|
+
return c.levels[f] === void 0 && (f = void 0), f;
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
function Re() {
|
|
@@ -99,11 +101,11 @@ function De() {
|
|
|
99
101
|
}
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
|
-
function U(
|
|
103
|
-
var g =
|
|
104
|
+
function U(f) {
|
|
105
|
+
var g = f;
|
|
104
106
|
if (typeof g == "string" && c.levels[g.toUpperCase()] !== void 0 && (g = c.levels[g.toUpperCase()]), typeof g == "number" && g >= 0 && g <= c.levels.SILENT)
|
|
105
107
|
return g;
|
|
106
|
-
throw new TypeError("log.setLevel() called with invalid level: " +
|
|
108
|
+
throw new TypeError("log.setLevel() called with invalid level: " + f);
|
|
107
109
|
}
|
|
108
110
|
c.name = l, c.levels = {
|
|
109
111
|
TRACE: 0,
|
|
@@ -113,32 +115,32 @@ function De() {
|
|
|
113
115
|
ERROR: 4,
|
|
114
116
|
SILENT: 5
|
|
115
117
|
}, c.methodFactory = m || b, c.getLevel = function() {
|
|
116
|
-
return L ??
|
|
117
|
-
}, c.setLevel = function(
|
|
118
|
-
return L = U(
|
|
119
|
-
}, c.setDefaultLevel = function(
|
|
120
|
-
|
|
118
|
+
return L ?? H ?? j;
|
|
119
|
+
}, c.setLevel = function(f, g) {
|
|
120
|
+
return L = U(f), g !== !1 && Ee(L), p.call(c);
|
|
121
|
+
}, c.setDefaultLevel = function(f) {
|
|
122
|
+
H = U(f), ee() || c.setLevel(f, !1);
|
|
121
123
|
}, c.resetLevel = function() {
|
|
122
124
|
L = null, Re(), p.call(c);
|
|
123
|
-
}, c.enableAll = function(
|
|
124
|
-
c.setLevel(c.levels.TRACE,
|
|
125
|
-
}, c.disableAll = function(
|
|
126
|
-
c.setLevel(c.levels.SILENT,
|
|
125
|
+
}, c.enableAll = function(f) {
|
|
126
|
+
c.setLevel(c.levels.TRACE, f);
|
|
127
|
+
}, c.disableAll = function(f) {
|
|
128
|
+
c.setLevel(c.levels.SILENT, f);
|
|
127
129
|
}, c.rebuild = function() {
|
|
128
130
|
if (i !== c && (j = U(i.getLevel())), p.call(c), i === c)
|
|
129
|
-
for (var
|
|
130
|
-
r[
|
|
131
|
+
for (var f in r)
|
|
132
|
+
r[f].rebuild();
|
|
131
133
|
}, j = U(
|
|
132
134
|
i ? i.getLevel() : "WARN"
|
|
133
135
|
);
|
|
134
|
-
var
|
|
135
|
-
|
|
136
|
+
var te = ee();
|
|
137
|
+
te != null && (L = U(te)), p.call(c);
|
|
136
138
|
}
|
|
137
|
-
i = new
|
|
139
|
+
i = new h(), i.getLogger = function(m) {
|
|
138
140
|
if (typeof m != "symbol" && typeof m != "string" || m === "")
|
|
139
141
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
140
142
|
var c = r[m];
|
|
141
|
-
return c || (c = r[m] = new
|
|
143
|
+
return c || (c = r[m] = new h(
|
|
142
144
|
m,
|
|
143
145
|
i.methodFactory
|
|
144
146
|
)), c;
|
|
@@ -150,13 +152,13 @@ function De() {
|
|
|
150
152
|
return r;
|
|
151
153
|
}, i.default = i, i;
|
|
152
154
|
});
|
|
153
|
-
}(
|
|
155
|
+
}(J)), J.exports;
|
|
154
156
|
}
|
|
155
|
-
var
|
|
156
|
-
const ie = /* @__PURE__ */ Le(
|
|
157
|
-
let
|
|
158
|
-
(typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (
|
|
159
|
-
function
|
|
157
|
+
var ze = Je();
|
|
158
|
+
const ie = /* @__PURE__ */ Le(ze);
|
|
159
|
+
let B;
|
|
160
|
+
(typeof navigator > "u" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) && (B = "oauth4webapi/v2.17.0");
|
|
161
|
+
function V(t, e) {
|
|
160
162
|
if (t == null)
|
|
161
163
|
return !1;
|
|
162
164
|
try {
|
|
@@ -165,19 +167,19 @@ function q(t, e) {
|
|
|
165
167
|
return !1;
|
|
166
168
|
}
|
|
167
169
|
}
|
|
168
|
-
const
|
|
170
|
+
const N = Symbol(), Ne = Symbol(), G = Symbol(), We = Symbol(), Ke = Symbol(), He = Symbol(), $e = new TextEncoder(), Fe = new TextDecoder();
|
|
169
171
|
function E(t) {
|
|
170
|
-
return typeof t == "string" ?
|
|
172
|
+
return typeof t == "string" ? $e.encode(t) : Fe.decode(t);
|
|
171
173
|
}
|
|
172
174
|
const se = 32768;
|
|
173
|
-
function
|
|
175
|
+
function Me(t) {
|
|
174
176
|
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
175
177
|
const e = [];
|
|
176
178
|
for (let n = 0; n < t.byteLength; n += se)
|
|
177
179
|
e.push(String.fromCharCode.apply(null, t.subarray(n, n + se)));
|
|
178
180
|
return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
179
181
|
}
|
|
180
|
-
function
|
|
182
|
+
function Be(t) {
|
|
181
183
|
try {
|
|
182
184
|
const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
|
|
183
185
|
for (let o = 0; o < e.length; o++)
|
|
@@ -188,9 +190,9 @@ function Fe(t) {
|
|
|
188
190
|
}
|
|
189
191
|
}
|
|
190
192
|
function A(t) {
|
|
191
|
-
return typeof t == "string" ?
|
|
193
|
+
return typeof t == "string" ? Be(t) : Me(t);
|
|
192
194
|
}
|
|
193
|
-
class
|
|
195
|
+
class qe {
|
|
194
196
|
constructor(e) {
|
|
195
197
|
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
|
|
196
198
|
}
|
|
@@ -219,22 +221,22 @@ class v extends Error {
|
|
|
219
221
|
super(e ?? "operation not supported"), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
|
-
class
|
|
224
|
+
class Ve extends Error {
|
|
223
225
|
constructor(e, n) {
|
|
224
226
|
super(e, n), this.name = this.constructor.name, Error.captureStackTrace?.(this, this.constructor);
|
|
225
227
|
}
|
|
226
228
|
}
|
|
227
|
-
const a =
|
|
229
|
+
const a = Ve, we = new qe(100);
|
|
228
230
|
function me(t) {
|
|
229
231
|
return t instanceof CryptoKey;
|
|
230
232
|
}
|
|
231
|
-
function
|
|
233
|
+
function Ge(t) {
|
|
232
234
|
return me(t) && t.type === "private";
|
|
233
235
|
}
|
|
234
|
-
function
|
|
236
|
+
function Ye(t) {
|
|
235
237
|
return me(t) && t.type === "public";
|
|
236
238
|
}
|
|
237
|
-
function
|
|
239
|
+
function Y(t) {
|
|
238
240
|
try {
|
|
239
241
|
const e = t.headers.get("dpop-nonce");
|
|
240
242
|
e && we.set(new URL(t.url).origin, e);
|
|
@@ -242,24 +244,24 @@ function G(t) {
|
|
|
242
244
|
}
|
|
243
245
|
return t;
|
|
244
246
|
}
|
|
245
|
-
function
|
|
247
|
+
function x(t) {
|
|
246
248
|
return !(t === null || typeof t != "object" || Array.isArray(t));
|
|
247
249
|
}
|
|
248
|
-
function
|
|
249
|
-
|
|
250
|
+
function W(t) {
|
|
251
|
+
V(t, Headers) && (t = Object.fromEntries(t.entries()));
|
|
250
252
|
const e = new Headers(t);
|
|
251
|
-
if (
|
|
253
|
+
if (B && !e.has("user-agent") && e.set("user-agent", B), e.has("authorization"))
|
|
252
254
|
throw new TypeError('"options.headers" must not include the "authorization" header name');
|
|
253
255
|
if (e.has("dpop"))
|
|
254
256
|
throw new TypeError('"options.headers" must not include the "dpop" header name');
|
|
255
257
|
return e;
|
|
256
258
|
}
|
|
257
|
-
function
|
|
259
|
+
function Ze(t) {
|
|
258
260
|
if (typeof t == "function" && (t = t()), !(t instanceof AbortSignal))
|
|
259
261
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
260
262
|
return t;
|
|
261
263
|
}
|
|
262
|
-
async function
|
|
264
|
+
async function Qe(t, e) {
|
|
263
265
|
if (!(t instanceof URL))
|
|
264
266
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
265
267
|
if (t.protocol !== "https:" && t.protocol !== "http:")
|
|
@@ -276,32 +278,32 @@ async function Ye(t, e) {
|
|
|
276
278
|
default:
|
|
277
279
|
throw new TypeError('"options.algorithm" must be "oidc" (default), or "oauth2"');
|
|
278
280
|
}
|
|
279
|
-
const o =
|
|
280
|
-
return o.set("accept", "application/json"), (e?.[
|
|
281
|
+
const o = W(e?.headers);
|
|
282
|
+
return o.set("accept", "application/json"), (e?.[G] || fetch)(n.href, {
|
|
281
283
|
headers: Object.fromEntries(o.entries()),
|
|
282
284
|
method: "GET",
|
|
283
285
|
redirect: "manual",
|
|
284
286
|
signal: null
|
|
285
|
-
}).then(
|
|
287
|
+
}).then(Y);
|
|
286
288
|
}
|
|
287
289
|
function w(t) {
|
|
288
290
|
return typeof t == "string" && t.length !== 0;
|
|
289
291
|
}
|
|
290
|
-
async function
|
|
292
|
+
async function Xe(t, e) {
|
|
291
293
|
if (!(t instanceof URL))
|
|
292
294
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
293
|
-
if (!
|
|
295
|
+
if (!V(e, Response))
|
|
294
296
|
throw new TypeError('"response" must be an instance of Response');
|
|
295
297
|
if (e.status !== 200)
|
|
296
298
|
throw new a('"response" is not a conform Authorization Server Metadata response');
|
|
297
|
-
|
|
299
|
+
X(e);
|
|
298
300
|
let n;
|
|
299
301
|
try {
|
|
300
302
|
n = await e.json();
|
|
301
303
|
} catch (o) {
|
|
302
304
|
throw new a('failed to parse "response" body as JSON', { cause: o });
|
|
303
305
|
}
|
|
304
|
-
if (!
|
|
306
|
+
if (!x(n))
|
|
305
307
|
throw new a('"response" body must be a top level object');
|
|
306
308
|
if (!w(n.issuer))
|
|
307
309
|
throw new a('"response" body "issuer" property must be a non-empty string');
|
|
@@ -309,16 +311,16 @@ async function Ze(t, e) {
|
|
|
309
311
|
throw new a('"response" body "issuer" does not match "expectedIssuer"');
|
|
310
312
|
return n;
|
|
311
313
|
}
|
|
312
|
-
function
|
|
314
|
+
function Z() {
|
|
313
315
|
return A(crypto.getRandomValues(new Uint8Array(32)));
|
|
314
316
|
}
|
|
315
|
-
function
|
|
316
|
-
return
|
|
317
|
+
function et() {
|
|
318
|
+
return Z();
|
|
317
319
|
}
|
|
318
|
-
function
|
|
319
|
-
return
|
|
320
|
+
function tt() {
|
|
321
|
+
return Z();
|
|
320
322
|
}
|
|
321
|
-
async function
|
|
323
|
+
async function nt(t) {
|
|
322
324
|
if (!w(t))
|
|
323
325
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
324
326
|
return A(await crypto.subtle.digest("SHA-256", E(t)));
|
|
@@ -326,11 +328,11 @@ async function et(t) {
|
|
|
326
328
|
function ae(t) {
|
|
327
329
|
return encodeURIComponent(t).replace(/%20/g, "+");
|
|
328
330
|
}
|
|
329
|
-
function
|
|
331
|
+
function rt(t, e) {
|
|
330
332
|
const n = ae(t), o = ae(e);
|
|
331
333
|
return `Basic ${btoa(`${n}:${o}`)}`;
|
|
332
334
|
}
|
|
333
|
-
function
|
|
335
|
+
function ot(t) {
|
|
334
336
|
switch (t.algorithm.hash.name) {
|
|
335
337
|
case "SHA-256":
|
|
336
338
|
return "PS256";
|
|
@@ -342,7 +344,7 @@ function nt(t) {
|
|
|
342
344
|
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
343
345
|
}
|
|
344
346
|
}
|
|
345
|
-
function
|
|
347
|
+
function it(t) {
|
|
346
348
|
switch (t.algorithm.hash.name) {
|
|
347
349
|
case "SHA-256":
|
|
348
350
|
return "RS256";
|
|
@@ -354,7 +356,7 @@ function rt(t) {
|
|
|
354
356
|
throw new v("unsupported RsaHashedKeyAlgorithm hash name");
|
|
355
357
|
}
|
|
356
358
|
}
|
|
357
|
-
function
|
|
359
|
+
function st(t) {
|
|
358
360
|
switch (t.algorithm.namedCurve) {
|
|
359
361
|
case "P-256":
|
|
360
362
|
return "ES256";
|
|
@@ -366,14 +368,14 @@ function ot(t) {
|
|
|
366
368
|
throw new v("unsupported EcKeyAlgorithm namedCurve");
|
|
367
369
|
}
|
|
368
370
|
}
|
|
369
|
-
function
|
|
371
|
+
function at(t) {
|
|
370
372
|
switch (t.algorithm.name) {
|
|
371
373
|
case "RSA-PSS":
|
|
372
|
-
return
|
|
374
|
+
return ot(t);
|
|
373
375
|
case "RSASSA-PKCS1-v1_5":
|
|
374
|
-
return
|
|
376
|
+
return it(t);
|
|
375
377
|
case "ECDSA":
|
|
376
|
-
return
|
|
378
|
+
return st(t);
|
|
377
379
|
case "Ed25519":
|
|
378
380
|
case "Ed448":
|
|
379
381
|
return "EdDSA";
|
|
@@ -381,18 +383,18 @@ function it(t) {
|
|
|
381
383
|
throw new v("unsupported CryptoKey algorithm name");
|
|
382
384
|
}
|
|
383
385
|
}
|
|
384
|
-
function
|
|
385
|
-
const e = t?.[
|
|
386
|
+
function K(t) {
|
|
387
|
+
const e = t?.[N];
|
|
386
388
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
387
389
|
}
|
|
388
390
|
function ge(t) {
|
|
389
|
-
const e = t?.[
|
|
391
|
+
const e = t?.[Ne];
|
|
390
392
|
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
391
393
|
}
|
|
392
|
-
function
|
|
394
|
+
function Q() {
|
|
393
395
|
return Math.floor(Date.now() / 1e3);
|
|
394
396
|
}
|
|
395
|
-
function
|
|
397
|
+
function C(t) {
|
|
396
398
|
if (typeof t != "object" || t === null)
|
|
397
399
|
throw new TypeError('"as" must be an object');
|
|
398
400
|
if (!w(t.issuer))
|
|
@@ -415,11 +417,11 @@ function ue(t, e) {
|
|
|
415
417
|
if (e !== void 0)
|
|
416
418
|
throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
|
|
417
419
|
}
|
|
418
|
-
async function
|
|
420
|
+
async function ct(t, e, n, o, s) {
|
|
419
421
|
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
420
422
|
case void 0:
|
|
421
423
|
case "client_secret_basic": {
|
|
422
|
-
o.set("authorization",
|
|
424
|
+
o.set("authorization", rt(e.client_id, ce(e.client_secret)));
|
|
423
425
|
break;
|
|
424
426
|
}
|
|
425
427
|
case "client_secret_post": {
|
|
@@ -438,43 +440,43 @@ async function st(t, e, n, o, s) {
|
|
|
438
440
|
throw new v("unsupported client token_endpoint_auth_method");
|
|
439
441
|
}
|
|
440
442
|
}
|
|
441
|
-
async function
|
|
443
|
+
async function ut(t, e, n) {
|
|
442
444
|
if (!n.usages.includes("sign"))
|
|
443
445
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
444
446
|
const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, s = A(await crypto.subtle.sign(Ae(n), n, E(o)));
|
|
445
447
|
return `${o}.${s}`;
|
|
446
448
|
}
|
|
447
|
-
async function
|
|
449
|
+
async function lt(t, e, n, o, s, r) {
|
|
448
450
|
const { privateKey: i, publicKey: u, nonce: d = we.get(n.origin) } = e;
|
|
449
|
-
if (!
|
|
451
|
+
if (!Ge(i))
|
|
450
452
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
451
|
-
if (!
|
|
453
|
+
if (!Ye(u))
|
|
452
454
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
453
455
|
if (d !== void 0 && !w(d))
|
|
454
456
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
455
457
|
if (!u.extractable)
|
|
456
458
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
457
|
-
const y =
|
|
458
|
-
alg:
|
|
459
|
+
const y = Q() + s, p = {
|
|
460
|
+
alg: at(i),
|
|
459
461
|
typ: "dpop+jwt",
|
|
460
|
-
jwk: await
|
|
462
|
+
jwk: await ft(u)
|
|
461
463
|
}, k = {
|
|
462
464
|
iat: y,
|
|
463
|
-
jti:
|
|
465
|
+
jti: Z(),
|
|
464
466
|
htm: o,
|
|
465
467
|
nonce: d,
|
|
466
468
|
htu: `${n.origin}${n.pathname}`,
|
|
467
469
|
ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
|
|
468
470
|
};
|
|
469
|
-
e[
|
|
471
|
+
e[We]?.(p, k), t.set("dpop", await ut(p, k, i));
|
|
470
472
|
}
|
|
471
|
-
let
|
|
472
|
-
async function
|
|
473
|
+
let z;
|
|
474
|
+
async function dt(t) {
|
|
473
475
|
const { kty: e, e: n, n: o, x: s, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), u = { kty: e, e: n, n: o, x: s, y: r, crv: i };
|
|
474
|
-
return
|
|
476
|
+
return z.set(t, u), u;
|
|
475
477
|
}
|
|
476
|
-
async function
|
|
477
|
-
return
|
|
478
|
+
async function ft(t) {
|
|
479
|
+
return z || (z = /* @__PURE__ */ new WeakMap()), z.get(t) || dt(t);
|
|
478
480
|
}
|
|
479
481
|
function le(t, e, n) {
|
|
480
482
|
if (typeof t != "string")
|
|
@@ -485,56 +487,56 @@ function ye(t, e, n = !1) {
|
|
|
485
487
|
return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? le(t.mtls_endpoint_aliases[e], e, n) : le(t[e], e, n);
|
|
486
488
|
}
|
|
487
489
|
function be(t, e) {
|
|
488
|
-
return !!(t.use_mtls_endpoint_aliases || e?.[
|
|
490
|
+
return !!(t.use_mtls_endpoint_aliases || e?.[He]);
|
|
489
491
|
}
|
|
490
|
-
function
|
|
492
|
+
function q(t) {
|
|
491
493
|
const e = t;
|
|
492
494
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
493
495
|
}
|
|
494
|
-
async function
|
|
496
|
+
async function ht(t, e, n, o, s, r) {
|
|
495
497
|
if (!w(t))
|
|
496
498
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
497
499
|
if (!(n instanceof URL))
|
|
498
500
|
throw new TypeError('"url" must be an instance of URL');
|
|
499
|
-
return o =
|
|
501
|
+
return o = W(o), r?.DPoP === void 0 ? o.set("authorization", `Bearer ${t}`) : (await lt(o, r.DPoP, n, e.toUpperCase(), K({ [N]: r?.[N] }), t), o.set("authorization", `DPoP ${t}`)), (r?.[G] || fetch)(n.href, {
|
|
500
502
|
body: s,
|
|
501
503
|
headers: Object.fromEntries(o.entries()),
|
|
502
504
|
method: e,
|
|
503
505
|
redirect: "manual",
|
|
504
|
-
signal: r?.signal ?
|
|
505
|
-
}).then(
|
|
506
|
+
signal: r?.signal ? Ze(r.signal) : null
|
|
507
|
+
}).then(Y);
|
|
506
508
|
}
|
|
507
|
-
async function
|
|
508
|
-
|
|
509
|
-
const s = ye(t, "userinfo_endpoint", be(e, o)), r =
|
|
510
|
-
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")),
|
|
509
|
+
async function pt(t, e, n, o) {
|
|
510
|
+
C(t), I(e);
|
|
511
|
+
const s = ye(t, "userinfo_endpoint", be(e, o)), r = W(o?.headers);
|
|
512
|
+
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), ht(n, "GET", s, r, null, {
|
|
511
513
|
...o,
|
|
512
|
-
[
|
|
514
|
+
[N]: K(e)
|
|
513
515
|
});
|
|
514
516
|
}
|
|
515
|
-
async function
|
|
516
|
-
return await
|
|
517
|
+
async function wt(t, e, n, o, s, r, i) {
|
|
518
|
+
return await ct(t, e, s, r), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), (i?.[G] || fetch)(o.href, {
|
|
517
519
|
body: s,
|
|
518
520
|
headers: Object.fromEntries(r.entries()),
|
|
519
521
|
method: n,
|
|
520
522
|
redirect: "manual",
|
|
521
523
|
signal: null
|
|
522
|
-
}).then(
|
|
524
|
+
}).then(Y);
|
|
523
525
|
}
|
|
524
526
|
async function _e(t, e, n, o, s) {
|
|
525
527
|
const r = ye(t, "token_endpoint", be(e, s));
|
|
526
528
|
o.set("grant_type", n);
|
|
527
|
-
const i =
|
|
528
|
-
return i.set("accept", "application/json"),
|
|
529
|
+
const i = W(s?.headers);
|
|
530
|
+
return i.set("accept", "application/json"), wt(t, e, "POST", r, o, i, s);
|
|
529
531
|
}
|
|
530
532
|
async function de(t, e, n, o) {
|
|
531
|
-
if (
|
|
533
|
+
if (C(t), I(e), !w(n))
|
|
532
534
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
533
535
|
const s = new URLSearchParams(o?.additionalParameters);
|
|
534
536
|
return s.set("refresh_token", n), _e(t, e, "refresh_token", s, o);
|
|
535
537
|
}
|
|
536
538
|
const ve = /* @__PURE__ */ new WeakMap();
|
|
537
|
-
function
|
|
539
|
+
function mt(t) {
|
|
538
540
|
if (!t.id_token)
|
|
539
541
|
return;
|
|
540
542
|
const e = ve.get(t);
|
|
@@ -543,22 +545,22 @@ function pt(t) {
|
|
|
543
545
|
return e[0];
|
|
544
546
|
}
|
|
545
547
|
async function Se(t, e, n, o = !1, s = !1) {
|
|
546
|
-
if (
|
|
548
|
+
if (C(t), I(e), !V(n, Response))
|
|
547
549
|
throw new TypeError('"response" must be an instance of Response');
|
|
548
550
|
if (n.status !== 200) {
|
|
549
551
|
let i;
|
|
550
|
-
if (i = await
|
|
552
|
+
if (i = await kt(n))
|
|
551
553
|
return i;
|
|
552
554
|
throw new a('"response" is not a conform Token Endpoint response');
|
|
553
555
|
}
|
|
554
|
-
|
|
556
|
+
X(n);
|
|
555
557
|
let r;
|
|
556
558
|
try {
|
|
557
559
|
r = await n.json();
|
|
558
560
|
} catch (i) {
|
|
559
561
|
throw new a('failed to parse "response" body as JSON', { cause: i });
|
|
560
562
|
}
|
|
561
|
-
if (!
|
|
563
|
+
if (!x(r))
|
|
562
564
|
throw new a('"response" body must be a top level object');
|
|
563
565
|
if (!w(r.access_token))
|
|
564
566
|
throw new a('"response" body "access_token" property must be a non-empty string');
|
|
@@ -576,7 +578,7 @@ async function Se(t, e, n, o = !1, s = !1) {
|
|
|
576
578
|
if (r.id_token !== void 0 && !w(r.id_token))
|
|
577
579
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
578
580
|
if (r.id_token) {
|
|
579
|
-
const { claims: i, jwt: u } = await
|
|
581
|
+
const { claims: i, jwt: u } = await Pt(r.id_token, Lt.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), ke, K(e), ge(e), e[Ke]).then(St.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(yt.bind(void 0, t.issuer)).then(gt.bind(void 0, e.client_id));
|
|
580
582
|
if (Array.isArray(i.aud) && i.aud.length !== 1) {
|
|
581
583
|
if (i.azp === void 0)
|
|
582
584
|
throw new a('ID Token "aud" (audience) claim includes additional untrusted audiences');
|
|
@@ -590,10 +592,10 @@ async function Se(t, e, n, o = !1, s = !1) {
|
|
|
590
592
|
}
|
|
591
593
|
return r;
|
|
592
594
|
}
|
|
593
|
-
async function
|
|
595
|
+
async function fe(t, e, n) {
|
|
594
596
|
return Se(t, e, n);
|
|
595
597
|
}
|
|
596
|
-
function
|
|
598
|
+
function gt(t, e) {
|
|
597
599
|
if (Array.isArray(e.claims.aud)) {
|
|
598
600
|
if (!e.claims.aud.includes(t))
|
|
599
601
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
@@ -601,17 +603,17 @@ function wt(t, e) {
|
|
|
601
603
|
throw new a('unexpected JWT "aud" (audience) claim value');
|
|
602
604
|
return e;
|
|
603
605
|
}
|
|
604
|
-
function
|
|
606
|
+
function yt(t, e) {
|
|
605
607
|
if (e.claims.iss !== t)
|
|
606
608
|
throw new a('unexpected JWT "iss" (issuer) claim value');
|
|
607
609
|
return e;
|
|
608
610
|
}
|
|
609
611
|
const Te = /* @__PURE__ */ new WeakSet();
|
|
610
|
-
function
|
|
612
|
+
function bt(t) {
|
|
611
613
|
return Te.add(t), t;
|
|
612
614
|
}
|
|
613
|
-
async function
|
|
614
|
-
if (
|
|
615
|
+
async function _t(t, e, n, o, s, r) {
|
|
616
|
+
if (C(t), I(e), !Te.has(n))
|
|
615
617
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
616
618
|
if (!w(o))
|
|
617
619
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
@@ -623,7 +625,7 @@ async function yt(t, e, n, o, s, r) {
|
|
|
623
625
|
const u = new URLSearchParams(r?.additionalParameters);
|
|
624
626
|
return u.set("redirect_uri", o), u.set("code_verifier", s), u.set("code", i), _e(t, e, "authorization_code", u, r);
|
|
625
627
|
}
|
|
626
|
-
const
|
|
628
|
+
const vt = {
|
|
627
629
|
aud: "audience",
|
|
628
630
|
c_hash: "code hash",
|
|
629
631
|
client_id: "client id",
|
|
@@ -639,33 +641,33 @@ const bt = {
|
|
|
639
641
|
htu: "http uri",
|
|
640
642
|
cnf: "confirmation"
|
|
641
643
|
};
|
|
642
|
-
function
|
|
644
|
+
function St(t, e) {
|
|
643
645
|
for (const n of t)
|
|
644
646
|
if (e.claims[n] === void 0)
|
|
645
|
-
throw new a(`JWT "${n}" (${
|
|
647
|
+
throw new a(`JWT "${n}" (${vt[n]}) claim missing`);
|
|
646
648
|
return e;
|
|
647
649
|
}
|
|
648
|
-
const
|
|
649
|
-
async function
|
|
650
|
+
const Tt = Symbol(), $ = Symbol();
|
|
651
|
+
async function At(t, e, n, o, s) {
|
|
650
652
|
const r = await Se(t, e, n);
|
|
651
|
-
if (
|
|
653
|
+
if (q(r))
|
|
652
654
|
return r;
|
|
653
655
|
if (!w(r.id_token))
|
|
654
656
|
throw new a('"response" body "id_token" property must be a non-empty string');
|
|
655
|
-
s ?? (s = e.default_max_age ??
|
|
656
|
-
const i =
|
|
657
|
-
if ((e.require_auth_time || s !==
|
|
657
|
+
s ?? (s = e.default_max_age ?? $);
|
|
658
|
+
const i = mt(r);
|
|
659
|
+
if ((e.require_auth_time || s !== $) && i.auth_time === void 0)
|
|
658
660
|
throw new a('ID Token "auth_time" (authentication time) claim missing');
|
|
659
|
-
if (s !==
|
|
661
|
+
if (s !== $) {
|
|
660
662
|
if (typeof s != "number" || s < 0)
|
|
661
663
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
662
|
-
const u =
|
|
664
|
+
const u = Q() + K(e), d = ge(e);
|
|
663
665
|
if (i.auth_time + s < u - d)
|
|
664
666
|
throw new a("too much time has elapsed since the last End-User authentication");
|
|
665
667
|
}
|
|
666
668
|
switch (o) {
|
|
667
669
|
case void 0:
|
|
668
|
-
case
|
|
670
|
+
case Tt:
|
|
669
671
|
if (i.nonce !== void 0)
|
|
670
672
|
throw new a('unexpected ID Token "nonce" claim value');
|
|
671
673
|
break;
|
|
@@ -679,26 +681,26 @@ async function St(t, e, n, o, s) {
|
|
|
679
681
|
}
|
|
680
682
|
return r;
|
|
681
683
|
}
|
|
682
|
-
function
|
|
684
|
+
function X(t) {
|
|
683
685
|
if (t.bodyUsed)
|
|
684
686
|
throw new TypeError('"response" body has been used already');
|
|
685
687
|
}
|
|
686
|
-
async function
|
|
688
|
+
async function kt(t) {
|
|
687
689
|
if (t.status > 399 && t.status < 500) {
|
|
688
|
-
|
|
690
|
+
X(t);
|
|
689
691
|
try {
|
|
690
692
|
const e = await t.json();
|
|
691
|
-
if (
|
|
693
|
+
if (x(e) && typeof e.error == "string" && e.error.length)
|
|
692
694
|
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;
|
|
693
695
|
} catch {
|
|
694
696
|
}
|
|
695
697
|
}
|
|
696
698
|
}
|
|
697
|
-
function
|
|
699
|
+
function he(t) {
|
|
698
700
|
if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
|
|
699
701
|
throw new a(`${t.name} modulusLength must be at least 2048 bits`);
|
|
700
702
|
}
|
|
701
|
-
function
|
|
703
|
+
function Et(t) {
|
|
702
704
|
switch (t) {
|
|
703
705
|
case "P-256":
|
|
704
706
|
return "SHA-256";
|
|
@@ -715,10 +717,10 @@ function Ae(t) {
|
|
|
715
717
|
case "ECDSA":
|
|
716
718
|
return {
|
|
717
719
|
name: t.algorithm.name,
|
|
718
|
-
hash:
|
|
720
|
+
hash: Et(t.algorithm.namedCurve)
|
|
719
721
|
};
|
|
720
722
|
case "RSA-PSS":
|
|
721
|
-
switch (
|
|
723
|
+
switch (he(t.algorithm), t.algorithm.hash.name) {
|
|
722
724
|
case "SHA-256":
|
|
723
725
|
case "SHA-384":
|
|
724
726
|
case "SHA-512":
|
|
@@ -730,7 +732,7 @@ function Ae(t) {
|
|
|
730
732
|
throw new v();
|
|
731
733
|
}
|
|
732
734
|
case "RSASSA-PKCS1-v1_5":
|
|
733
|
-
return
|
|
735
|
+
return he(t.algorithm), t.algorithm.name;
|
|
734
736
|
case "Ed448":
|
|
735
737
|
case "Ed25519":
|
|
736
738
|
return t.algorithm.name;
|
|
@@ -738,12 +740,12 @@ function Ae(t) {
|
|
|
738
740
|
throw new v();
|
|
739
741
|
}
|
|
740
742
|
const ke = Symbol();
|
|
741
|
-
async function
|
|
743
|
+
async function Rt(t, e, n, o) {
|
|
742
744
|
const s = `${t}.${e}`;
|
|
743
745
|
if (!await crypto.subtle.verify(Ae(n), n, o, E(s)))
|
|
744
746
|
throw new a("JWT signature verification failed");
|
|
745
747
|
}
|
|
746
|
-
async function
|
|
748
|
+
async function Pt(t, e, n, o, s, r) {
|
|
747
749
|
let { 0: i, 1: u, 2: d, length: y } = t.split(".");
|
|
748
750
|
if (y === 5)
|
|
749
751
|
if (r !== void 0)
|
|
@@ -758,43 +760,43 @@ async function Et(t, e, n, o, s, r) {
|
|
|
758
760
|
} catch (l) {
|
|
759
761
|
throw new a("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
760
762
|
}
|
|
761
|
-
if (!
|
|
763
|
+
if (!x(p))
|
|
762
764
|
throw new a("JWT Header must be a top level object");
|
|
763
765
|
if (e(p), p.crit !== void 0)
|
|
764
766
|
throw new a('unexpected JWT "crit" header parameter');
|
|
765
767
|
const k = A(d);
|
|
766
768
|
let b;
|
|
767
|
-
n !== ke && (b = await n(p), await
|
|
768
|
-
let
|
|
769
|
+
n !== ke && (b = await n(p), await Rt(i, u, b, k));
|
|
770
|
+
let h;
|
|
769
771
|
try {
|
|
770
|
-
|
|
772
|
+
h = JSON.parse(E(A(u)));
|
|
771
773
|
} catch (l) {
|
|
772
774
|
throw new a("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
773
775
|
}
|
|
774
|
-
if (!
|
|
776
|
+
if (!x(h))
|
|
775
777
|
throw new a("JWT Payload must be a top level object");
|
|
776
|
-
const P =
|
|
777
|
-
if (
|
|
778
|
-
if (typeof
|
|
778
|
+
const P = Q() + o;
|
|
779
|
+
if (h.exp !== void 0) {
|
|
780
|
+
if (typeof h.exp != "number")
|
|
779
781
|
throw new a('unexpected JWT "exp" (expiration time) claim type');
|
|
780
|
-
if (
|
|
782
|
+
if (h.exp <= P - s)
|
|
781
783
|
throw new a('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
782
784
|
}
|
|
783
|
-
if (
|
|
785
|
+
if (h.iat !== void 0 && typeof h.iat != "number")
|
|
784
786
|
throw new a('unexpected JWT "iat" (issued at) claim type');
|
|
785
|
-
if (
|
|
787
|
+
if (h.iss !== void 0 && typeof h.iss != "string")
|
|
786
788
|
throw new a('unexpected JWT "iss" (issuer) claim type');
|
|
787
|
-
if (
|
|
788
|
-
if (typeof
|
|
789
|
+
if (h.nbf !== void 0) {
|
|
790
|
+
if (typeof h.nbf != "number")
|
|
789
791
|
throw new a('unexpected JWT "nbf" (not before) claim type');
|
|
790
|
-
if (
|
|
792
|
+
if (h.nbf > P + s)
|
|
791
793
|
throw new a('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
792
794
|
}
|
|
793
|
-
if (
|
|
795
|
+
if (h.aud !== void 0 && typeof h.aud != "string" && !Array.isArray(h.aud))
|
|
794
796
|
throw new a('unexpected JWT "aud" (audience) claim type');
|
|
795
|
-
return { header: p, claims:
|
|
797
|
+
return { header: p, claims: h, signature: k, key: b, jwt: t };
|
|
796
798
|
}
|
|
797
|
-
function
|
|
799
|
+
function Lt(t, e, n) {
|
|
798
800
|
if (t !== void 0) {
|
|
799
801
|
if (n.alg !== t)
|
|
800
802
|
throw new a('unexpected JWT "alg" header parameter');
|
|
@@ -814,9 +816,9 @@ function T(t, e) {
|
|
|
814
816
|
throw new a(`"${e}" parameter must be provided only once`);
|
|
815
817
|
return n;
|
|
816
818
|
}
|
|
817
|
-
const
|
|
818
|
-
function
|
|
819
|
-
if (
|
|
819
|
+
const Ut = Symbol(), xt = Symbol();
|
|
820
|
+
function Ct(t, e, n, o) {
|
|
821
|
+
if (C(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
820
822
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
821
823
|
if (T(n, "response"))
|
|
822
824
|
throw new a('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
@@ -827,11 +829,11 @@ function Ut(t, e, n, o) {
|
|
|
827
829
|
throw new a('unexpected "iss" (issuer) response parameter value');
|
|
828
830
|
switch (o) {
|
|
829
831
|
case void 0:
|
|
830
|
-
case
|
|
832
|
+
case xt:
|
|
831
833
|
if (r !== void 0)
|
|
832
834
|
throw new a('unexpected "state" response parameter encountered');
|
|
833
835
|
break;
|
|
834
|
-
case
|
|
836
|
+
case Ut:
|
|
835
837
|
break;
|
|
836
838
|
default:
|
|
837
839
|
if (!w(o))
|
|
@@ -851,10 +853,10 @@ function Ut(t, e, n, o) {
|
|
|
851
853
|
const u = T(n, "id_token"), d = T(n, "token");
|
|
852
854
|
if (u !== void 0 || d !== void 0)
|
|
853
855
|
throw new v("implicit and hybrid flows are not supported");
|
|
854
|
-
return
|
|
856
|
+
return bt(new URLSearchParams(n));
|
|
855
857
|
}
|
|
856
|
-
const
|
|
857
|
-
class
|
|
858
|
+
const F = "code-verifier", M = "oauth-state", pe = "/oauth/callback";
|
|
859
|
+
class It extends Ie {
|
|
858
860
|
client;
|
|
859
861
|
issuer;
|
|
860
862
|
authorizationServer;
|
|
@@ -882,8 +884,8 @@ class Ct extends xe {
|
|
|
882
884
|
}
|
|
883
885
|
async getAuthServer() {
|
|
884
886
|
if (!this.authorizationServer) {
|
|
885
|
-
const e = new URL(this.issuer), n = await
|
|
886
|
-
this.authorizationServer = await
|
|
887
|
+
const e = new URL(this.issuer), n = await Qe(e);
|
|
888
|
+
this.authorizationServer = await Xe(
|
|
887
889
|
e,
|
|
888
890
|
n
|
|
889
891
|
);
|
|
@@ -895,7 +897,7 @@ class Ct extends xe {
|
|
|
895
897
|
* @param response
|
|
896
898
|
*/
|
|
897
899
|
setTokensFromResponse(e) {
|
|
898
|
-
if (
|
|
900
|
+
if (q(e))
|
|
899
901
|
throw ie.error("Bad Token Response", e), new re("Bad Token Response", e);
|
|
900
902
|
if (!e.expires_in)
|
|
901
903
|
throw new R("No expires_in in response");
|
|
@@ -937,8 +939,8 @@ class Ct extends xe {
|
|
|
937
939
|
const s = "S256", r = await this.getAuthServer();
|
|
938
940
|
if (!r.authorization_endpoint)
|
|
939
941
|
throw new R("No authorization endpoint");
|
|
940
|
-
const i =
|
|
941
|
-
sessionStorage.setItem(
|
|
942
|
+
const i = et(), u = await nt(i);
|
|
943
|
+
sessionStorage.setItem(F, i);
|
|
942
944
|
const d = new URL(
|
|
943
945
|
r.authorization_endpoint
|
|
944
946
|
);
|
|
@@ -951,8 +953,8 @@ class Ct extends xe {
|
|
|
951
953
|
isSignIn: !n,
|
|
952
954
|
isSignUp: n
|
|
953
955
|
});
|
|
954
|
-
const p =
|
|
955
|
-
sessionStorage.setItem(
|
|
956
|
+
const p = tt();
|
|
957
|
+
sessionStorage.setItem(M, p), d.searchParams.set("state", p), o ? location.replace(d.href) : location.href = d.href;
|
|
956
958
|
}
|
|
957
959
|
async getAccessToken() {
|
|
958
960
|
const e = await this.getAuthServer(), { providerData: n } = S.getState();
|
|
@@ -971,7 +973,7 @@ class Ct extends xe {
|
|
|
971
973
|
e,
|
|
972
974
|
this.client,
|
|
973
975
|
o.refreshToken
|
|
974
|
-
), r = await
|
|
976
|
+
), r = await fe(
|
|
975
977
|
e,
|
|
976
978
|
this.client,
|
|
977
979
|
s
|
|
@@ -1025,7 +1027,7 @@ class Ct extends xe {
|
|
|
1025
1027
|
o,
|
|
1026
1028
|
this.client,
|
|
1027
1029
|
n.refreshToken
|
|
1028
|
-
), r = await
|
|
1030
|
+
), r = await fe(
|
|
1029
1031
|
o,
|
|
1030
1032
|
this.client,
|
|
1031
1033
|
s
|
|
@@ -1046,42 +1048,42 @@ class Ct extends xe {
|
|
|
1046
1048
|
S.setState({ isPending: !1 });
|
|
1047
1049
|
};
|
|
1048
1050
|
handleCallback = async () => {
|
|
1049
|
-
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(
|
|
1050
|
-
if (sessionStorage.removeItem(
|
|
1051
|
+
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(M);
|
|
1052
|
+
if (sessionStorage.removeItem(M), n !== o)
|
|
1051
1053
|
throw new R("Invalid state parameter");
|
|
1052
|
-
const s = sessionStorage.getItem(
|
|
1053
|
-
if (sessionStorage.removeItem(
|
|
1054
|
+
const s = sessionStorage.getItem(F);
|
|
1055
|
+
if (sessionStorage.removeItem(F), !s)
|
|
1054
1056
|
throw new R("No code verifier found in state.");
|
|
1055
|
-
const r = await this.getAuthServer(), i =
|
|
1057
|
+
const r = await this.getAuthServer(), i = Ct(
|
|
1056
1058
|
r,
|
|
1057
1059
|
this.client,
|
|
1058
1060
|
e.searchParams,
|
|
1059
1061
|
n ?? void 0
|
|
1060
1062
|
);
|
|
1061
|
-
if (
|
|
1063
|
+
if (q(i))
|
|
1062
1064
|
throw ie.error("Error validating OAuth response", i), new re(
|
|
1063
1065
|
"Error validating OAuth response",
|
|
1064
1066
|
i
|
|
1065
1067
|
);
|
|
1066
1068
|
const u = new URL(e);
|
|
1067
1069
|
u.pathname = this.callbackUrlPath, u.search = "";
|
|
1068
|
-
const d = await
|
|
1070
|
+
const d = await _t(
|
|
1069
1071
|
r,
|
|
1070
1072
|
this.client,
|
|
1071
1073
|
i,
|
|
1072
1074
|
u.toString(),
|
|
1073
1075
|
s
|
|
1074
|
-
), y = await
|
|
1076
|
+
), y = await At(
|
|
1075
1077
|
r,
|
|
1076
1078
|
this.client,
|
|
1077
1079
|
d
|
|
1078
1080
|
);
|
|
1079
1081
|
this.setTokensFromResponse(y);
|
|
1080
|
-
const p = await this.getAccessToken(), b = await (await
|
|
1082
|
+
const p = await this.getAccessToken(), b = await (await pt(
|
|
1081
1083
|
r,
|
|
1082
1084
|
this.client,
|
|
1083
1085
|
p
|
|
1084
|
-
)).json(),
|
|
1086
|
+
)).json(), h = {
|
|
1085
1087
|
sub: b.sub,
|
|
1086
1088
|
email: b.email,
|
|
1087
1089
|
name: b.name,
|
|
@@ -1091,7 +1093,7 @@ class Ct extends xe {
|
|
|
1091
1093
|
S.setState({
|
|
1092
1094
|
isAuthenticated: !0,
|
|
1093
1095
|
isPending: !1,
|
|
1094
|
-
profile:
|
|
1096
|
+
profile: h
|
|
1095
1097
|
});
|
|
1096
1098
|
const P = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1097
1099
|
return sessionStorage.removeItem("redirect-to"), P;
|
|
@@ -1101,15 +1103,21 @@ class Ct extends xe {
|
|
|
1101
1103
|
...super.getRoutes(),
|
|
1102
1104
|
{
|
|
1103
1105
|
path: pe,
|
|
1104
|
-
element: /* @__PURE__ */
|
|
1106
|
+
element: /* @__PURE__ */ D.jsx(xe, { children: /* @__PURE__ */ D.jsx(
|
|
1107
|
+
Ue,
|
|
1108
|
+
{
|
|
1109
|
+
fallbackRender: ({ error: e }) => /* @__PURE__ */ D.jsx(Oe, { error: e }),
|
|
1110
|
+
children: /* @__PURE__ */ D.jsx(je, { handleCallback: this.handleCallback })
|
|
1111
|
+
}
|
|
1112
|
+
) })
|
|
1105
1113
|
}
|
|
1106
1114
|
];
|
|
1107
1115
|
}
|
|
1108
1116
|
}
|
|
1109
|
-
const
|
|
1117
|
+
const Ht = (t) => new It(t);
|
|
1110
1118
|
export {
|
|
1111
1119
|
pe as OPENID_CALLBACK_PATH,
|
|
1112
|
-
|
|
1113
|
-
|
|
1120
|
+
It as OpenIDAuthenticationProvider,
|
|
1121
|
+
Ht as default
|
|
1114
1122
|
};
|
|
1115
1123
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|