zudoku 0.26.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/main.d.ts +1 -1
- package/dist/app/main.js +19 -7
- package/dist/app/main.js.map +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +2 -2
- package/dist/config/validators/common.d.ts +78 -0
- package/dist/config/validators/common.js +6 -0
- package/dist/config/validators/common.js.map +1 -1
- package/dist/config/validators/validate.d.ts +34 -0
- package/dist/lib/authentication/providers/auth0.js +1 -1
- package/dist/lib/authentication/providers/auth0.js.map +1 -1
- package/dist/lib/authentication/providers/openid.d.ts +1 -1
- package/dist/lib/authentication/providers/openid.js +10 -6
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/AnchorLink.js +5 -2
- package/dist/lib/components/AnchorLink.js.map +1 -1
- package/dist/lib/components/Autocomplete.d.ts +12 -0
- package/dist/lib/components/Autocomplete.js +47 -0
- package/dist/lib/components/Autocomplete.js.map +1 -0
- package/dist/lib/components/Header.js +4 -4
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +1 -1
- package/dist/lib/components/Markdown.d.ts +2 -2
- package/dist/lib/components/Markdown.js +3 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/StatusPage.d.ts +7 -0
- package/dist/lib/components/StatusPage.js +71 -0
- package/dist/lib/components/StatusPage.js.map +1 -0
- package/dist/lib/components/SyntaxHighlight.d.ts +2 -1
- package/dist/lib/components/SyntaxHighlight.js +2 -2
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/ThemeSwitch.js +4 -4
- package/dist/lib/components/ThemeSwitch.js.map +1 -1
- package/dist/lib/components/cache.d.ts +6 -0
- package/dist/lib/components/cache.js +13 -0
- package/dist/lib/components/cache.js.map +1 -0
- package/dist/lib/components/context/ViewportAnchorContext.js +16 -4
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.js +2 -1
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/index.d.ts +9 -2
- package/dist/lib/components/index.js +5 -2
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/RouteGuard.d.ts +1 -0
- package/dist/lib/core/RouteGuard.js +28 -0
- package/dist/lib/core/RouteGuard.js.map +1 -0
- package/dist/lib/core/ZudokuContext.d.ts +4 -2
- package/dist/lib/core/ZudokuContext.js +9 -7
- package/dist/lib/core/ZudokuContext.js.map +1 -1
- package/dist/lib/oas/graphql/circular.d.ts +3 -0
- package/dist/lib/oas/graphql/circular.js +27 -0
- package/dist/lib/oas/graphql/circular.js.map +1 -0
- package/dist/lib/oas/graphql/index.js +5 -6
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/dereference/index.d.ts +0 -1
- package/dist/lib/oas/parser/dereference/index.js +1 -1
- package/dist/lib/oas/parser/dereference/index.js.map +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +8 -2
- 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/ParameterListItem.js +1 -1
- package/dist/lib/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.d.ts +3 -1
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js +3 -2
- package/dist/lib/plugins/openapi/PlaygroundDialogWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +3 -3
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +4 -11
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +7 -2
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +12 -0
- package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/Headers.js +67 -4
- package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/ParamsGrid.d.ts +5 -0
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js +4 -0
- package/dist/lib/plugins/openapi/playground/ParamsGrid.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/PathParams.js +4 -12
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +18 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +53 -40
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js +1 -1
- package/dist/lib/plugins/openapi/playground/PlaygroundDialog.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +21 -30
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/SubmitButton.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/SubmitButton.js +22 -0
- package/dist/lib/plugins/openapi/playground/SubmitButton.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js +11 -0
- package/dist/lib/plugins/openapi/playground/result-panel/RequestTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +95 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +7 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +16 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.d.ts +10 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js +32 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js +56 -0
- package/dist/lib/plugins/openapi/playground/result-panel/convertToTypes.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +2 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +5 -3
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +49 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeParameters.d.ts +10 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js +66 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js +131 -0
- package/dist/lib/plugins/openapi/post-processors/removeParameters.test.js.map +1 -0
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js +1 -1
- package/dist/lib/plugins/openapi/schema/SchemaComponents.js.map +1 -1
- package/dist/lib/ui/Command.d.ts +9 -1
- package/dist/lib/ui/Command.js +5 -1
- package/dist/lib/ui/Command.js.map +1 -1
- package/dist/lib/ui/Select.js +2 -2
- package/dist/lib/ui/Select.js.map +1 -1
- package/dist/lib/util/MdxComponents.js +2 -2
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/joinUrl.d.ts +1 -0
- package/dist/lib/util/joinUrl.js +40 -0
- package/dist/lib/util/joinUrl.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.d.ts +1 -0
- package/dist/lib/util/useScrollToAnchor.js +26 -15
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/dist/vite/build.js +10 -10
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.js +4 -1
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +4 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +1 -1
- package/dist/vite/plugin-api.js +31 -7
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +4 -1
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-mdx.js +9 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -2
- package/dist/vite/prerender.js +5 -4
- package/dist/vite/prerender.js.map +1 -1
- package/dist/zuplo/enrich-with-zuplo.d.ts +5 -0
- package/dist/zuplo/enrich-with-zuplo.js +184 -0
- package/dist/zuplo/enrich-with-zuplo.js.map +1 -0
- package/dist/zuplo/env.d.ts +1 -0
- package/dist/zuplo/env.js +3 -0
- package/dist/zuplo/env.js.map +1 -1
- package/dist/zuplo/policy-types.d.ts +33 -0
- package/dist/zuplo/policy-types.js +8 -0
- package/dist/zuplo/policy-types.js.map +1 -0
- package/dist/zuplo/with-zuplo-processors.d.ts +3 -0
- package/dist/zuplo/with-zuplo-processors.js +26 -0
- package/dist/zuplo/with-zuplo-processors.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +1 -1
- package/dist/zuplo/with-zuplo.js +7 -26
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/{AuthenticationPlugin-DNXBcsVN.js → AuthenticationPlugin-CO_YCd2x.js} +3 -3
- package/lib/{AuthenticationPlugin-DNXBcsVN.js.map → AuthenticationPlugin-CO_YCd2x.js.map} +1 -1
- package/lib/{Markdown-BrfrjEk_.js → Markdown-B8o9Qz4q.js} +1197 -1186
- package/lib/{Markdown-BrfrjEk_.js.map → Markdown-B8o9Qz4q.js.map} +1 -1
- package/lib/{MdxPage-LNZLj_A5.js → MdxPage-BxRt3Ly7.js} +63 -58
- package/lib/MdxPage-BxRt3Ly7.js.map +1 -0
- package/lib/OperationList-DH-zIgtq.js +5160 -0
- package/lib/OperationList-DH-zIgtq.js.map +1 -0
- package/lib/{Route-Pzk6qwIk.js → Route-DJ0ZlVq1.js} +3 -3
- package/lib/{Route-Pzk6qwIk.js.map → Route-DJ0ZlVq1.js.map} +1 -1
- package/lib/{Select-DkOpAG0c.js → Select-B7UXR0SB.js} +61 -61
- package/lib/Select-B7UXR0SB.js.map +1 -0
- package/lib/{SlotletProvider-DPbx9KdU.js → SlotletProvider-CtIp8rP3.js} +4 -4
- package/lib/{SlotletProvider-DPbx9KdU.js.map → SlotletProvider-CtIp8rP3.js.map} +1 -1
- package/lib/{Button-oroWHXAy.js → Spinner-BlzrEEk1.js} +15 -12
- package/lib/Spinner-BlzrEEk1.js.map +1 -0
- package/lib/{SyntaxHighlight-CJCSPG1F.js → SyntaxHighlight-C1w1QPdY.js} +300 -295
- package/lib/{SyntaxHighlight-CJCSPG1F.js.map → SyntaxHighlight-C1w1QPdY.js.map} +1 -1
- package/lib/{ZudokuContext-D3ayHjP-.js → ZudokuContext-8jts0fF3.js} +259 -248
- package/lib/ZudokuContext-8jts0fF3.js.map +1 -0
- package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js → chunk-SYFQ2XB5-BPvC-soB.js} +6 -5
- package/lib/{chunk-SYFQ2XB5-KWlHsT7t.js.map → chunk-SYFQ2XB5-BPvC-soB.js.map} +1 -1
- package/lib/circular-Dgpd6AN-.js +15397 -0
- package/lib/circular-Dgpd6AN-.js.map +1 -0
- package/lib/{createServer-BcaswoFO.js → createServer-BV0tHzLK.js} +3450 -5577
- package/lib/createServer-BV0tHzLK.js.map +1 -0
- package/lib/{hook-DUyACbIK.js → hook-BG02esyv.js} +2 -2
- package/lib/{hook-DUyACbIK.js.map → hook-BG02esyv.js.map} +1 -1
- package/lib/index-B7mqiOei.js +509 -0
- package/lib/index-B7mqiOei.js.map +1 -0
- package/lib/index-DmqsUPcm.js +1915 -0
- package/lib/index-DmqsUPcm.js.map +1 -0
- package/lib/joinUrl-BTy9bvoK.js +20 -0
- package/lib/joinUrl-BTy9bvoK.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +7 -7
- package/lib/post-processors/removeExtensions.js.map +1 -1
- package/lib/post-processors/removeParameters.js +48 -0
- package/lib/post-processors/removeParameters.js.map +1 -0
- package/lib/ui/ActionButton.js +10 -11
- package/lib/ui/ActionButton.js.map +1 -1
- package/lib/ui/Command.js +125 -13
- package/lib/ui/Command.js.map +1 -1
- package/lib/ui/Select.js +2 -2
- package/lib/ui/Select.js.map +1 -1
- package/lib/{useExposedProps-BBHR7aLM.js → useExposedProps-BLKFBylA.js} +2 -2
- package/lib/{useExposedProps-BBHR7aLM.js.map → useExposedProps-BLKFBylA.js.map} +1 -1
- package/lib/useScrollToAnchor-Bl6mz9_x.js +288 -0
- package/lib/useScrollToAnchor-Bl6mz9_x.js.map +1 -0
- package/lib/zudoku.auth-auth0.js +7 -9
- package/lib/zudoku.auth-auth0.js.map +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +223 -219
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +754 -992
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +5 -5
- package/lib/zudoku.plugin-custom-pages.js +2 -2
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +4 -4
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/package.json +2 -2
- package/src/app/main.css +50 -50
- package/src/app/main.tsx +26 -7
- package/src/lib/authentication/providers/auth0.tsx +1 -4
- package/src/lib/authentication/providers/openid.tsx +12 -5
- package/src/lib/components/AnchorLink.tsx +5 -2
- package/src/lib/components/Autocomplete.tsx +111 -0
- package/src/lib/components/Header.tsx +4 -4
- package/src/lib/components/Markdown.tsx +14 -15
- package/src/lib/components/StatusPage.tsx +91 -0
- package/src/lib/components/SyntaxHighlight.tsx +14 -0
- package/src/lib/components/ThemeSwitch.tsx +14 -15
- package/src/lib/components/cache.ts +15 -0
- package/src/lib/components/context/ViewportAnchorContext.tsx +20 -6
- package/src/lib/components/context/ZudokuContext.ts +3 -1
- package/src/lib/components/index.ts +9 -2
- package/src/lib/core/RouteGuard.tsx +35 -0
- package/src/lib/core/ZudokuContext.ts +9 -8
- package/src/lib/oas/graphql/circular.ts +29 -0
- package/src/lib/oas/graphql/index.ts +9 -9
- package/src/lib/oas/parser/dereference/index.ts +1 -2
- package/src/lib/plugins/markdown/MdxPage.tsx +9 -1
- package/src/lib/plugins/openapi/OperationListItem.tsx +0 -2
- package/src/lib/plugins/openapi/ParameterListItem.tsx +1 -0
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +5 -0
- package/src/lib/plugins/openapi/Sidecar.tsx +4 -2
- package/src/lib/plugins/openapi/index.tsx +9 -15
- package/src/lib/plugins/openapi/interfaces.ts +10 -2
- package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +54 -0
- package/src/lib/plugins/openapi/playground/Headers.tsx +136 -39
- package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +8 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +34 -74
- package/src/lib/plugins/openapi/playground/Playground.tsx +219 -177
- package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +1 -1
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +90 -122
- package/src/lib/plugins/openapi/playground/SubmitButton.tsx +75 -0
- package/src/lib/plugins/openapi/playground/result-panel/RequestTab.tsx +73 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +210 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +101 -0
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.test.ts +64 -0
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +58 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +7 -4
- package/src/lib/plugins/openapi/post-processors/removeParameters.test.ts +148 -0
- package/src/lib/plugins/openapi/post-processors/removeParameters.ts +101 -0
- package/src/lib/plugins/openapi/schema/SchemaComponents.tsx +1 -1
- package/src/lib/ui/Command.tsx +20 -0
- package/src/lib/ui/Select.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +2 -1
- package/src/lib/util/joinUrl.ts +57 -0
- package/src/lib/util/useScrollToAnchor.ts +32 -15
- package/dist/lib/plugins/openapi/playground/EnumSelector.d.ts +0 -8
- package/dist/lib/plugins/openapi/playground/EnumSelector.js +0 -21
- package/dist/lib/plugins/openapi/playground/EnumSelector.js.map +0 -1
- package/dist/lib/plugins/openapi/playground/ResponseTab.d.ts +0 -4
- package/dist/lib/plugins/openapi/playground/ResponseTab.js +0 -42
- package/dist/lib/plugins/openapi/playground/ResponseTab.js.map +0 -1
- package/lib/AnchorLink-_Vu02ceN.js +0 -34
- package/lib/AnchorLink-_Vu02ceN.js.map +0 -1
- package/lib/Button-oroWHXAy.js.map +0 -1
- package/lib/Command-D5DE0DD7.js +0 -611
- package/lib/Command-D5DE0DD7.js.map +0 -1
- package/lib/MdxPage-LNZLj_A5.js.map +0 -1
- package/lib/OperationList-PCwzTp1r.js +0 -5144
- package/lib/OperationList-PCwzTp1r.js.map +0 -1
- package/lib/Select-DkOpAG0c.js.map +0 -1
- package/lib/Spinner-C5gHXrVz.js +0 -7
- package/lib/Spinner-C5gHXrVz.js.map +0 -1
- package/lib/ZudokuContext-D3ayHjP-.js.map +0 -1
- package/lib/createServer-BcaswoFO.js.map +0 -1
- package/lib/index-CaILD1AV.js +0 -1292
- package/lib/index-CaILD1AV.js.map +0 -1
- package/lib/index-TaRXY2w1.js +0 -43
- package/lib/index-TaRXY2w1.js.map +0 -1
- package/src/lib/plugins/openapi/playground/EnumSelector.tsx +0 -86
- package/src/lib/plugins/openapi/playground/ResponseTab.tsx +0 -76
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var b = (t, e, n) =>
|
|
1
|
+
var Je = Object.defineProperty;
|
|
2
|
+
var Oe = (t, e, n) => e in t ? Je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var b = (t, e, n) => Oe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
4
|
import { j as G } from "./jsx-runtime-Bdg6XQ1m.js";
|
|
5
|
-
import { g as
|
|
6
|
-
import { C as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { g as ze } from "./_commonjsHelpers-BkfeUUK-.js";
|
|
6
|
+
import { C as De } from "./ClientOnly-E7hGysn1.js";
|
|
7
|
+
import { j as ae } from "./joinUrl-BTy9bvoK.js";
|
|
8
|
+
import { A as Ne } from "./AuthenticationPlugin-CO_YCd2x.js";
|
|
9
|
+
import { u as Ke } from "./ZudokuContext-8jts0fF3.js";
|
|
10
|
+
import { f as We } from "./chunk-SYFQ2XB5-BPvC-soB.js";
|
|
11
|
+
import { Z as He } from "./invariant-Caa8-XvF.js";
|
|
11
12
|
import { u as x } from "./state-mM7uaXTW.js";
|
|
12
|
-
var N = { exports: {} },
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
var N = { exports: {} }, $e = N.exports, se;
|
|
14
|
+
function Fe() {
|
|
15
|
+
return se || (se = 1, function(t) {
|
|
15
16
|
(function(e, n) {
|
|
16
17
|
t.exports ? t.exports = n() : e.log = n();
|
|
17
|
-
})(
|
|
18
|
+
})($e, function() {
|
|
18
19
|
var e = function() {
|
|
19
20
|
}, n = "undefined", o = typeof window !== n && typeof window.navigator !== n && /Trident\/|MSIE /.test(window.navigator.userAgent), a = [
|
|
20
21
|
"trace",
|
|
@@ -35,13 +36,13 @@ function $e() {
|
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
+
function h() {
|
|
39
40
|
console.log && (console.log.apply ? console.log.apply(console, arguments) : Function.prototype.apply.apply(console.log, [console, arguments])), console.trace && console.trace();
|
|
40
41
|
}
|
|
41
42
|
function _(l) {
|
|
42
|
-
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ?
|
|
43
|
+
return l === "debug" && (l = "log"), typeof console === n ? !1 : l === "trace" && o ? h : console[l] !== void 0 ? c(console, l) : console.log !== void 0 ? c(console, "log") : e;
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function p() {
|
|
45
46
|
for (var l = this.getLevel(), m = 0; m < a.length; m++) {
|
|
46
47
|
var u = a[m];
|
|
47
48
|
this[u] = m < l ? e : this.methodFactory(u, l, this.name);
|
|
@@ -51,16 +52,16 @@ function $e() {
|
|
|
51
52
|
}
|
|
52
53
|
function y(l) {
|
|
53
54
|
return function() {
|
|
54
|
-
typeof console !== n && (
|
|
55
|
+
typeof console !== n && (p.call(this), this[l].apply(this, arguments));
|
|
55
56
|
};
|
|
56
57
|
}
|
|
57
58
|
function T(l, m, u) {
|
|
58
59
|
return _(l) || y.apply(this, arguments);
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
+
function f(l, m) {
|
|
61
62
|
var u = this, O, M, R, v = "loglevel";
|
|
62
63
|
typeof l == "string" ? v += ":" + l : typeof l == "symbol" && (v = void 0);
|
|
63
|
-
function
|
|
64
|
+
function Le(d) {
|
|
64
65
|
var g = (a[d] || "silent").toUpperCase();
|
|
65
66
|
if (!(typeof window === n || !v)) {
|
|
66
67
|
try {
|
|
@@ -92,7 +93,7 @@ function $e() {
|
|
|
92
93
|
return u.levels[d] === void 0 && (d = void 0), d;
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
+
function je() {
|
|
96
97
|
if (!(typeof window === n || !v)) {
|
|
97
98
|
try {
|
|
98
99
|
window.localStorage.removeItem(v);
|
|
@@ -120,30 +121,30 @@ function $e() {
|
|
|
120
121
|
}, u.methodFactory = m || T, u.getLevel = function() {
|
|
121
122
|
return R ?? M ?? O;
|
|
122
123
|
}, u.setLevel = function(d, g) {
|
|
123
|
-
return R = U(d), g !== !1 &&
|
|
124
|
+
return R = U(d), g !== !1 && Le(R), p.call(u);
|
|
124
125
|
}, u.setDefaultLevel = function(d) {
|
|
125
126
|
M = U(d), re() || u.setLevel(d, !1);
|
|
126
127
|
}, u.resetLevel = function() {
|
|
127
|
-
R = null,
|
|
128
|
+
R = null, je(), p.call(u);
|
|
128
129
|
}, u.enableAll = function(d) {
|
|
129
130
|
u.setLevel(u.levels.TRACE, d);
|
|
130
131
|
}, u.disableAll = function(d) {
|
|
131
132
|
u.setLevel(u.levels.SILENT, d);
|
|
132
133
|
}, u.rebuild = function() {
|
|
133
|
-
if (i !== u && (O = U(i.getLevel())),
|
|
134
|
+
if (i !== u && (O = U(i.getLevel())), p.call(u), i === u)
|
|
134
135
|
for (var d in r)
|
|
135
136
|
r[d].rebuild();
|
|
136
137
|
}, O = U(
|
|
137
138
|
i ? i.getLevel() : "WARN"
|
|
138
139
|
);
|
|
139
140
|
var oe = re();
|
|
140
|
-
oe != null && (R = U(oe)),
|
|
141
|
+
oe != null && (R = U(oe)), p.call(u);
|
|
141
142
|
}
|
|
142
|
-
i = new
|
|
143
|
+
i = new f(), i.getLogger = function(m) {
|
|
143
144
|
if (typeof m != "symbol" && typeof m != "string" || m === "")
|
|
144
145
|
throw new TypeError("You must supply a name when creating a logger.");
|
|
145
146
|
var u = r[m];
|
|
146
|
-
return u || (u = r[m] = new
|
|
147
|
+
return u || (u = r[m] = new f(
|
|
147
148
|
m,
|
|
148
149
|
i.methodFactory
|
|
149
150
|
)), u;
|
|
@@ -157,11 +158,11 @@ function $e() {
|
|
|
157
158
|
});
|
|
158
159
|
}(N)), N.exports;
|
|
159
160
|
}
|
|
160
|
-
var
|
|
161
|
-
const
|
|
161
|
+
var Me = Fe();
|
|
162
|
+
const ce = /* @__PURE__ */ ze(Me);
|
|
162
163
|
let Z;
|
|
163
|
-
var D,
|
|
164
|
-
(typeof navigator > "u" || !((
|
|
164
|
+
var D, me;
|
|
165
|
+
(typeof navigator > "u" || !((me = (D = navigator.userAgent) == null ? void 0 : D.startsWith) != null && me.call(D, "Mozilla/5.0 "))) && (Z = "oauth4webapi/v2.17.0");
|
|
165
166
|
function Q(t, e) {
|
|
166
167
|
if (t == null)
|
|
167
168
|
return !1;
|
|
@@ -171,19 +172,19 @@ function Q(t, e) {
|
|
|
171
172
|
return !1;
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
|
-
const W = Symbol(),
|
|
175
|
+
const W = Symbol(), qe = Symbol(), X = Symbol(), ge = Symbol(), Be = Symbol(), Ve = Symbol(), Ge = new TextEncoder(), Ze = new TextDecoder();
|
|
175
176
|
function E(t) {
|
|
176
|
-
return typeof t == "string" ?
|
|
177
|
+
return typeof t == "string" ? Ge.encode(t) : Ze.decode(t);
|
|
177
178
|
}
|
|
178
|
-
const
|
|
179
|
-
function
|
|
179
|
+
const ue = 32768;
|
|
180
|
+
function Ye(t) {
|
|
180
181
|
t instanceof ArrayBuffer && (t = new Uint8Array(t));
|
|
181
182
|
const e = [];
|
|
182
|
-
for (let n = 0; n < t.byteLength; n +=
|
|
183
|
-
e.push(String.fromCharCode.apply(null, t.subarray(n, n +
|
|
183
|
+
for (let n = 0; n < t.byteLength; n += ue)
|
|
184
|
+
e.push(String.fromCharCode.apply(null, t.subarray(n, n + ue)));
|
|
184
185
|
return btoa(e.join("")).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function Qe(t) {
|
|
187
188
|
try {
|
|
188
189
|
const e = atob(t.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, "")), n = new Uint8Array(e.length);
|
|
189
190
|
for (let o = 0; o < e.length; o++)
|
|
@@ -194,9 +195,9 @@ function Ye(t) {
|
|
|
194
195
|
}
|
|
195
196
|
}
|
|
196
197
|
function A(t) {
|
|
197
|
-
return typeof t == "string" ?
|
|
198
|
+
return typeof t == "string" ? Qe(t) : Ye(t);
|
|
198
199
|
}
|
|
199
|
-
class
|
|
200
|
+
class Xe {
|
|
200
201
|
constructor(e) {
|
|
201
202
|
this.cache = /* @__PURE__ */ new Map(), this._cache = /* @__PURE__ */ new Map(), this.maxSize = e;
|
|
202
203
|
}
|
|
@@ -226,26 +227,26 @@ class S extends Error {
|
|
|
226
227
|
super(e ?? "operation not supported"), this.name = this.constructor.name, (n = Error.captureStackTrace) == null || n.call(Error, this, this.constructor);
|
|
227
228
|
}
|
|
228
229
|
}
|
|
229
|
-
class
|
|
230
|
+
class et extends Error {
|
|
230
231
|
constructor(e, n) {
|
|
231
232
|
var o;
|
|
232
233
|
super(e, n), this.name = this.constructor.name, (o = Error.captureStackTrace) == null || o.call(Error, this, this.constructor);
|
|
233
234
|
}
|
|
234
235
|
}
|
|
235
|
-
const s =
|
|
236
|
-
function
|
|
236
|
+
const s = et, ye = new Xe(100);
|
|
237
|
+
function be(t) {
|
|
237
238
|
return t instanceof CryptoKey;
|
|
238
239
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
240
|
+
function _e(t) {
|
|
241
|
+
return be(t) && t.type === "private";
|
|
241
242
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
243
|
+
function tt(t) {
|
|
244
|
+
return be(t) && t.type === "public";
|
|
244
245
|
}
|
|
245
246
|
function ee(t) {
|
|
246
247
|
try {
|
|
247
248
|
const e = t.headers.get("dpop-nonce");
|
|
248
|
-
e &&
|
|
249
|
+
e && ye.set(new URL(t.url).origin, e);
|
|
249
250
|
} catch {
|
|
250
251
|
}
|
|
251
252
|
return t;
|
|
@@ -267,7 +268,7 @@ function te(t) {
|
|
|
267
268
|
throw new TypeError('"options.signal" must return or be an instance of AbortSignal');
|
|
268
269
|
return t;
|
|
269
270
|
}
|
|
270
|
-
async function
|
|
271
|
+
async function nt(t, e) {
|
|
271
272
|
if (!(t instanceof URL))
|
|
272
273
|
throw new TypeError('"issuerIdentifier" must be an instance of URL');
|
|
273
274
|
if (t.protocol !== "https:" && t.protocol !== "http:")
|
|
@@ -295,7 +296,7 @@ async function tt(t, e) {
|
|
|
295
296
|
function w(t) {
|
|
296
297
|
return typeof t == "string" && t.length !== 0;
|
|
297
298
|
}
|
|
298
|
-
async function
|
|
299
|
+
async function rt(t, e) {
|
|
299
300
|
if (!(t instanceof URL))
|
|
300
301
|
throw new TypeError('"expectedIssuer" must be an instance of URL');
|
|
301
302
|
if (!Q(e, Response))
|
|
@@ -320,18 +321,18 @@ async function nt(t, e) {
|
|
|
320
321
|
function $() {
|
|
321
322
|
return A(crypto.getRandomValues(new Uint8Array(32)));
|
|
322
323
|
}
|
|
323
|
-
function
|
|
324
|
+
function ot() {
|
|
324
325
|
return $();
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function it() {
|
|
327
328
|
return $();
|
|
328
329
|
}
|
|
329
|
-
async function
|
|
330
|
+
async function at(t) {
|
|
330
331
|
if (!w(t))
|
|
331
332
|
throw new TypeError('"codeVerifier" must be a non-empty string');
|
|
332
333
|
return A(await crypto.subtle.digest("SHA-256", E(t)));
|
|
333
334
|
}
|
|
334
|
-
function
|
|
335
|
+
function st(t) {
|
|
335
336
|
if (t instanceof CryptoKey)
|
|
336
337
|
return { key: t };
|
|
337
338
|
if (!((t == null ? void 0 : t.key) instanceof CryptoKey))
|
|
@@ -341,17 +342,17 @@ function at(t) {
|
|
|
341
342
|
return {
|
|
342
343
|
key: t.key,
|
|
343
344
|
kid: t.kid,
|
|
344
|
-
modifyAssertion: t[
|
|
345
|
+
modifyAssertion: t[ge]
|
|
345
346
|
};
|
|
346
347
|
}
|
|
347
|
-
function
|
|
348
|
+
function le(t) {
|
|
348
349
|
return encodeURIComponent(t).replace(/%20/g, "+");
|
|
349
350
|
}
|
|
350
|
-
function
|
|
351
|
-
const n =
|
|
351
|
+
function ct(t, e) {
|
|
352
|
+
const n = le(t), o = le(e);
|
|
352
353
|
return `Basic ${btoa(`${n}:${o}`)}`;
|
|
353
354
|
}
|
|
354
|
-
function
|
|
355
|
+
function ut(t) {
|
|
355
356
|
switch (t.algorithm.hash.name) {
|
|
356
357
|
case "SHA-256":
|
|
357
358
|
return "PS256";
|
|
@@ -363,7 +364,7 @@ function ct(t) {
|
|
|
363
364
|
throw new S("unsupported RsaHashedKeyAlgorithm hash name");
|
|
364
365
|
}
|
|
365
366
|
}
|
|
366
|
-
function
|
|
367
|
+
function lt(t) {
|
|
367
368
|
switch (t.algorithm.hash.name) {
|
|
368
369
|
case "SHA-256":
|
|
369
370
|
return "RS256";
|
|
@@ -375,7 +376,7 @@ function ut(t) {
|
|
|
375
376
|
throw new S("unsupported RsaHashedKeyAlgorithm hash name");
|
|
376
377
|
}
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function dt(t) {
|
|
379
380
|
switch (t.algorithm.namedCurve) {
|
|
380
381
|
case "P-256":
|
|
381
382
|
return "ES256";
|
|
@@ -387,14 +388,14 @@ function lt(t) {
|
|
|
387
388
|
throw new S("unsupported EcKeyAlgorithm namedCurve");
|
|
388
389
|
}
|
|
389
390
|
}
|
|
390
|
-
function
|
|
391
|
+
function ve(t) {
|
|
391
392
|
switch (t.algorithm.name) {
|
|
392
393
|
case "RSA-PSS":
|
|
393
|
-
return ct(t);
|
|
394
|
-
case "RSASSA-PKCS1-v1_5":
|
|
395
394
|
return ut(t);
|
|
396
|
-
case "
|
|
395
|
+
case "RSASSA-PKCS1-v1_5":
|
|
397
396
|
return lt(t);
|
|
397
|
+
case "ECDSA":
|
|
398
|
+
return dt(t);
|
|
398
399
|
case "Ed25519":
|
|
399
400
|
case "Ed448":
|
|
400
401
|
return "EdDSA";
|
|
@@ -406,14 +407,14 @@ function L(t) {
|
|
|
406
407
|
const e = t == null ? void 0 : t[W];
|
|
407
408
|
return typeof e == "number" && Number.isFinite(e) ? e : 0;
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
-
const e = t == null ? void 0 : t[
|
|
410
|
+
function Se(t) {
|
|
411
|
+
const e = t == null ? void 0 : t[qe];
|
|
411
412
|
return typeof e == "number" && Number.isFinite(e) && Math.sign(e) !== -1 ? e : 30;
|
|
412
413
|
}
|
|
413
414
|
function F() {
|
|
414
415
|
return Math.floor(Date.now() / 1e3);
|
|
415
416
|
}
|
|
416
|
-
function
|
|
417
|
+
function ht(t, e) {
|
|
417
418
|
const n = F() + L(e);
|
|
418
419
|
return {
|
|
419
420
|
jti: $(),
|
|
@@ -425,25 +426,25 @@ function dt(t, e) {
|
|
|
425
426
|
sub: e.client_id
|
|
426
427
|
};
|
|
427
428
|
}
|
|
428
|
-
async function
|
|
429
|
-
const r = { alg:
|
|
430
|
-
return a == null || a(r, i),
|
|
429
|
+
async function ft(t, e, n, o, a) {
|
|
430
|
+
const r = { alg: ve(n), kid: o }, i = ht(t, e);
|
|
431
|
+
return a == null || a(r, i), Te(r, i, n);
|
|
431
432
|
}
|
|
432
|
-
function
|
|
433
|
+
function j(t) {
|
|
433
434
|
if (typeof t != "object" || t === null)
|
|
434
435
|
throw new TypeError('"as" must be an object');
|
|
435
436
|
if (!w(t.issuer))
|
|
436
437
|
throw new TypeError('"as.issuer" property must be a non-empty string');
|
|
437
438
|
return !0;
|
|
438
439
|
}
|
|
439
|
-
function
|
|
440
|
+
function I(t) {
|
|
440
441
|
if (typeof t != "object" || t === null)
|
|
441
442
|
throw new TypeError('"client" must be an object');
|
|
442
443
|
if (!w(t.client_id))
|
|
443
444
|
throw new TypeError('"client.client_id" property must be a non-empty string');
|
|
444
445
|
return !0;
|
|
445
446
|
}
|
|
446
|
-
function
|
|
447
|
+
function de(t) {
|
|
447
448
|
if (!w(t))
|
|
448
449
|
throw new TypeError('"client.client_secret" property must be a non-empty string');
|
|
449
450
|
return t;
|
|
@@ -452,100 +453,100 @@ function q(t, e) {
|
|
|
452
453
|
if (e !== void 0)
|
|
453
454
|
throw new TypeError(`"options.clientPrivateKey" property must not be provided when ${t} client authentication method is used.`);
|
|
454
455
|
}
|
|
455
|
-
function
|
|
456
|
+
function he(t, e) {
|
|
456
457
|
if (e !== void 0)
|
|
457
458
|
throw new TypeError(`"client.client_secret" property must not be provided when ${t} client authentication method is used.`);
|
|
458
459
|
}
|
|
459
|
-
async function
|
|
460
|
+
async function pt(t, e, n, o, a) {
|
|
460
461
|
switch (n.delete("client_secret"), n.delete("client_assertion_type"), n.delete("client_assertion"), e.token_endpoint_auth_method) {
|
|
461
462
|
case void 0:
|
|
462
463
|
case "client_secret_basic": {
|
|
463
|
-
q("client_secret_basic", a), o.set("authorization",
|
|
464
|
+
q("client_secret_basic", a), o.set("authorization", ct(e.client_id, de(e.client_secret)));
|
|
464
465
|
break;
|
|
465
466
|
}
|
|
466
467
|
case "client_secret_post": {
|
|
467
|
-
q("client_secret_post", a), n.set("client_id", e.client_id), n.set("client_secret",
|
|
468
|
+
q("client_secret_post", a), n.set("client_id", e.client_id), n.set("client_secret", de(e.client_secret));
|
|
468
469
|
break;
|
|
469
470
|
}
|
|
470
471
|
case "private_key_jwt": {
|
|
471
|
-
if (
|
|
472
|
+
if (he("private_key_jwt", e.client_secret), a === void 0)
|
|
472
473
|
throw new TypeError('"options.clientPrivateKey" must be provided when "client.token_endpoint_auth_method" is "private_key_jwt"');
|
|
473
|
-
const { key: r, kid: i, modifyAssertion: c } =
|
|
474
|
-
if (!
|
|
474
|
+
const { key: r, kid: i, modifyAssertion: c } = st(a);
|
|
475
|
+
if (!_e(r))
|
|
475
476
|
throw new TypeError('"options.clientPrivateKey.key" must be a private CryptoKey');
|
|
476
|
-
n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await
|
|
477
|
+
n.set("client_id", e.client_id), n.set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), n.set("client_assertion", await ft(t, e, r, i, c));
|
|
477
478
|
break;
|
|
478
479
|
}
|
|
479
480
|
case "tls_client_auth":
|
|
480
481
|
case "self_signed_tls_client_auth":
|
|
481
482
|
case "none": {
|
|
482
|
-
|
|
483
|
+
he(e.token_endpoint_auth_method, e.client_secret), q(e.token_endpoint_auth_method, a), n.set("client_id", e.client_id);
|
|
483
484
|
break;
|
|
484
485
|
}
|
|
485
486
|
default:
|
|
486
487
|
throw new S("unsupported client token_endpoint_auth_method");
|
|
487
488
|
}
|
|
488
489
|
}
|
|
489
|
-
async function
|
|
490
|
+
async function Te(t, e, n) {
|
|
490
491
|
if (!n.usages.includes("sign"))
|
|
491
492
|
throw new TypeError('CryptoKey instances used for signing assertions must include "sign" in their "usages"');
|
|
492
|
-
const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, a = A(await crypto.subtle.sign(
|
|
493
|
+
const o = `${A(E(JSON.stringify(t)))}.${A(E(JSON.stringify(e)))}`, a = A(await crypto.subtle.sign(xe(n), n, E(o)));
|
|
493
494
|
return `${o}.${a}`;
|
|
494
495
|
}
|
|
495
|
-
async function
|
|
496
|
+
async function wt(t, e, n, o, a, r) {
|
|
496
497
|
var T;
|
|
497
|
-
const { privateKey: i, publicKey: c, nonce:
|
|
498
|
-
if (!
|
|
498
|
+
const { privateKey: i, publicKey: c, nonce: h = ye.get(n.origin) } = e;
|
|
499
|
+
if (!_e(i))
|
|
499
500
|
throw new TypeError('"DPoP.privateKey" must be a private CryptoKey');
|
|
500
|
-
if (!
|
|
501
|
+
if (!tt(c))
|
|
501
502
|
throw new TypeError('"DPoP.publicKey" must be a public CryptoKey');
|
|
502
|
-
if (
|
|
503
|
+
if (h !== void 0 && !w(h))
|
|
503
504
|
throw new TypeError('"DPoP.nonce" must be a non-empty string or undefined');
|
|
504
505
|
if (!c.extractable)
|
|
505
506
|
throw new TypeError('"DPoP.publicKey.extractable" must be true');
|
|
506
|
-
const _ = F() + a,
|
|
507
|
-
alg:
|
|
507
|
+
const _ = F() + a, p = {
|
|
508
|
+
alg: ve(i),
|
|
508
509
|
typ: "dpop+jwt",
|
|
509
|
-
jwk: await
|
|
510
|
+
jwk: await gt(c)
|
|
510
511
|
}, y = {
|
|
511
512
|
iat: _,
|
|
512
513
|
jti: $(),
|
|
513
514
|
htm: o,
|
|
514
|
-
nonce:
|
|
515
|
+
nonce: h,
|
|
515
516
|
htu: `${n.origin}${n.pathname}`,
|
|
516
517
|
ath: r ? A(await crypto.subtle.digest("SHA-256", E(r))) : void 0
|
|
517
518
|
};
|
|
518
|
-
(T = e[
|
|
519
|
+
(T = e[ge]) == null || T.call(e, p, y), t.set("dpop", await Te(p, y, i));
|
|
519
520
|
}
|
|
520
521
|
let K;
|
|
521
|
-
async function
|
|
522
|
+
async function mt(t) {
|
|
522
523
|
const { kty: e, e: n, n: o, x: a, y: r, crv: i } = await crypto.subtle.exportKey("jwk", t), c = { kty: e, e: n, n: o, x: a, y: r, crv: i };
|
|
523
524
|
return K.set(t, c), c;
|
|
524
525
|
}
|
|
525
|
-
async function
|
|
526
|
-
return K || (K = /* @__PURE__ */ new WeakMap()), K.get(t) ||
|
|
526
|
+
async function gt(t) {
|
|
527
|
+
return K || (K = /* @__PURE__ */ new WeakMap()), K.get(t) || mt(t);
|
|
527
528
|
}
|
|
528
|
-
function
|
|
529
|
+
function fe(t, e, n) {
|
|
529
530
|
if (typeof t != "string")
|
|
530
531
|
throw n ? new TypeError(`"as.mtls_endpoint_aliases.${e}" must be a string`) : new TypeError(`"as.${e}" must be a string`);
|
|
531
532
|
return new URL(t);
|
|
532
533
|
}
|
|
533
|
-
function
|
|
534
|
-
return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ?
|
|
534
|
+
function ke(t, e, n = !1) {
|
|
535
|
+
return n && t.mtls_endpoint_aliases && e in t.mtls_endpoint_aliases ? fe(t.mtls_endpoint_aliases[e], e, n) : fe(t[e], e, n);
|
|
535
536
|
}
|
|
536
|
-
function
|
|
537
|
-
return !!(t.use_mtls_endpoint_aliases || e != null && e[
|
|
537
|
+
function Ae(t, e) {
|
|
538
|
+
return !!(t.use_mtls_endpoint_aliases || e != null && e[Ve]);
|
|
538
539
|
}
|
|
539
540
|
function Y(t) {
|
|
540
541
|
const e = t;
|
|
541
542
|
return typeof e != "object" || Array.isArray(e) || e === null ? !1 : e.error !== void 0;
|
|
542
543
|
}
|
|
543
|
-
async function
|
|
544
|
+
async function yt(t, e, n, o, a, r) {
|
|
544
545
|
if (!w(t))
|
|
545
546
|
throw new TypeError('"accessToken" must be a non-empty string');
|
|
546
547
|
if (!(n instanceof URL))
|
|
547
548
|
throw new TypeError('"url" must be an instance of URL');
|
|
548
|
-
return o = H(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await
|
|
549
|
+
return o = H(o), (r == null ? void 0 : r.DPoP) === void 0 ? o.set("authorization", `Bearer ${t}`) : (await wt(o, r.DPoP, n, e.toUpperCase(), L({ [W]: r == null ? void 0 : r[W] }), t), o.set("authorization", `DPoP ${t}`)), ((r == null ? void 0 : r[X]) || fetch)(n.href, {
|
|
549
550
|
body: a,
|
|
550
551
|
headers: Object.fromEntries(o.entries()),
|
|
551
552
|
method: e,
|
|
@@ -553,16 +554,16 @@ async function gt(t, e, n, o, a, r) {
|
|
|
553
554
|
signal: r != null && r.signal ? te(r.signal) : null
|
|
554
555
|
}).then(ee);
|
|
555
556
|
}
|
|
556
|
-
async function
|
|
557
|
-
|
|
558
|
-
const a =
|
|
559
|
-
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")),
|
|
557
|
+
async function bt(t, e, n, o) {
|
|
558
|
+
j(t), I(e);
|
|
559
|
+
const a = ke(t, "userinfo_endpoint", Ae(e, o)), r = H(o == null ? void 0 : o.headers);
|
|
560
|
+
return e.userinfo_signed_response_alg ? r.set("accept", "application/jwt") : (r.set("accept", "application/json"), r.append("accept", "application/jwt")), yt(n, "GET", a, r, null, {
|
|
560
561
|
...o,
|
|
561
562
|
[W]: L(e)
|
|
562
563
|
});
|
|
563
564
|
}
|
|
564
|
-
async function
|
|
565
|
-
return await
|
|
565
|
+
async function _t(t, e, n, o, a, r, i) {
|
|
566
|
+
return await pt(t, e, a, r, i == null ? void 0 : i.clientPrivateKey), r.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"), ((i == null ? void 0 : i[X]) || fetch)(o.href, {
|
|
566
567
|
body: a,
|
|
567
568
|
headers: Object.fromEntries(r.entries()),
|
|
568
569
|
method: n,
|
|
@@ -570,33 +571,33 @@ async function bt(t, e, n, o, a, r, i) {
|
|
|
570
571
|
signal: i != null && i.signal ? te(i.signal) : null
|
|
571
572
|
}).then(ee);
|
|
572
573
|
}
|
|
573
|
-
async function
|
|
574
|
-
const r =
|
|
574
|
+
async function Ee(t, e, n, o, a) {
|
|
575
|
+
const r = ke(t, "token_endpoint", Ae(e, a));
|
|
575
576
|
o.set("grant_type", n);
|
|
576
577
|
const i = H(a == null ? void 0 : a.headers);
|
|
577
|
-
return i.set("accept", "application/json"),
|
|
578
|
+
return i.set("accept", "application/json"), _t(t, e, "POST", r, o, i, a);
|
|
578
579
|
}
|
|
579
|
-
async function
|
|
580
|
-
if (
|
|
580
|
+
async function vt(t, e, n, o) {
|
|
581
|
+
if (j(t), I(e), !w(n))
|
|
581
582
|
throw new TypeError('"refreshToken" must be a non-empty string');
|
|
582
583
|
const a = new URLSearchParams(o == null ? void 0 : o.additionalParameters);
|
|
583
|
-
return a.set("refresh_token", n),
|
|
584
|
+
return a.set("refresh_token", n), Ee(t, e, "refresh_token", a, o);
|
|
584
585
|
}
|
|
585
|
-
const
|
|
586
|
-
function
|
|
586
|
+
const Re = /* @__PURE__ */ new WeakMap();
|
|
587
|
+
function St(t) {
|
|
587
588
|
if (!t.id_token)
|
|
588
589
|
return;
|
|
589
|
-
const e =
|
|
590
|
+
const e = Re.get(t);
|
|
590
591
|
if (!e)
|
|
591
592
|
throw new TypeError('"ref" was already garbage collected or did not resolve from the proper sources');
|
|
592
593
|
return e[0];
|
|
593
594
|
}
|
|
594
|
-
async function
|
|
595
|
-
if (
|
|
595
|
+
async function Pe(t, e, n, o = !1, a = !1) {
|
|
596
|
+
if (j(t), I(e), !Q(n, Response))
|
|
596
597
|
throw new TypeError('"response" must be an instance of Response');
|
|
597
598
|
if (n.status !== 200) {
|
|
598
599
|
let i;
|
|
599
|
-
if (i = await
|
|
600
|
+
if (i = await Lt(n))
|
|
600
601
|
return i;
|
|
601
602
|
throw new s('"response" is not a conform Token Endpoint response');
|
|
602
603
|
}
|
|
@@ -625,7 +626,7 @@ async function Re(t, e, n, o = !1, a = !1) {
|
|
|
625
626
|
if (r.id_token !== void 0 && !w(r.id_token))
|
|
626
627
|
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
627
628
|
if (r.id_token) {
|
|
628
|
-
const { claims: i, jwt: c } = await
|
|
629
|
+
const { claims: i, jwt: c } = await Jt(r.id_token, Ot.bind(void 0, e.id_token_signed_response_alg, t.id_token_signing_alg_values_supported), Ce, L(e), Se(e), e[Be]).then(Ut.bind(void 0, ["aud", "exp", "iat", "iss", "sub"])).then(At.bind(void 0, t.issuer)).then(kt.bind(void 0, e.client_id));
|
|
629
630
|
if (Array.isArray(i.aud) && i.aud.length !== 1) {
|
|
630
631
|
if (i.azp === void 0)
|
|
631
632
|
throw new s('ID Token "aud" (audience) claim includes additional untrusted audiences');
|
|
@@ -634,15 +635,15 @@ async function Re(t, e, n, o = !1, a = !1) {
|
|
|
634
635
|
}
|
|
635
636
|
if (i.auth_time !== void 0 && (!Number.isFinite(i.auth_time) || Math.sign(i.auth_time) !== 1))
|
|
636
637
|
throw new s('ID Token "auth_time" (authentication time) must be a positive number');
|
|
637
|
-
|
|
638
|
+
Re.set(r, [i, c]);
|
|
638
639
|
}
|
|
639
640
|
}
|
|
640
641
|
return r;
|
|
641
642
|
}
|
|
642
|
-
async function
|
|
643
|
-
return
|
|
643
|
+
async function Tt(t, e, n) {
|
|
644
|
+
return Pe(t, e, n);
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
+
function kt(t, e) {
|
|
646
647
|
if (Array.isArray(e.claims.aud)) {
|
|
647
648
|
if (!e.claims.aud.includes(t))
|
|
648
649
|
throw new s('unexpected JWT "aud" (audience) claim value');
|
|
@@ -650,17 +651,17 @@ function Tt(t, e) {
|
|
|
650
651
|
throw new s('unexpected JWT "aud" (audience) claim value');
|
|
651
652
|
return e;
|
|
652
653
|
}
|
|
653
|
-
function
|
|
654
|
+
function At(t, e) {
|
|
654
655
|
if (e.claims.iss !== t)
|
|
655
656
|
throw new s('unexpected JWT "iss" (issuer) claim value');
|
|
656
657
|
return e;
|
|
657
658
|
}
|
|
658
|
-
const
|
|
659
|
-
function
|
|
660
|
-
return
|
|
659
|
+
const Ue = /* @__PURE__ */ new WeakSet();
|
|
660
|
+
function Et(t) {
|
|
661
|
+
return Ue.add(t), t;
|
|
661
662
|
}
|
|
662
|
-
async function
|
|
663
|
-
if (
|
|
663
|
+
async function Rt(t, e, n, o, a, r) {
|
|
664
|
+
if (j(t), I(e), !Ue.has(n))
|
|
664
665
|
throw new TypeError('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()');
|
|
665
666
|
if (!w(o))
|
|
666
667
|
throw new TypeError('"redirectUri" must be a non-empty string');
|
|
@@ -670,9 +671,9 @@ async function Et(t, e, n, o, a, r) {
|
|
|
670
671
|
if (!i)
|
|
671
672
|
throw new s('no authorization code in "callbackParameters"');
|
|
672
673
|
const c = new URLSearchParams(r == null ? void 0 : r.additionalParameters);
|
|
673
|
-
return c.set("redirect_uri", o), c.set("code_verifier", a), c.set("code", i),
|
|
674
|
+
return c.set("redirect_uri", o), c.set("code_verifier", a), c.set("code", i), Ee(t, e, "authorization_code", c, r);
|
|
674
675
|
}
|
|
675
|
-
const
|
|
676
|
+
const Pt = {
|
|
676
677
|
aud: "audience",
|
|
677
678
|
c_hash: "code hash",
|
|
678
679
|
client_id: "client id",
|
|
@@ -688,33 +689,33 @@ const Rt = {
|
|
|
688
689
|
htu: "http uri",
|
|
689
690
|
cnf: "confirmation"
|
|
690
691
|
};
|
|
691
|
-
function
|
|
692
|
+
function Ut(t, e) {
|
|
692
693
|
for (const n of t)
|
|
693
694
|
if (e.claims[n] === void 0)
|
|
694
|
-
throw new s(`JWT "${n}" (${
|
|
695
|
+
throw new s(`JWT "${n}" (${Pt[n]}) claim missing`);
|
|
695
696
|
return e;
|
|
696
697
|
}
|
|
697
|
-
const
|
|
698
|
-
async function
|
|
699
|
-
const r = await
|
|
698
|
+
const xt = Symbol(), B = Symbol();
|
|
699
|
+
async function Ct(t, e, n, o, a) {
|
|
700
|
+
const r = await Pe(t, e, n);
|
|
700
701
|
if (Y(r))
|
|
701
702
|
return r;
|
|
702
703
|
if (!w(r.id_token))
|
|
703
704
|
throw new s('"response" body "id_token" property must be a non-empty string');
|
|
704
705
|
a ?? (a = e.default_max_age ?? B);
|
|
705
|
-
const i =
|
|
706
|
+
const i = St(r);
|
|
706
707
|
if ((e.require_auth_time || a !== B) && i.auth_time === void 0)
|
|
707
708
|
throw new s('ID Token "auth_time" (authentication time) claim missing');
|
|
708
709
|
if (a !== B) {
|
|
709
710
|
if (typeof a != "number" || a < 0)
|
|
710
711
|
throw new TypeError('"maxAge" must be a non-negative number');
|
|
711
|
-
const c = F() + L(e),
|
|
712
|
-
if (i.auth_time + a < c -
|
|
712
|
+
const c = F() + L(e), h = Se(e);
|
|
713
|
+
if (i.auth_time + a < c - h)
|
|
713
714
|
throw new s("too much time has elapsed since the last End-User authentication");
|
|
714
715
|
}
|
|
715
716
|
switch (o) {
|
|
716
717
|
case void 0:
|
|
717
|
-
case
|
|
718
|
+
case xt:
|
|
718
719
|
if (i.nonce !== void 0)
|
|
719
720
|
throw new s('unexpected ID Token "nonce" claim value');
|
|
720
721
|
break;
|
|
@@ -732,7 +733,7 @@ function ne(t) {
|
|
|
732
733
|
if (t.bodyUsed)
|
|
733
734
|
throw new TypeError('"response" body has been used already');
|
|
734
735
|
}
|
|
735
|
-
async function
|
|
736
|
+
async function Lt(t) {
|
|
736
737
|
if (t.status > 399 && t.status < 500) {
|
|
737
738
|
ne(t);
|
|
738
739
|
try {
|
|
@@ -743,11 +744,11 @@ async function Ct(t) {
|
|
|
743
744
|
}
|
|
744
745
|
}
|
|
745
746
|
}
|
|
746
|
-
function
|
|
747
|
+
function pe(t) {
|
|
747
748
|
if (typeof t.modulusLength != "number" || t.modulusLength < 2048)
|
|
748
749
|
throw new s(`${t.name} modulusLength must be at least 2048 bits`);
|
|
749
750
|
}
|
|
750
|
-
function
|
|
751
|
+
function jt(t) {
|
|
751
752
|
switch (t) {
|
|
752
753
|
case "P-256":
|
|
753
754
|
return "SHA-256";
|
|
@@ -759,15 +760,15 @@ function Lt(t) {
|
|
|
759
760
|
throw new S();
|
|
760
761
|
}
|
|
761
762
|
}
|
|
762
|
-
function
|
|
763
|
+
function xe(t) {
|
|
763
764
|
switch (t.algorithm.name) {
|
|
764
765
|
case "ECDSA":
|
|
765
766
|
return {
|
|
766
767
|
name: t.algorithm.name,
|
|
767
|
-
hash:
|
|
768
|
+
hash: jt(t.algorithm.namedCurve)
|
|
768
769
|
};
|
|
769
770
|
case "RSA-PSS":
|
|
770
|
-
switch (
|
|
771
|
+
switch (pe(t.algorithm), t.algorithm.hash.name) {
|
|
771
772
|
case "SHA-256":
|
|
772
773
|
case "SHA-384":
|
|
773
774
|
case "SHA-512":
|
|
@@ -779,71 +780,71 @@ function Ue(t) {
|
|
|
779
780
|
throw new S();
|
|
780
781
|
}
|
|
781
782
|
case "RSASSA-PKCS1-v1_5":
|
|
782
|
-
return
|
|
783
|
+
return pe(t.algorithm), t.algorithm.name;
|
|
783
784
|
case "Ed448":
|
|
784
785
|
case "Ed25519":
|
|
785
786
|
return t.algorithm.name;
|
|
786
787
|
}
|
|
787
788
|
throw new S();
|
|
788
789
|
}
|
|
789
|
-
const
|
|
790
|
+
const Ce = Symbol();
|
|
790
791
|
async function It(t, e, n, o) {
|
|
791
792
|
const a = `${t}.${e}`;
|
|
792
|
-
if (!await crypto.subtle.verify(
|
|
793
|
+
if (!await crypto.subtle.verify(xe(n), n, o, E(a)))
|
|
793
794
|
throw new s("JWT signature verification failed");
|
|
794
795
|
}
|
|
795
|
-
async function
|
|
796
|
-
let { 0: i, 1: c, 2:
|
|
796
|
+
async function Jt(t, e, n, o, a, r) {
|
|
797
|
+
let { 0: i, 1: c, 2: h, length: _ } = t.split(".");
|
|
797
798
|
if (_ === 5)
|
|
798
799
|
if (r !== void 0)
|
|
799
|
-
t = await r(t), { 0: i, 1: c, 2:
|
|
800
|
+
t = await r(t), { 0: i, 1: c, 2: h, length: _ } = t.split(".");
|
|
800
801
|
else
|
|
801
802
|
throw new S("JWE structure JWTs are not supported");
|
|
802
803
|
if (_ !== 3)
|
|
803
804
|
throw new s("Invalid JWT");
|
|
804
|
-
let
|
|
805
|
+
let p;
|
|
805
806
|
try {
|
|
806
|
-
|
|
807
|
+
p = JSON.parse(E(A(i)));
|
|
807
808
|
} catch (l) {
|
|
808
809
|
throw new s("failed to parse JWT Header body as base64url encoded JSON", { cause: l });
|
|
809
810
|
}
|
|
810
|
-
if (!C(
|
|
811
|
+
if (!C(p))
|
|
811
812
|
throw new s("JWT Header must be a top level object");
|
|
812
|
-
if (e(
|
|
813
|
+
if (e(p), p.crit !== void 0)
|
|
813
814
|
throw new s('unexpected JWT "crit" header parameter');
|
|
814
|
-
const y = A(
|
|
815
|
+
const y = A(h);
|
|
815
816
|
let T;
|
|
816
|
-
n !==
|
|
817
|
-
let
|
|
817
|
+
n !== Ce && (T = await n(p), await It(i, c, T, y));
|
|
818
|
+
let f;
|
|
818
819
|
try {
|
|
819
|
-
|
|
820
|
+
f = JSON.parse(E(A(c)));
|
|
820
821
|
} catch (l) {
|
|
821
822
|
throw new s("failed to parse JWT Payload body as base64url encoded JSON", { cause: l });
|
|
822
823
|
}
|
|
823
|
-
if (!C(
|
|
824
|
+
if (!C(f))
|
|
824
825
|
throw new s("JWT Payload must be a top level object");
|
|
825
826
|
const J = F() + o;
|
|
826
|
-
if (
|
|
827
|
-
if (typeof
|
|
827
|
+
if (f.exp !== void 0) {
|
|
828
|
+
if (typeof f.exp != "number")
|
|
828
829
|
throw new s('unexpected JWT "exp" (expiration time) claim type');
|
|
829
|
-
if (
|
|
830
|
+
if (f.exp <= J - a)
|
|
830
831
|
throw new s('unexpected JWT "exp" (expiration time) claim value, timestamp is <= now()');
|
|
831
832
|
}
|
|
832
|
-
if (
|
|
833
|
+
if (f.iat !== void 0 && typeof f.iat != "number")
|
|
833
834
|
throw new s('unexpected JWT "iat" (issued at) claim type');
|
|
834
|
-
if (
|
|
835
|
+
if (f.iss !== void 0 && typeof f.iss != "string")
|
|
835
836
|
throw new s('unexpected JWT "iss" (issuer) claim type');
|
|
836
|
-
if (
|
|
837
|
-
if (typeof
|
|
837
|
+
if (f.nbf !== void 0) {
|
|
838
|
+
if (typeof f.nbf != "number")
|
|
838
839
|
throw new s('unexpected JWT "nbf" (not before) claim type');
|
|
839
|
-
if (
|
|
840
|
+
if (f.nbf > J + a)
|
|
840
841
|
throw new s('unexpected JWT "nbf" (not before) claim value, timestamp is > now()');
|
|
841
842
|
}
|
|
842
|
-
if (
|
|
843
|
+
if (f.aud !== void 0 && typeof f.aud != "string" && !Array.isArray(f.aud))
|
|
843
844
|
throw new s('unexpected JWT "aud" (audience) claim type');
|
|
844
|
-
return { header:
|
|
845
|
+
return { header: p, claims: f, signature: y, key: T, jwt: t };
|
|
845
846
|
}
|
|
846
|
-
function
|
|
847
|
+
function Ot(t, e, n) {
|
|
847
848
|
if (t !== void 0) {
|
|
848
849
|
if (n.alg !== t)
|
|
849
850
|
throw new s('unexpected JWT "alg" header parameter');
|
|
@@ -863,9 +864,9 @@ function k(t, e) {
|
|
|
863
864
|
throw new s(`"${e}" parameter must be provided only once`);
|
|
864
865
|
return n;
|
|
865
866
|
}
|
|
866
|
-
const
|
|
867
|
-
function
|
|
868
|
-
if (
|
|
867
|
+
const zt = Symbol(), Dt = Symbol();
|
|
868
|
+
function Nt(t, e, n, o) {
|
|
869
|
+
if (j(t), I(e), n instanceof URL && (n = n.searchParams), !(n instanceof URLSearchParams))
|
|
869
870
|
throw new TypeError('"parameters" must be an instance of URLSearchParams, or URL');
|
|
870
871
|
if (k(n, "response"))
|
|
871
872
|
throw new s('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()');
|
|
@@ -876,11 +877,11 @@ function Dt(t, e, n, o) {
|
|
|
876
877
|
throw new s('unexpected "iss" (issuer) response parameter value');
|
|
877
878
|
switch (o) {
|
|
878
879
|
case void 0:
|
|
879
|
-
case
|
|
880
|
+
case Dt:
|
|
880
881
|
if (r !== void 0)
|
|
881
882
|
throw new s('unexpected "state" response parameter encountered');
|
|
882
883
|
break;
|
|
883
|
-
case
|
|
884
|
+
case zt:
|
|
884
885
|
break;
|
|
885
886
|
default:
|
|
886
887
|
if (!w(o))
|
|
@@ -897,22 +898,22 @@ function Dt(t, e, n, o) {
|
|
|
897
898
|
error_description: k(n, "error_description"),
|
|
898
899
|
error_uri: k(n, "error_uri")
|
|
899
900
|
};
|
|
900
|
-
const c = k(n, "id_token"),
|
|
901
|
-
if (c !== void 0 ||
|
|
901
|
+
const c = k(n, "id_token"), h = k(n, "token");
|
|
902
|
+
if (c !== void 0 || h !== void 0)
|
|
902
903
|
throw new S("implicit and hybrid flows are not supported");
|
|
903
|
-
return
|
|
904
|
+
return Et(new URLSearchParams(n));
|
|
904
905
|
}
|
|
905
|
-
function
|
|
906
|
+
function Kt({
|
|
906
907
|
handleCallback: t
|
|
907
908
|
}) {
|
|
908
|
-
const e =
|
|
909
|
+
const e = Ke({
|
|
909
910
|
retry: !1,
|
|
910
911
|
queryKey: ["oauth-callback"],
|
|
911
912
|
queryFn: async () => {
|
|
912
913
|
try {
|
|
913
914
|
return await t();
|
|
914
915
|
} catch (n) {
|
|
915
|
-
throw new
|
|
916
|
+
throw new He("Could not validate user", {
|
|
916
917
|
cause: n,
|
|
917
918
|
title: "Authentication Error",
|
|
918
919
|
developerHint: "Check the configuration of your authorization provider and ensure all settings such as the callback URL are configured correctly."
|
|
@@ -920,17 +921,17 @@ function Nt({
|
|
|
920
921
|
}
|
|
921
922
|
}
|
|
922
923
|
});
|
|
923
|
-
return /* @__PURE__ */ G.jsx(
|
|
924
|
+
return /* @__PURE__ */ G.jsx(We, { to: e.data });
|
|
924
925
|
}
|
|
925
926
|
class P extends Error {
|
|
926
927
|
}
|
|
927
|
-
class
|
|
928
|
+
class we extends P {
|
|
928
929
|
constructor(e, n, o) {
|
|
929
930
|
super(e, o), this.error = n;
|
|
930
931
|
}
|
|
931
932
|
}
|
|
932
933
|
const V = "code-verifier";
|
|
933
|
-
class
|
|
934
|
+
class Wt extends Ne {
|
|
934
935
|
constructor(e, n) {
|
|
935
936
|
super(), this.callbackUrlPath = e, this.handleCallback = n;
|
|
936
937
|
}
|
|
@@ -939,25 +940,26 @@ class Kt extends De {
|
|
|
939
940
|
...super.getRoutes(),
|
|
940
941
|
{
|
|
941
942
|
path: this.callbackUrlPath,
|
|
942
|
-
element: /* @__PURE__ */ G.jsx(
|
|
943
|
+
element: /* @__PURE__ */ G.jsx(De, { children: /* @__PURE__ */ G.jsx(Kt, { handleCallback: this.handleCallback }) })
|
|
943
944
|
}
|
|
944
945
|
];
|
|
945
946
|
}
|
|
946
947
|
}
|
|
947
|
-
class
|
|
948
|
+
class Ht {
|
|
948
949
|
constructor({
|
|
949
950
|
issuer: e,
|
|
950
951
|
audience: n,
|
|
951
952
|
clientId: o,
|
|
952
953
|
redirectToAfterSignUp: a,
|
|
953
954
|
redirectToAfterSignIn: r,
|
|
954
|
-
redirectToAfterSignOut: i
|
|
955
|
+
redirectToAfterSignOut: i,
|
|
956
|
+
basePath: c
|
|
955
957
|
}) {
|
|
956
958
|
b(this, "client");
|
|
957
959
|
b(this, "issuer");
|
|
958
960
|
b(this, "authorizationServer");
|
|
959
|
-
b(this, "callbackUrlPath"
|
|
960
|
-
b(this, "logoutRedirectUrlPath"
|
|
961
|
+
b(this, "callbackUrlPath");
|
|
962
|
+
b(this, "logoutRedirectUrlPath");
|
|
961
963
|
b(this, "onAuthorizationUrl");
|
|
962
964
|
b(this, "redirectToAfterSignUp");
|
|
963
965
|
b(this, "redirectToAfterSignIn");
|
|
@@ -984,32 +986,32 @@ class Wt {
|
|
|
984
986
|
const e = new URL(window.location.href), n = e.searchParams.get("state"), o = sessionStorage.getItem(V);
|
|
985
987
|
if (sessionStorage.removeItem(V), !o)
|
|
986
988
|
throw new P("No code verifier found in state.");
|
|
987
|
-
const a = await this.getAuthServer(), r =
|
|
989
|
+
const a = await this.getAuthServer(), r = Nt(
|
|
988
990
|
a,
|
|
989
991
|
this.client,
|
|
990
992
|
e.searchParams,
|
|
991
993
|
n ?? void 0
|
|
992
994
|
);
|
|
993
995
|
if (Y(r))
|
|
994
|
-
throw
|
|
996
|
+
throw ce.error("Error validating OAuth response", r), new we(
|
|
995
997
|
"Error validating OAuth response",
|
|
996
998
|
r
|
|
997
999
|
);
|
|
998
1000
|
const i = new URL(e);
|
|
999
1001
|
i.pathname = this.callbackUrlPath, i.search = "";
|
|
1000
|
-
const c = await
|
|
1002
|
+
const c = await Rt(
|
|
1001
1003
|
a,
|
|
1002
1004
|
this.client,
|
|
1003
1005
|
r,
|
|
1004
1006
|
i.toString(),
|
|
1005
1007
|
o
|
|
1006
|
-
),
|
|
1008
|
+
), h = await Ct(
|
|
1007
1009
|
a,
|
|
1008
1010
|
this.client,
|
|
1009
1011
|
c
|
|
1010
1012
|
);
|
|
1011
|
-
this.setTokensFromResponse(
|
|
1012
|
-
const _ = await this.getAccessToken(), y = await (await
|
|
1013
|
+
this.setTokensFromResponse(h);
|
|
1014
|
+
const _ = await this.getAccessToken(), y = await (await bt(
|
|
1013
1015
|
a,
|
|
1014
1016
|
this.client,
|
|
1015
1017
|
_
|
|
@@ -1025,18 +1027,20 @@ class Wt {
|
|
|
1025
1027
|
isPending: !1,
|
|
1026
1028
|
profile: T
|
|
1027
1029
|
});
|
|
1028
|
-
const
|
|
1029
|
-
return sessionStorage.removeItem("redirect-to"),
|
|
1030
|
+
const f = sessionStorage.getItem("redirect-to") ?? "/";
|
|
1031
|
+
return sessionStorage.removeItem("redirect-to"), f;
|
|
1030
1032
|
});
|
|
1031
1033
|
this.client = {
|
|
1032
1034
|
client_id: o,
|
|
1033
1035
|
token_endpoint_auth_method: "none"
|
|
1034
|
-
}, this.audience = n, this.issuer = e, this.
|
|
1036
|
+
}, this.audience = n, this.issuer = e, this.callbackUrlPath = ae(c, "/oauth/callback");
|
|
1037
|
+
const h = ae(c, "/");
|
|
1038
|
+
this.logoutRedirectUrlPath = h, this.redirectToAfterSignUp = a ?? h, this.redirectToAfterSignIn = r ?? h, this.redirectToAfterSignOut = i ?? h;
|
|
1035
1039
|
}
|
|
1036
1040
|
async getAuthServer() {
|
|
1037
1041
|
if (!this.authorizationServer) {
|
|
1038
|
-
const e = new URL(this.issuer), n = await
|
|
1039
|
-
this.authorizationServer = await
|
|
1042
|
+
const e = new URL(this.issuer), n = await nt(e);
|
|
1043
|
+
this.authorizationServer = await rt(
|
|
1040
1044
|
e,
|
|
1041
1045
|
n
|
|
1042
1046
|
);
|
|
@@ -1049,7 +1053,7 @@ class Wt {
|
|
|
1049
1053
|
*/
|
|
1050
1054
|
setTokensFromResponse(e) {
|
|
1051
1055
|
if (Y(e))
|
|
1052
|
-
throw
|
|
1056
|
+
throw ce.error("Bad Token Response", e), new we("Bad Token Response", e);
|
|
1053
1057
|
if (!e.expires_in)
|
|
1054
1058
|
throw new P("No expires_in in response");
|
|
1055
1059
|
const n = {
|
|
@@ -1078,25 +1082,25 @@ class Wt {
|
|
|
1078
1082
|
redirectTo: e,
|
|
1079
1083
|
isSignUp: n = !1
|
|
1080
1084
|
}) {
|
|
1081
|
-
var _,
|
|
1085
|
+
var _, p;
|
|
1082
1086
|
const o = "S256", a = await this.getAuthServer();
|
|
1083
1087
|
if (!a.authorization_endpoint)
|
|
1084
1088
|
throw new P("No authorization endpoint");
|
|
1085
|
-
const r =
|
|
1089
|
+
const r = ot(), i = await at(r);
|
|
1086
1090
|
sessionStorage.setItem(V, r);
|
|
1087
1091
|
const c = new URL(
|
|
1088
1092
|
a.authorization_endpoint
|
|
1089
1093
|
);
|
|
1090
1094
|
sessionStorage.setItem("redirect-to", e);
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1095
|
+
const h = new URL(window.location.origin);
|
|
1096
|
+
if (h.pathname = this.callbackUrlPath, h.search = "", c.searchParams.set("client_id", this.client.client_id), c.searchParams.set("redirect_uri", h.toString()), c.searchParams.set("response_type", "code"), c.searchParams.set("scope", "openid profile email"), c.searchParams.set("code_challenge", i), c.searchParams.set(
|
|
1093
1097
|
"code_challenge_method",
|
|
1094
1098
|
o
|
|
1095
1099
|
), this.audience && c.searchParams.set("audience", this.audience), (_ = this.onAuthorizationUrl) == null || _.call(this, c, {
|
|
1096
1100
|
isSignIn: !n,
|
|
1097
1101
|
isSignUp: n
|
|
1098
|
-
}), ((
|
|
1099
|
-
const y =
|
|
1102
|
+
}), ((p = a.code_challenge_methods_supported) == null ? void 0 : p.includes("S256")) !== !0) {
|
|
1103
|
+
const y = it();
|
|
1100
1104
|
c.searchParams.set("state", y);
|
|
1101
1105
|
}
|
|
1102
1106
|
location.href = c.href;
|
|
@@ -1114,11 +1118,11 @@ class Wt {
|
|
|
1114
1118
|
profile: null,
|
|
1115
1119
|
providerData: null
|
|
1116
1120
|
}), "";
|
|
1117
|
-
const a = await
|
|
1121
|
+
const a = await vt(
|
|
1118
1122
|
e,
|
|
1119
1123
|
this.client,
|
|
1120
1124
|
o.refreshToken
|
|
1121
|
-
), r = await
|
|
1125
|
+
), r = await Tt(
|
|
1122
1126
|
e,
|
|
1123
1127
|
this.client,
|
|
1124
1128
|
a
|
|
@@ -1130,12 +1134,12 @@ class Wt {
|
|
|
1130
1134
|
return o.accessToken;
|
|
1131
1135
|
}
|
|
1132
1136
|
getAuthenticationPlugin() {
|
|
1133
|
-
return new
|
|
1137
|
+
return new Wt(this.callbackUrlPath, this.handleCallback);
|
|
1134
1138
|
}
|
|
1135
1139
|
}
|
|
1136
|
-
const
|
|
1140
|
+
const Xt = (t) => new Ht(t);
|
|
1137
1141
|
export {
|
|
1138
|
-
|
|
1139
|
-
|
|
1142
|
+
Ht as OpenIDAuthenticationProvider,
|
|
1143
|
+
Xt as default
|
|
1140
1144
|
};
|
|
1141
1145
|
//# sourceMappingURL=zudoku.auth-openid.js.map
|