@gen-epix/ui-client-common 4.0.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/LICENSE +287 -0
- package/README.md +93 -0
- package/dist/@types/environment.d.ts +7 -0
- package/dist/@types/mui.d.ts +9 -0
- package/dist/@types/ui.d.ts +4 -0
- package/dist/@types/vite-env.d.ts +3 -0
- package/dist/_chunks/ApplicationFooter.js +119 -0
- package/dist/_chunks/ApplicationFooter.js.map +1 -0
- package/dist/_chunks/Breadcrumbs.js +40 -0
- package/dist/_chunks/Breadcrumbs.js.map +1 -0
- package/dist/_chunks/CrudPage.js +535 -0
- package/dist/_chunks/CrudPage.js.map +1 -0
- package/dist/_chunks/GeoFilter.js +38 -0
- package/dist/_chunks/GeoFilter.js.map +1 -0
- package/dist/_chunks/Notifications.js +152 -0
- package/dist/_chunks/Notifications.js.map +1 -0
- package/dist/_chunks/OutageList.js +78 -0
- package/dist/_chunks/OutageList.js.map +1 -0
- package/dist/_chunks/OutageUtil.js +47 -0
- package/dist/_chunks/OutageUtil.js.map +1 -0
- package/dist/_chunks/QueryClientProvider.js +18 -0
- package/dist/_chunks/QueryClientProvider.js.map +1 -0
- package/dist/_chunks/QueryClientService.js +655 -0
- package/dist/_chunks/QueryClientService.js.map +1 -0
- package/dist/_chunks/Table.js +4565 -0
- package/dist/_chunks/Table.js.map +1 -0
- package/dist/_chunks/TableUtil.js +626 -0
- package/dist/_chunks/TableUtil.js.map +1 -0
- package/dist/_chunks/TextFilter.js +249 -0
- package/dist/_chunks/TextFilter.js.map +1 -0
- package/dist/_chunks/UserInvitationsAdminPage.js +273 -0
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -0
- package/dist/_chunks/_baseAssignValue.js +19 -0
- package/dist/_chunks/_baseAssignValue.js.map +1 -0
- package/dist/_chunks/_baseFlatten.js +27 -0
- package/dist/_chunks/_baseFlatten.js.map +1 -0
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +275 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +37 -0
- package/dist/_chunks/_baseUnset.js.map +1 -0
- package/dist/_chunks/_cacheHas.js +65 -0
- package/dist/_chunks/_cacheHas.js.map +1 -0
- package/dist/_chunks/_setToString.js +71 -0
- package/dist/_chunks/_setToString.js.map +1 -0
- package/dist/_chunks/chunk-KS7C4IRE.js +3829 -0
- package/dist/_chunks/chunk-KS7C4IRE.js.map +1 -0
- package/dist/_chunks/format.js +1135 -0
- package/dist/_chunks/format.js.map +1 -0
- package/dist/_chunks/index.esm.js +1179 -0
- package/dist/_chunks/index.esm.js.map +1 -0
- package/dist/_chunks/isArrayLike.js +255 -0
- package/dist/_chunks/isArrayLike.js.map +1 -0
- package/dist/_chunks/isObject.js +13 -0
- package/dist/_chunks/isObject.js.map +1 -0
- package/dist/_chunks/isObjectLike.js +43 -0
- package/dist/_chunks/isObjectLike.js.map +1 -0
- package/dist/_chunks/isSymbol.js +14 -0
- package/dist/_chunks/isSymbol.js.map +1 -0
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/middleware.js +111 -0
- package/dist/_chunks/middleware.js.map +1 -0
- package/dist/_chunks/oidc-client-ts.js +1843 -0
- package/dist/_chunks/oidc-client-ts.js.map +1 -0
- package/dist/_chunks/omit.js +293 -0
- package/dist/_chunks/omit.js.map +1 -0
- package/dist/_chunks/query.js +769 -0
- package/dist/_chunks/query.js.map +1 -0
- package/dist/_chunks/react-oidc-context.js +201 -0
- package/dist/_chunks/react-oidc-context.js.map +1 -0
- package/dist/_chunks/react.js +11 -0
- package/dist/_chunks/react.js.map +1 -0
- package/dist/_chunks/rolldown-runtime.js +13 -0
- package/dist/_chunks/tableStore.js +822 -0
- package/dist/_chunks/tableStore.js.map +1 -0
- package/dist/_chunks/toDate.js +18 -0
- package/dist/_chunks/toDate.js.map +1 -0
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useColumnsMenu.js +159 -0
- package/dist/_chunks/useColumnsMenu.js.map +1 -0
- package/dist/_chunks/useMutation.js +110 -0
- package/dist/_chunks/useMutation.js.map +1 -0
- package/dist/_chunks/useQueryMemo.js +325 -0
- package/dist/_chunks/useQueryMemo.js.map +1 -0
- package/dist/_chunks/vanilla.js +20 -0
- package/dist/_chunks/vanilla.js.map +1 -0
- package/dist/_chunks/yup.js +73 -0
- package/dist/_chunks/yup.js.map +1 -0
- package/dist/classes/TableEventBus/TableEventBus.d.ts +12 -0
- package/dist/classes/TableEventBus/index.d.ts +1 -0
- package/dist/classes/TableEventBus/index.js +7 -0
- package/dist/classes/TableEventBus/index.js.map +1 -0
- package/dist/classes/abstracts/FilterAbstract/FilterAbstract.d.ts +27 -0
- package/dist/classes/abstracts/FilterAbstract/index.d.ts +1 -0
- package/dist/classes/abstracts/FilterAbstract/index.js +37 -0
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -0
- package/dist/classes/filters/BooleanFilter.d.ts +11 -0
- package/dist/classes/filters/DateFilter.d.ts +26 -0
- package/dist/classes/filters/GeoFilter.d.ts +17 -0
- package/dist/classes/filters/MultiSelectFilter.d.ts +19 -0
- package/dist/classes/filters/NumberRangeFilter.d.ts +17 -0
- package/dist/classes/filters/TextFilter.d.ts +10 -0
- package/dist/classes/filters/index.d.ts +6 -0
- package/dist/classes/filters/index.js +3 -0
- package/dist/classes/services/ApiService/ApiService.d.ts +19 -0
- package/dist/classes/services/ApiService/index.d.ts +1 -0
- package/dist/classes/services/ApiService/index.js +21 -0
- package/dist/classes/services/ApiService/index.js.map +1 -0
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +18 -0
- package/dist/classes/services/AuthenticationService/index.d.ts +1 -0
- package/dist/classes/services/AuthenticationService/index.js +694 -0
- package/dist/classes/services/AuthenticationService/index.js.map +1 -0
- package/dist/classes/services/AuthorizationService/AuthorizationService.d.ts +15 -0
- package/dist/classes/services/AuthorizationService/index.d.ts +1 -0
- package/dist/classes/services/AuthorizationService/index.js +36 -0
- package/dist/classes/services/AuthorizationService/index.js.map +1 -0
- package/dist/classes/services/BackendVersionService/BackendVersionService.d.ts +8 -0
- package/dist/classes/services/BackendVersionService/index.d.ts +1 -0
- package/dist/classes/services/BackendVersionService/index.js +17 -0
- package/dist/classes/services/BackendVersionService/index.js.map +1 -0
- package/dist/classes/services/BreadcrumbService/BreadcrumbService.d.ts +10 -0
- package/dist/classes/services/BreadcrumbService/index.d.ts +1 -0
- package/dist/classes/services/BreadcrumbService/index.js +50 -0
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -0
- package/dist/classes/services/ConfigService/ConfigService.d.ts +9 -0
- package/dist/classes/services/ConfigService/index.d.ts +1 -0
- package/dist/classes/services/ConfigService/index.js +21 -0
- package/dist/classes/services/ConfigService/index.js.map +1 -0
- package/dist/classes/services/EmotionCacheService/EmotionCacheService.d.ts +7 -0
- package/dist/classes/services/EmotionCacheService/index.d.ts +1 -0
- package/dist/classes/services/EmotionCacheService/index.js +24 -0
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -0
- package/dist/classes/services/FeatureFlagsService/FeatureFlagsService.d.ts +9 -0
- package/dist/classes/services/FeatureFlagsService/index.d.ts +1 -0
- package/dist/classes/services/FeatureFlagsService/index.js +21 -0
- package/dist/classes/services/FeatureFlagsService/index.js.map +1 -0
- package/dist/classes/services/I18nService/I18nService.d.ts +28 -0
- package/dist/classes/services/I18nService/index.d.ts +1 -0
- package/dist/classes/services/I18nService/index.js +67 -0
- package/dist/classes/services/I18nService/index.js.map +1 -0
- package/dist/classes/services/InactivityService/InactivityService.d.ts +25 -0
- package/dist/classes/services/InactivityService/index.d.ts +1 -0
- package/dist/classes/services/InactivityService/index.js +172 -0
- package/dist/classes/services/InactivityService/index.js.map +1 -0
- package/dist/classes/services/LogService/LogService.d.ts +22 -0
- package/dist/classes/services/LogService/index.d.ts +1 -0
- package/dist/classes/services/LogService/index.js +92 -0
- package/dist/classes/services/LogService/index.js.map +1 -0
- package/dist/classes/services/NavigationHistoryService/NavigationHistoryService.d.ts +6 -0
- package/dist/classes/services/NavigationHistoryService/index.d.ts +1 -0
- package/dist/classes/services/NavigationHistoryService/index.js +14 -0
- package/dist/classes/services/NavigationHistoryService/index.js.map +1 -0
- package/dist/classes/services/NotificationService/NotificationService.d.ts +14 -0
- package/dist/classes/services/NotificationService/index.d.ts +1 -0
- package/dist/classes/services/NotificationService/index.js +63 -0
- package/dist/classes/services/NotificationService/index.js.map +1 -0
- package/dist/classes/services/PageEventBusService/PageEventBusService.d.ts +28 -0
- package/dist/classes/services/PageEventBusService/index.d.ts +1 -0
- package/dist/classes/services/PageEventBusService/index.js +66 -0
- package/dist/classes/services/PageEventBusService/index.js.map +1 -0
- package/dist/classes/services/QueryClientService/QueryClientService.d.ts +25 -0
- package/dist/classes/services/QueryClientService/index.d.ts +1 -0
- package/dist/classes/services/QueryClientService/index.js +2 -0
- package/dist/classes/services/RouterService/RouterService.d.ts +19 -0
- package/dist/classes/services/RouterService/index.d.ts +1 -0
- package/dist/classes/services/RouterService/index.js +22 -0
- package/dist/classes/services/RouterService/index.js.map +1 -0
- package/dist/classes/services/UserSettingsService/UserSettingsService.d.ts +6 -0
- package/dist/classes/services/UserSettingsService/index.d.ts +1 -0
- package/dist/classes/services/UserSettingsService/index.js +14 -0
- package/dist/classes/services/UserSettingsService/index.js.map +1 -0
- package/dist/components/app/App/App.d.ts +1 -0
- package/dist/components/app/App/index.d.ts +1 -0
- package/dist/components/app/App/index.js +106 -0
- package/dist/components/app/App/index.js.map +1 -0
- package/dist/components/app/ApplicationBootstrap/ApplicationBootstrap.d.ts +2 -0
- package/dist/components/app/ApplicationBootstrap/index.d.ts +1 -0
- package/dist/components/app/ApplicationBootstrap/index.js +135 -0
- package/dist/components/app/ApplicationBootstrap/index.js.map +1 -0
- package/dist/components/app/AuthenticationWrapper/AuthenticationWrapper.d.ts +2 -0
- package/dist/components/app/AuthenticationWrapper/index.d.ts +1 -0
- package/dist/components/app/AuthenticationWrapper/index.js +126 -0
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -0
- package/dist/components/app/AuthorizationWrapper/AuthorizationWrapper.d.ts +2 -0
- package/dist/components/app/AuthorizationWrapper/index.d.ts +1 -0
- package/dist/components/app/AuthorizationWrapper/index.js +46 -0
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -0
- package/dist/components/app/RouterRoot/RouterRoot.d.ts +1 -0
- package/dist/components/app/RouterRoot/index.d.ts +1 -0
- package/dist/components/app/RouterRoot/index.js +118 -0
- package/dist/components/app/RouterRoot/index.js.map +1 -0
- package/dist/components/epi/EpiContactDetailsDialog/EpiContactDetailsDialog.d.ts +9 -0
- package/dist/components/epi/EpiContactDetailsDialog/index.d.ts +1 -0
- package/dist/components/epi/EpiContactDetailsDialog/index.js +81 -0
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -0
- package/dist/components/filters/BooleanFilterField/BooleanFilterField.d.ts +5 -0
- package/dist/components/filters/BooleanFilterField/index.d.ts +1 -0
- package/dist/components/filters/BooleanFilterField/index.js +23 -0
- package/dist/components/filters/BooleanFilterField/index.js.map +1 -0
- package/dist/components/filters/DateFilterField/DateFilterField.d.ts +5 -0
- package/dist/components/filters/DateFilterField/index.d.ts +1 -0
- package/dist/components/filters/DateFilterField/index.js +15 -0
- package/dist/components/filters/DateFilterField/index.js.map +1 -0
- package/dist/components/filters/GeoFilterField/GeoFilterField.d.ts +5 -0
- package/dist/components/filters/GeoFilterField/index.d.ts +1 -0
- package/dist/components/filters/GeoFilterField/index.js +20 -0
- package/dist/components/filters/GeoFilterField/index.js.map +1 -0
- package/dist/components/filters/MultiSelectFilterField/MultiSelectFilterField.d.ts +5 -0
- package/dist/components/filters/MultiSelectFilterField/index.d.ts +1 -0
- package/dist/components/filters/MultiSelectFilterField/index.js +19 -0
- package/dist/components/filters/MultiSelectFilterField/index.js.map +1 -0
- package/dist/components/filters/NumberRangeFilterField/NumberRangeFilterField.d.ts +5 -0
- package/dist/components/filters/NumberRangeFilterField/index.d.ts +1 -0
- package/dist/components/filters/NumberRangeFilterField/index.js +14 -0
- package/dist/components/filters/NumberRangeFilterField/index.js.map +1 -0
- package/dist/components/filters/TextFilterField/TextFilterField.d.ts +5 -0
- package/dist/components/filters/TextFilterField/index.d.ts +1 -0
- package/dist/components/filters/TextFilterField/index.js +12 -0
- package/dist/components/filters/TextFilterField/index.js.map +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBar.d.ts +6 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActions.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsFeedbackItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsInfotem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsNotificationsItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsOrganizationSwitcherItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsOutagesItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarActionsUserItem.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/ApplicationBarNavigationMenu.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/InfoMenu.d.ts +7 -0
- package/dist/components/ui/ApplicationBar/UserMenu.d.ts +7 -0
- package/dist/components/ui/ApplicationBar/UserOrganizationAdminMenuItem.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/UserOwnOrganizationMenuItem.d.ts +4 -0
- package/dist/components/ui/ApplicationBar/index.d.ts +1 -0
- package/dist/components/ui/ApplicationBar/index.js +661 -0
- package/dist/components/ui/ApplicationBar/index.js.map +1 -0
- package/dist/components/ui/ApplicationFooter/ApplicationFooter.d.ts +4 -0
- package/dist/components/ui/ApplicationFooter/ApplicationFooterLink.d.ts +7 -0
- package/dist/components/ui/ApplicationFooter/ApplicationFooterLinkSection.d.ts +5 -0
- package/dist/components/ui/ApplicationFooter/index.d.ts +1 -0
- package/dist/components/ui/ApplicationFooter/index.js +2 -0
- package/dist/components/ui/BackdropSpinner/BackdropSpinner.d.ts +5 -0
- package/dist/components/ui/BackdropSpinner/index.d.ts +1 -0
- package/dist/components/ui/BackdropSpinner/index.js +19 -0
- package/dist/components/ui/BackdropSpinner/index.js.map +1 -0
- package/dist/components/ui/Breadcrumbs/Breadcrumb.d.ts +9 -0
- package/dist/components/ui/Breadcrumbs/Breadcrumbs.d.ts +1 -0
- package/dist/components/ui/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/ui/Breadcrumbs/index.js +2 -0
- package/dist/components/ui/Confirmation/Confirmation.d.ts +2 -0
- package/dist/components/ui/Confirmation/ConfirmationRender.d.ts +11 -0
- package/dist/components/ui/Confirmation/index.d.ts +2 -0
- package/dist/components/ui/Confirmation/index.js +58 -0
- package/dist/components/ui/Confirmation/index.js.map +1 -0
- package/dist/components/ui/ConsentDialog/ConsentDialog.d.ts +8 -0
- package/dist/components/ui/ConsentDialog/index.d.ts +1 -0
- package/dist/components/ui/ConsentDialog/index.js +36 -0
- package/dist/components/ui/ConsentDialog/index.js.map +1 -0
- package/dist/components/ui/CopyToClipboardButton/CopyToClipboardButton.d.ts +13 -0
- package/dist/components/ui/CopyToClipboardButton/index.d.ts +1 -0
- package/dist/components/ui/CopyToClipboardButton/index.js +101 -0
- package/dist/components/ui/CopyToClipboardButton/index.js.map +1 -0
- package/dist/components/ui/Dialog/Dialog.d.ts +27 -0
- package/dist/components/ui/Dialog/index.d.ts +1 -0
- package/dist/components/ui/Dialog/index.js +83 -0
- package/dist/components/ui/Dialog/index.js.map +1 -0
- package/dist/components/ui/GenericErrorMessage/GenericErrorMessage.d.ts +5 -0
- package/dist/components/ui/GenericErrorMessage/index.d.ts +1 -0
- package/dist/components/ui/GenericErrorMessage/index.js +91 -0
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -0
- package/dist/components/ui/LicensesDialog/LicensesDialog.d.ts +7 -0
- package/dist/components/ui/LicensesDialog/index.d.ts +1 -0
- package/dist/components/ui/LicensesDialog/index.js +117 -0
- package/dist/components/ui/LicensesDialog/index.js.map +1 -0
- package/dist/components/ui/LinearProgressWithLabel/LinearProgressWithLabel.d.ts +5 -0
- package/dist/components/ui/LinearProgressWithLabel/index.d.ts +1 -0
- package/dist/components/ui/LinearProgressWithLabel/index.js +31 -0
- package/dist/components/ui/LinearProgressWithLabel/index.js.map +1 -0
- package/dist/components/ui/LoadingIndicator/LoadingIndicator.d.ts +2 -0
- package/dist/components/ui/LoadingIndicator/index.d.ts +1 -0
- package/dist/components/ui/LoadingIndicator/index.js +12 -0
- package/dist/components/ui/LoadingIndicator/index.js.map +1 -0
- package/dist/components/ui/MyPermissionsDialog/MyPermissionsDialog.d.ts +7 -0
- package/dist/components/ui/MyPermissionsDialog/index.d.ts +1 -0
- package/dist/components/ui/MyPermissionsDialog/index.js +41 -0
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -0
- package/dist/components/ui/NavLink/NavLink.d.ts +7 -0
- package/dist/components/ui/NavLink/index.d.ts +1 -0
- package/dist/components/ui/NavLink/index.js +23 -0
- package/dist/components/ui/NavLink/index.js.map +1 -0
- package/dist/components/ui/NestedMenu/IconMenuItem.d.ts +18 -0
- package/dist/components/ui/NestedMenu/NestedDropdown.d.ts +17 -0
- package/dist/components/ui/NestedMenu/NestedMenuItem.d.ts +22 -0
- package/dist/components/ui/NestedMenu/index.d.ts +4 -0
- package/dist/components/ui/NestedMenu/index.js +240 -0
- package/dist/components/ui/NestedMenu/index.js.map +1 -0
- package/dist/components/ui/NestedMenu/nestedMenuItemsFromObject.d.ts +11 -0
- package/dist/components/ui/Notifications/NotificationItem.d.ts +8 -0
- package/dist/components/ui/Notifications/NotificationsDrawer.d.ts +5 -0
- package/dist/components/ui/Notifications/NotificationsStack.d.ts +2 -0
- package/dist/components/ui/Notifications/index.d.ts +2 -0
- package/dist/components/ui/Notifications/index.js +2 -0
- package/dist/components/ui/OrganizationSwitcherDialog/OrganizationSwitcherDialog.d.ts +7 -0
- package/dist/components/ui/OrganizationSwitcherDialog/index.d.ts +1 -0
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +123 -0
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -0
- package/dist/components/ui/OutageList/OutageItem.d.ts +9 -0
- package/dist/components/ui/OutageList/OutageList.d.ts +7 -0
- package/dist/components/ui/OutageList/OutageSection.d.ts +10 -0
- package/dist/components/ui/OutageList/index.d.ts +1 -0
- package/dist/components/ui/OutageList/index.js +2 -0
- package/dist/components/ui/OutagesDialog/OutagesDialog.d.ts +7 -0
- package/dist/components/ui/OutagesDialog/index.d.ts +1 -0
- package/dist/components/ui/OutagesDialog/index.js +43 -0
- package/dist/components/ui/OutagesDialog/index.js.map +1 -0
- package/dist/components/ui/PageContainer/PageContainer.d.ts +14 -0
- package/dist/components/ui/PageContainer/index.d.ts +1 -0
- package/dist/components/ui/PageContainer/index.js +135 -0
- package/dist/components/ui/PageContainer/index.js.map +1 -0
- package/dist/components/ui/ResponseHandler/ResponseHandler.d.ts +16 -0
- package/dist/components/ui/ResponseHandler/index.d.ts +1 -0
- package/dist/components/ui/ResponseHandler/index.js +28 -0
- package/dist/components/ui/ResponseHandler/index.js.map +1 -0
- package/dist/components/ui/Sidebar/SidebarItem.d.ts +13 -0
- package/dist/components/ui/Sidebar/SidebarMenu.d.ts +3 -0
- package/dist/components/ui/Sidebar/SidebarMenuItem.d.ts +12 -0
- package/dist/components/ui/Sidebar/index.d.ts +3 -0
- package/dist/components/ui/Sidebar/index.js +128 -0
- package/dist/components/ui/Sidebar/index.js.map +1 -0
- package/dist/components/ui/SortableList/SortableList.d.ts +14 -0
- package/dist/components/ui/SortableList/SortableListItem.d.ts +8 -0
- package/dist/components/ui/SortableList/SortableListItemDragHandle.d.ts +4 -0
- package/dist/components/ui/SortableList/SortableOverlay.d.ts +2 -0
- package/dist/components/ui/SortableList/context/SortableListItemContext.d.ts +7 -0
- package/dist/components/ui/SortableList/context/SortableListItemContextProvider.d.ts +6 -0
- package/dist/components/ui/SortableList/context/useSortableListItemContext.d.ts +1 -0
- package/dist/components/ui/Spinner/Spinner.d.ts +11 -0
- package/dist/components/ui/Spinner/index.d.ts +1 -0
- package/dist/components/ui/Spinner/index.js +63 -0
- package/dist/components/ui/Spinner/index.js.map +1 -0
- package/dist/components/ui/Stepper/Stepper.d.ts +17 -0
- package/dist/components/ui/Stepper/index.d.ts +2 -0
- package/dist/components/ui/Stepper/index.js +126 -0
- package/dist/components/ui/Stepper/index.js.map +1 -0
- package/dist/components/ui/Stepper/stepperModel.d.ts +4 -0
- package/dist/components/ui/Table/Table.d.ts +30 -0
- package/dist/components/ui/Table/TableActionsCell.d.ts +6 -0
- package/dist/components/ui/Table/TableCaption.d.ts +7 -0
- package/dist/components/ui/Table/TableCell.d.ts +27 -0
- package/dist/components/ui/Table/TableCellAsyncContent.d.ts +4 -0
- package/dist/components/ui/Table/TableCheckboxCell.d.ts +8 -0
- package/dist/components/ui/Table/TableCheckboxHeader.d.ts +5 -0
- package/dist/components/ui/Table/TableColumnsEditorDialog.d.ts +9 -0
- package/dist/components/ui/Table/TableFilter.d.ts +6 -0
- package/dist/components/ui/Table/TableFiltersSidebarItem.d.ts +9 -0
- package/dist/components/ui/Table/TableHeader.d.ts +8 -0
- package/dist/components/ui/Table/TableHeaderCell.d.ts +9 -0
- package/dist/components/ui/Table/TableHeaderFilter.d.ts +7 -0
- package/dist/components/ui/Table/TableMenu.d.ts +5 -0
- package/dist/components/ui/Table/TableReadableIndexCell.d.ts +8 -0
- package/dist/components/ui/Table/TableSidebarMenu.d.ts +5 -0
- package/dist/components/ui/Table/classNames.d.ts +8 -0
- package/dist/components/ui/Table/index.d.ts +12 -0
- package/dist/components/ui/Table/index.js +2 -0
- package/dist/components/ui/UserFeedbackDialog/UserFeedbackDialog.d.ts +7 -0
- package/dist/components/ui/UserFeedbackDialog/index.d.ts +1 -0
- package/dist/components/ui/UserFeedbackDialog/index.js +117 -0
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -0
- package/dist/components/ui/UserInactivityConfirmation/UserInactivityConfirmation.d.ts +1 -0
- package/dist/components/ui/UserInactivityConfirmation/index.d.ts +1 -0
- package/dist/components/ui/UserInactivityConfirmation/index.js +40 -0
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -0
- package/dist/constants/query.d.ts +21 -0
- package/dist/constants/query.js +46 -0
- package/dist/constants/query.js.map +1 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.d.ts +1 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +26 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -0
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/useIdentifierIssuerOwnOrganizationQuery.d.ts +5 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/index.d.ts +1 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +22 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -0
- package/dist/dataHooks/useIdentifierIssuerQuery/useIdentifierIssuerQuery.d.ts +8 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.d.ts +1 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +21 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -0
- package/dist/dataHooks/useInviteUserConstraintsQuery/useInviteUserConstraintsQuery.d.ts +3 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.d.ts +1 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +32 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -0
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/useOrganizationAdminPoliciesQuery.d.ts +7 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.d.ts +1 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +13 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -0
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/useOrganizationIdentifierIssuerLinksQuery.d.ts +3 -0
- package/dist/dataHooks/useOrganizationsQuery/index.d.ts +1 -0
- package/dist/dataHooks/useOrganizationsQuery/index.js +22 -0
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -0
- package/dist/dataHooks/useOrganizationsQuery/useOrganizationsQuery.d.ts +6 -0
- package/dist/dataHooks/useUsersQuery/index.d.ts +1 -0
- package/dist/dataHooks/useUsersQuery/index.js +23 -0
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -0
- package/dist/dataHooks/useUsersQuery/useUsersQuery.d.ts +6 -0
- package/dist/hoc/withDialog/index.d.ts +1 -0
- package/dist/hoc/withDialog/index.js +69 -0
- package/dist/hoc/withDialog/index.js.map +1 -0
- package/dist/hoc/withDialog/withDialog.d.ts +33 -0
- package/dist/hoc/withPermissions/index.d.ts +1 -0
- package/dist/hoc/withPermissions/index.js +21 -0
- package/dist/hoc/withPermissions/index.js.map +1 -0
- package/dist/hoc/withPermissions/withPermissions.d.ts +10 -0
- package/dist/hooks/useColumnsMenu/index.d.ts +1 -0
- package/dist/hooks/useColumnsMenu/index.js +2 -0
- package/dist/hooks/useColumnsMenu/useColumnsMenu.d.ts +6 -0
- package/dist/hooks/useCreateMutation/index.d.ts +1 -0
- package/dist/hooks/useCreateMutation/index.js +50 -0
- package/dist/hooks/useCreateMutation/index.js.map +1 -0
- package/dist/hooks/useCreateMutation/useCreateMutation.d.ts +21 -0
- package/dist/hooks/useDeleteMutation/index.d.ts +1 -0
- package/dist/hooks/useDeleteMutation/index.js +41 -0
- package/dist/hooks/useDeleteMutation/index.js.map +1 -0
- package/dist/hooks/useDeleteMutation/useDeleteMutation.d.ts +20 -0
- package/dist/hooks/useEditMutation/index.d.ts +1 -0
- package/dist/hooks/useEditMutation/index.js +57 -0
- package/dist/hooks/useEditMutation/index.js.map +1 -0
- package/dist/hooks/useEditMutation/useEditMutation.d.ts +23 -0
- package/dist/hooks/useInitializeTableStore/index.d.ts +1 -0
- package/dist/hooks/useInitializeTableStore/index.js +28 -0
- package/dist/hooks/useInitializeTableStore/index.js.map +1 -0
- package/dist/hooks/useInitializeTableStore/useInitializeTableStore.d.ts +11 -0
- package/dist/hooks/useItemQuery/index.d.ts +1 -0
- package/dist/hooks/useItemQuery/index.js +61 -0
- package/dist/hooks/useItemQuery/index.js.map +1 -0
- package/dist/hooks/useItemQuery/useItemQuery.d.ts +15 -0
- package/dist/hooks/useQueryMemo/index.d.ts +1 -0
- package/dist/hooks/useQueryMemo/index.js +2 -0
- package/dist/hooks/useQueryMemo/useQueryMemo.d.ts +2 -0
- package/dist/hooks/useUpdateBreadcrumb/index.d.ts +1 -0
- package/dist/hooks/useUpdateBreadcrumb/index.js +15 -0
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -0
- package/dist/hooks/useUpdateBreadcrumb/useUpdateBreadcrumb.d.ts +1 -0
- package/dist/hooks/useUpdateDocumentTitle/index.d.ts +1 -0
- package/dist/hooks/useUpdateDocumentTitle/index.js +12 -0
- package/dist/hooks/useUpdateDocumentTitle/index.js.map +1 -0
- package/dist/hooks/useUpdateDocumentTitle/useUpdateDocumentTitle.d.ts +1 -0
- package/dist/locale/en.json +294 -0
- package/dist/locale/nl.json +294 -0
- package/dist/models/admin.d.ts +7 -0
- package/dist/models/admin.js +8 -0
- package/dist/models/admin.js.map +1 -0
- package/dist/models/api.d.ts +9 -0
- package/dist/models/api.js +0 -0
- package/dist/models/auth.d.ts +11 -0
- package/dist/models/auth.js +0 -0
- package/dist/models/config.d.ts +77 -0
- package/dist/models/config.js +0 -0
- package/dist/models/data.d.ts +10 -0
- package/dist/models/data.js +0 -0
- package/dist/models/dataHooks.d.ts +17 -0
- package/dist/models/dataHooks.js +0 -0
- package/dist/models/filter.d.ts +34 -0
- package/dist/models/filter.js +0 -0
- package/dist/models/nestedMenu.d.ts +17 -0
- package/dist/models/nestedMenu.js +0 -0
- package/dist/models/notification.d.ts +11 -0
- package/dist/models/notification.js +0 -0
- package/dist/models/outage.d.ts +6 -0
- package/dist/models/outage.js +0 -0
- package/dist/models/reactRouter.d.ts +25 -0
- package/dist/models/reactRouter.js +0 -0
- package/dist/models/table.d.ts +149 -0
- package/dist/models/table.js +10 -0
- package/dist/models/table.js.map +1 -0
- package/dist/models/theme.d.ts +17 -0
- package/dist/models/theme.js +0 -0
- package/dist/pages/AcceptInvitationPage/AcceptInvitationPage.d.ts +1 -0
- package/dist/pages/AcceptInvitationPage/index.d.ts +1 -0
- package/dist/pages/AcceptInvitationPage/index.js +61 -0
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -0
- package/dist/pages/AdminPage/AdminPage.d.ts +1 -0
- package/dist/pages/AdminPage/index.d.ts +1 -0
- package/dist/pages/AdminPage/index.js +83 -0
- package/dist/pages/AdminPage/index.js.map +1 -0
- package/dist/pages/ChooseIdentityProviderPage/ChooseIdentityProviderPage.d.ts +5 -0
- package/dist/pages/ChooseIdentityProviderPage/index.d.ts +1 -0
- package/dist/pages/ChooseIdentityProviderPage/index.js +85 -0
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -0
- package/dist/pages/CrudPage/CrudPage.d.ts +75 -0
- package/dist/pages/CrudPage/CrudPageDeleteDialog.d.ts +12 -0
- package/dist/pages/CrudPage/CrudPageEditDialog.d.ts +23 -0
- package/dist/pages/CrudPage/index.d.ts +1 -0
- package/dist/pages/CrudPage/index.js +2 -0
- package/dist/pages/ErrorPage/ErrorPage.d.ts +4 -0
- package/dist/pages/ErrorPage/index.d.ts +1 -0
- package/dist/pages/ErrorPage/index.js +19 -0
- package/dist/pages/ErrorPage/index.js.map +1 -0
- package/dist/pages/IdentifierIssuersAdminPage/IdentifierIssuersAdminPage.d.ts +1 -0
- package/dist/pages/IdentifierIssuersAdminPage/index.d.ts +1 -0
- package/dist/pages/IdentifierIssuersAdminPage/index.js +69 -0
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/OrganizationAdminPoliciesAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +98 -0
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationContactsAdminPage/OrganizationContactsAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationContactsAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationContactsAdminPage/index.js +86 -0
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationSitesAdminPage/OrganizationSitesAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationSitesAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationSitesAdminPage/index.js +68 -0
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -0
- package/dist/pages/OrganizationsAdminPage/OrganizationsAdminPage.d.ts +1 -0
- package/dist/pages/OrganizationsAdminPage/index.d.ts +1 -0
- package/dist/pages/OrganizationsAdminPage/index.js +132 -0
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -0
- package/dist/pages/OutagesAdminPage/OutagesAdminPage.d.ts +1 -0
- package/dist/pages/OutagesAdminPage/index.d.ts +1 -0
- package/dist/pages/OutagesAdminPage/index.js +133 -0
- package/dist/pages/OutagesAdminPage/index.js.map +1 -0
- package/dist/pages/PostLoginPage/PostLoginPage.d.ts +1 -0
- package/dist/pages/PostLoginPage/index.d.ts +1 -0
- package/dist/pages/PostLoginPage/index.js +26 -0
- package/dist/pages/PostLoginPage/index.js.map +1 -0
- package/dist/pages/PostLogoutPage/PostLogoutPage.d.ts +1 -0
- package/dist/pages/PostLogoutPage/index.d.ts +1 -0
- package/dist/pages/PostLogoutPage/index.js +32 -0
- package/dist/pages/PostLogoutPage/index.js.map +1 -0
- package/dist/pages/RouterErrorPage/RouterErrorPage.d.ts +1 -0
- package/dist/pages/RouterErrorPage/index.d.ts +1 -0
- package/dist/pages/RouterErrorPage/index.js +20 -0
- package/dist/pages/RouterErrorPage/index.js.map +1 -0
- package/dist/pages/UserInvitationsAdminPage/UserInvitationConsumeDialog.d.ts +9 -0
- package/dist/pages/UserInvitationsAdminPage/UserInvitationShareDialog.d.ts +9 -0
- package/dist/pages/UserInvitationsAdminPage/UserInvitationsAdminPage.d.ts +1 -0
- package/dist/pages/UserInvitationsAdminPage/index.d.ts +1 -0
- package/dist/pages/UserInvitationsAdminPage/index.js +2 -0
- package/dist/pages/UsersAdminPage/UsersAdminPage.d.ts +7 -0
- package/dist/pages/UsersAdminPage/index.d.ts +1 -0
- package/dist/pages/UsersAdminPage/index.js +206 -0
- package/dist/pages/UsersAdminPage/index.js.map +1 -0
- package/dist/routes/adminRoutes.d.ts +9 -0
- package/dist/routes/index.d.ts +2 -0
- package/dist/routes/index.js +258 -0
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/routes.d.ts +8 -0
- package/dist/setup/setup.d.ts +1 -0
- package/dist/setup/setup.js +9 -0
- package/dist/setup/setup.js.map +1 -0
- package/dist/stores/oidcStore/index.d.ts +1 -0
- package/dist/stores/oidcStore/index.js +18 -0
- package/dist/stores/oidcStore/index.js.map +1 -0
- package/dist/stores/oidcStore/oidcStore.d.ts +22 -0
- package/dist/stores/outagesStore/index.d.ts +1 -0
- package/dist/stores/outagesStore/index.js +16 -0
- package/dist/stores/outagesStore/index.js.map +1 -0
- package/dist/stores/outagesStore/outagesStore.d.ts +12 -0
- package/dist/stores/tableStore/TableStoreContext.d.ts +3 -0
- package/dist/stores/tableStore/TableStoreContextProvider.d.ts +7 -0
- package/dist/stores/tableStore/index.d.ts +4 -0
- package/dist/stores/tableStore/index.js +2 -0
- package/dist/stores/tableStore/tableStore.d.ts +102 -0
- package/dist/stores/tableStore/useTableStoreContext.d.ts +3 -0
- package/dist/test/lib/index.d.ts +1 -0
- package/dist/test/lib/render.d.ts +2 -0
- package/dist/theme/demoTheme/demoTheme.d.ts +3 -0
- package/dist/theme/demoTheme/index.d.ts +1 -0
- package/dist/theme/demoTheme/index.js +337 -0
- package/dist/theme/demoTheme/index.js.map +1 -0
- package/dist/utils/AxiosUtil/AxiosUtil.d.ts +13 -0
- package/dist/utils/AxiosUtil/index.d.ts +1 -0
- package/dist/utils/AxiosUtil/index.js +38 -0
- package/dist/utils/AxiosUtil/index.js.map +1 -0
- package/dist/utils/DataHookUtil/DataHookUtil.d.ts +8 -0
- package/dist/utils/DataHookUtil/index.d.ts +1 -0
- package/dist/utils/DataHookUtil/index.js +77 -0
- package/dist/utils/DataHookUtil/index.js.map +1 -0
- package/dist/utils/LoadableUtil/LoadableUtil.d.ts +9 -0
- package/dist/utils/LoadableUtil/index.d.ts +1 -0
- package/dist/utils/LoadableUtil/index.js +25 -0
- package/dist/utils/LoadableUtil/index.js.map +1 -0
- package/dist/utils/MenuDataUtil/MenuDataUtil.d.ts +5 -0
- package/dist/utils/MenuDataUtil/index.d.ts +1 -0
- package/dist/utils/MenuDataUtil/index.js +19 -0
- package/dist/utils/MenuDataUtil/index.js.map +1 -0
- package/dist/utils/NotificationUtil/NotificationUtil.d.ts +4 -0
- package/dist/utils/NotificationUtil/index.d.ts +1 -0
- package/dist/utils/NotificationUtil/index.js +12 -0
- package/dist/utils/NotificationUtil/index.js.map +1 -0
- package/dist/utils/OutageUtil/OutageUtil.d.ts +5 -0
- package/dist/utils/OutageUtil/index.d.ts +1 -0
- package/dist/utils/OutageUtil/index.js +2 -0
- package/dist/utils/StandardConfigUtil/StandardConfigUtil.d.ts +4 -0
- package/dist/utils/StandardConfigUtil/index.d.ts +1 -0
- package/dist/utils/StandardConfigUtil/index.js +76 -0
- package/dist/utils/StandardConfigUtil/index.js.map +1 -0
- package/dist/utils/TableUtil/TableUtil.d.ts +90 -0
- package/dist/utils/TableUtil/index.d.ts +1 -0
- package/dist/utils/TableUtil/index.js +2 -0
- package/dist/utils/TimeUtil/TimeUtil.d.ts +3 -0
- package/dist/utils/TimeUtil/index.d.ts +1 -0
- package/dist/utils/TimeUtil/index.js +19 -0
- package/dist/utils/TimeUtil/index.js.map +1 -0
- package/dist/utils/UserManagerUtil/UserManagerUtil.d.ts +6 -0
- package/dist/utils/UserManagerUtil/index.d.ts +1 -0
- package/dist/utils/UserManagerUtil/index.js +31 -0
- package/dist/utils/UserManagerUtil/index.js.map +1 -0
- package/dist/utils/UserUtil/UserUtil.d.ts +5 -0
- package/dist/utils/UserUtil/index.d.ts +1 -0
- package/dist/utils/UserUtil/index.js +10 -0
- package/dist/utils/UserUtil/index.js.map +1 -0
- package/package.json +585 -0
|
@@ -0,0 +1,1843 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/jwt-decode@4.0.0/node_modules/jwt-decode/build/esm/index.js
|
|
2
|
+
var e = class extends Error {};
|
|
3
|
+
e.prototype.name = "InvalidTokenError";
|
|
4
|
+
function t(e) {
|
|
5
|
+
return decodeURIComponent(atob(e).replace(/(.)/g, (e, t) => {
|
|
6
|
+
let n = t.charCodeAt(0).toString(16).toUpperCase();
|
|
7
|
+
return n.length < 2 && (n = "0" + n), "%" + n;
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
function n(e) {
|
|
11
|
+
let n = e.replace(/-/g, "+").replace(/_/g, "/");
|
|
12
|
+
switch (n.length % 4) {
|
|
13
|
+
case 0: break;
|
|
14
|
+
case 2:
|
|
15
|
+
n += "==";
|
|
16
|
+
break;
|
|
17
|
+
case 3:
|
|
18
|
+
n += "=";
|
|
19
|
+
break;
|
|
20
|
+
default: throw Error("base64 string is not of the correct length");
|
|
21
|
+
}
|
|
22
|
+
try {
|
|
23
|
+
return t(n);
|
|
24
|
+
} catch {
|
|
25
|
+
return atob(n);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function r(t, r) {
|
|
29
|
+
if (typeof t != "string") throw new e("Invalid token specified: must be a string");
|
|
30
|
+
r ||= {};
|
|
31
|
+
let i = r.header === !0 ? 0 : 1, a = t.split(".")[i];
|
|
32
|
+
if (typeof a != "string") throw new e(`Invalid token specified: missing part #${i + 1}`);
|
|
33
|
+
let o;
|
|
34
|
+
try {
|
|
35
|
+
o = n(a);
|
|
36
|
+
} catch (t) {
|
|
37
|
+
throw new e(`Invalid token specified: invalid base64 for part #${i + 1} (${t.message})`);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(o);
|
|
41
|
+
} catch (t) {
|
|
42
|
+
throw new e(`Invalid token specified: invalid json for part #${i + 1} (${t.message})`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
//#region ../../node_modules/.pnpm/oidc-client-ts@3.5.0/node_modules/oidc-client-ts/dist/esm/oidc-client-ts.js
|
|
47
|
+
var i = {
|
|
48
|
+
debug: () => void 0,
|
|
49
|
+
info: () => void 0,
|
|
50
|
+
warn: () => void 0,
|
|
51
|
+
error: () => void 0
|
|
52
|
+
}, a, o, s = /* @__PURE__ */ ((e) => (e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.WARN = 2] = "WARN", e[e.INFO = 3] = "INFO", e[e.DEBUG = 4] = "DEBUG", e))(s || {});
|
|
53
|
+
((e) => {
|
|
54
|
+
function t() {
|
|
55
|
+
a = 3, o = i;
|
|
56
|
+
}
|
|
57
|
+
e.reset = t;
|
|
58
|
+
function n(e) {
|
|
59
|
+
if (!(0 <= e && e <= 4)) throw Error("Invalid log level");
|
|
60
|
+
a = e;
|
|
61
|
+
}
|
|
62
|
+
e.setLevel = n;
|
|
63
|
+
function r(e) {
|
|
64
|
+
o = e;
|
|
65
|
+
}
|
|
66
|
+
e.setLogger = r;
|
|
67
|
+
})(s ||= {});
|
|
68
|
+
var c = class e {
|
|
69
|
+
constructor(e) {
|
|
70
|
+
this._name = e;
|
|
71
|
+
}
|
|
72
|
+
debug(...t) {
|
|
73
|
+
a >= 4 && o.debug(e._format(this._name, this._method), ...t);
|
|
74
|
+
}
|
|
75
|
+
info(...t) {
|
|
76
|
+
a >= 3 && o.info(e._format(this._name, this._method), ...t);
|
|
77
|
+
}
|
|
78
|
+
warn(...t) {
|
|
79
|
+
a >= 2 && o.warn(e._format(this._name, this._method), ...t);
|
|
80
|
+
}
|
|
81
|
+
error(...t) {
|
|
82
|
+
a >= 1 && o.error(e._format(this._name, this._method), ...t);
|
|
83
|
+
}
|
|
84
|
+
throw(e) {
|
|
85
|
+
throw this.error(e), e;
|
|
86
|
+
}
|
|
87
|
+
create(e) {
|
|
88
|
+
let t = Object.create(this);
|
|
89
|
+
return t._method = e, t.debug("begin"), t;
|
|
90
|
+
}
|
|
91
|
+
static createStatic(t, n) {
|
|
92
|
+
let r = new e(`${t}.${n}`);
|
|
93
|
+
return r.debug("begin"), r;
|
|
94
|
+
}
|
|
95
|
+
static _format(e, t) {
|
|
96
|
+
let n = `[${e}]`;
|
|
97
|
+
return t ? `${n} ${t}:` : n;
|
|
98
|
+
}
|
|
99
|
+
static debug(t, ...n) {
|
|
100
|
+
a >= 4 && o.debug(e._format(t), ...n);
|
|
101
|
+
}
|
|
102
|
+
static info(t, ...n) {
|
|
103
|
+
a >= 3 && o.info(e._format(t), ...n);
|
|
104
|
+
}
|
|
105
|
+
static warn(t, ...n) {
|
|
106
|
+
a >= 2 && o.warn(e._format(t), ...n);
|
|
107
|
+
}
|
|
108
|
+
static error(t, ...n) {
|
|
109
|
+
a >= 1 && o.error(e._format(t), ...n);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
s.reset();
|
|
113
|
+
var l = class {
|
|
114
|
+
static decode(e) {
|
|
115
|
+
try {
|
|
116
|
+
return r(e);
|
|
117
|
+
} catch (e) {
|
|
118
|
+
throw c.error("JwtUtils.decode", e), e;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
static async generateSignedJwt(e, t, n) {
|
|
122
|
+
let r = `${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e)))}.${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t)))}`, i = await window.crypto.subtle.sign({
|
|
123
|
+
name: "ECDSA",
|
|
124
|
+
hash: { name: "SHA-256" }
|
|
125
|
+
}, n, new TextEncoder().encode(r));
|
|
126
|
+
return `${r}.${p.encodeBase64Url(new Uint8Array(i))}`;
|
|
127
|
+
}
|
|
128
|
+
static async generateSignedJwtWithHmac(e, t, n) {
|
|
129
|
+
let r = `${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e)))}.${p.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t)))}`, i = await window.crypto.subtle.sign("HMAC", n, new TextEncoder().encode(r));
|
|
130
|
+
return `${r}.${p.encodeBase64Url(new Uint8Array(i))}`;
|
|
131
|
+
}
|
|
132
|
+
}, u = "10000000-1000-4000-8000-100000000000", d = (e) => btoa([...new Uint8Array(e)].map((e) => String.fromCharCode(e)).join("")), f = class e {
|
|
133
|
+
static _randomWord() {
|
|
134
|
+
let e = /* @__PURE__ */ new Uint32Array(1);
|
|
135
|
+
return crypto.getRandomValues(e), e[0];
|
|
136
|
+
}
|
|
137
|
+
static generateUUIDv4() {
|
|
138
|
+
return u.replace(/[018]/g, (t) => (t ^ e._randomWord() & 15 >> t / 4).toString(16)).replace(/-/g, "");
|
|
139
|
+
}
|
|
140
|
+
static generateCodeVerifier() {
|
|
141
|
+
return e.generateUUIDv4() + e.generateUUIDv4() + e.generateUUIDv4();
|
|
142
|
+
}
|
|
143
|
+
static async generateCodeChallenge(e) {
|
|
144
|
+
if (!crypto.subtle) throw Error("Crypto.subtle is available only in secure contexts (HTTPS).");
|
|
145
|
+
try {
|
|
146
|
+
let t = new TextEncoder().encode(e);
|
|
147
|
+
return d(await crypto.subtle.digest("SHA-256", t)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
148
|
+
} catch (e) {
|
|
149
|
+
throw c.error("CryptoUtils.generateCodeChallenge", e), e;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
static generateBasicAuth(e, t) {
|
|
153
|
+
return d(new TextEncoder().encode([e, t].join(":")));
|
|
154
|
+
}
|
|
155
|
+
static async hash(e, t) {
|
|
156
|
+
let n = new TextEncoder().encode(t), r = await crypto.subtle.digest(e, n);
|
|
157
|
+
return new Uint8Array(r);
|
|
158
|
+
}
|
|
159
|
+
static async customCalculateJwkThumbprint(t) {
|
|
160
|
+
let n;
|
|
161
|
+
switch (t.kty) {
|
|
162
|
+
case "RSA":
|
|
163
|
+
n = {
|
|
164
|
+
e: t.e,
|
|
165
|
+
kty: t.kty,
|
|
166
|
+
n: t.n
|
|
167
|
+
};
|
|
168
|
+
break;
|
|
169
|
+
case "EC":
|
|
170
|
+
n = {
|
|
171
|
+
crv: t.crv,
|
|
172
|
+
kty: t.kty,
|
|
173
|
+
x: t.x,
|
|
174
|
+
y: t.y
|
|
175
|
+
};
|
|
176
|
+
break;
|
|
177
|
+
case "OKP":
|
|
178
|
+
n = {
|
|
179
|
+
crv: t.crv,
|
|
180
|
+
kty: t.kty,
|
|
181
|
+
x: t.x
|
|
182
|
+
};
|
|
183
|
+
break;
|
|
184
|
+
case "oct":
|
|
185
|
+
n = {
|
|
186
|
+
crv: t.k,
|
|
187
|
+
kty: t.kty
|
|
188
|
+
};
|
|
189
|
+
break;
|
|
190
|
+
default: throw Error("Unknown jwk type");
|
|
191
|
+
}
|
|
192
|
+
let r = await e.hash("SHA-256", JSON.stringify(n));
|
|
193
|
+
return e.encodeBase64Url(r);
|
|
194
|
+
}
|
|
195
|
+
static async generateDPoPProof({ url: t, accessToken: n, httpMethod: r, keyPair: i, nonce: a }) {
|
|
196
|
+
let o, s, c = {
|
|
197
|
+
jti: window.crypto.randomUUID(),
|
|
198
|
+
htm: r ?? "GET",
|
|
199
|
+
htu: t,
|
|
200
|
+
iat: Math.floor(Date.now() / 1e3)
|
|
201
|
+
};
|
|
202
|
+
n && (o = await e.hash("SHA-256", n), s = e.encodeBase64Url(o), c.ath = s), a && (c.nonce = a);
|
|
203
|
+
try {
|
|
204
|
+
let e = await crypto.subtle.exportKey("jwk", i.publicKey), t = {
|
|
205
|
+
alg: "ES256",
|
|
206
|
+
typ: "dpop+jwt",
|
|
207
|
+
jwk: {
|
|
208
|
+
crv: e.crv,
|
|
209
|
+
kty: e.kty,
|
|
210
|
+
x: e.x,
|
|
211
|
+
y: e.y
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
return await l.generateSignedJwt(t, c, i.privateKey);
|
|
215
|
+
} catch (e) {
|
|
216
|
+
throw e instanceof TypeError ? Error(`Error exporting dpop public key: ${e.message}`) : e;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
static async generateDPoPJkt(t) {
|
|
220
|
+
try {
|
|
221
|
+
let n = await crypto.subtle.exportKey("jwk", t.publicKey);
|
|
222
|
+
return await e.customCalculateJwkThumbprint(n);
|
|
223
|
+
} catch (e) {
|
|
224
|
+
throw e instanceof TypeError ? Error(`Could not retrieve dpop keys from storage: ${e.message}`) : e;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
static async generateDPoPKeys() {
|
|
228
|
+
return await window.crypto.subtle.generateKey({
|
|
229
|
+
name: "ECDSA",
|
|
230
|
+
namedCurve: "P-256"
|
|
231
|
+
}, !1, ["sign", "verify"]);
|
|
232
|
+
}
|
|
233
|
+
static async generateClientAssertionJwt(t, n, r, i = "HS256") {
|
|
234
|
+
let a = Math.floor(Date.now() / 1e3), o = {
|
|
235
|
+
alg: i,
|
|
236
|
+
typ: "JWT"
|
|
237
|
+
}, s = {
|
|
238
|
+
iss: t,
|
|
239
|
+
sub: t,
|
|
240
|
+
aud: r,
|
|
241
|
+
jti: e.generateUUIDv4(),
|
|
242
|
+
exp: a + 300,
|
|
243
|
+
iat: a
|
|
244
|
+
}, c = {
|
|
245
|
+
HS256: "SHA-256",
|
|
246
|
+
HS384: "SHA-384",
|
|
247
|
+
HS512: "SHA-512"
|
|
248
|
+
}[i];
|
|
249
|
+
if (!c) throw Error(`Unsupported algorithm: ${i}. Supported algorithms are: HS256, HS384, HS512`);
|
|
250
|
+
let u = new TextEncoder(), d = await crypto.subtle.importKey("raw", u.encode(n), {
|
|
251
|
+
name: "HMAC",
|
|
252
|
+
hash: c
|
|
253
|
+
}, !1, ["sign"]);
|
|
254
|
+
return await l.generateSignedJwtWithHmac(o, s, d);
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
f.encodeBase64Url = (e) => d(e).replace(/=/g, "").replace(/\+/g, "-").replace(/\//g, "_");
|
|
258
|
+
var p = f, m = class {
|
|
259
|
+
constructor(e) {
|
|
260
|
+
this._name = e, this._callbacks = [], this._logger = new c(`Event('${this._name}')`);
|
|
261
|
+
}
|
|
262
|
+
addHandler(e) {
|
|
263
|
+
return this._callbacks.push(e), () => this.removeHandler(e);
|
|
264
|
+
}
|
|
265
|
+
removeHandler(e) {
|
|
266
|
+
let t = this._callbacks.lastIndexOf(e);
|
|
267
|
+
t >= 0 && this._callbacks.splice(t, 1);
|
|
268
|
+
}
|
|
269
|
+
async raise(...e) {
|
|
270
|
+
this._logger.debug("raise:", ...e);
|
|
271
|
+
for (let t of this._callbacks) await t(...e);
|
|
272
|
+
}
|
|
273
|
+
}, h = class {
|
|
274
|
+
static center({ ...e }) {
|
|
275
|
+
return e.width ??= [
|
|
276
|
+
800,
|
|
277
|
+
720,
|
|
278
|
+
600,
|
|
279
|
+
480
|
|
280
|
+
].find((e) => e <= window.outerWidth / 1.618) ?? 360, e.left ??= Math.max(0, Math.round(window.screenX + (window.outerWidth - e.width) / 2)), e.height != null && (e.top ??= Math.max(0, Math.round(window.screenY + (window.outerHeight - e.height) / 2))), e;
|
|
281
|
+
}
|
|
282
|
+
static serialize(e) {
|
|
283
|
+
return Object.entries(e).filter(([, e]) => e != null).map(([e, t]) => `${e}=${typeof t == "boolean" ? t ? "yes" : "no" : t}`).join(",");
|
|
284
|
+
}
|
|
285
|
+
}, g = class e extends m {
|
|
286
|
+
constructor() {
|
|
287
|
+
super(...arguments), this._logger = new c(`Timer('${this._name}')`), this._timerHandle = null, this._expiration = 0, this._callback = () => {
|
|
288
|
+
let t = this._expiration - e.getEpochTime();
|
|
289
|
+
this._logger.debug("timer completes in", t), this._expiration <= e.getEpochTime() && (this.cancel(), super.raise());
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
static getEpochTime() {
|
|
293
|
+
return Math.floor(Date.now() / 1e3);
|
|
294
|
+
}
|
|
295
|
+
init(t) {
|
|
296
|
+
let n = this._logger.create("init");
|
|
297
|
+
t = Math.max(Math.floor(t), 1);
|
|
298
|
+
let r = e.getEpochTime() + t;
|
|
299
|
+
if (this.expiration === r && this._timerHandle) {
|
|
300
|
+
n.debug("skipping since already initialized for expiration at", this.expiration);
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.cancel(), n.debug("using duration", t), this._expiration = r;
|
|
304
|
+
let i = Math.min(t, 5);
|
|
305
|
+
this._timerHandle = setInterval(this._callback, i * 1e3);
|
|
306
|
+
}
|
|
307
|
+
get expiration() {
|
|
308
|
+
return this._expiration;
|
|
309
|
+
}
|
|
310
|
+
cancel() {
|
|
311
|
+
this._logger.create("cancel"), this._timerHandle &&= (clearInterval(this._timerHandle), null);
|
|
312
|
+
}
|
|
313
|
+
}, _ = class {
|
|
314
|
+
static readParams(e, t = "query") {
|
|
315
|
+
if (!e) throw TypeError("Invalid URL");
|
|
316
|
+
let n = new URL(e, "http://127.0.0.1")[t === "fragment" ? "hash" : "search"];
|
|
317
|
+
return new URLSearchParams(n.slice(1));
|
|
318
|
+
}
|
|
319
|
+
}, v = ";", y = class extends Error {
|
|
320
|
+
constructor(e, t) {
|
|
321
|
+
if (super(e.error_description || e.error || ""), this.form = t, this.name = "ErrorResponse", !e.error) throw c.error("ErrorResponse", "No error passed"), Error("No error passed");
|
|
322
|
+
this.error = e.error, this.error_description = e.error_description ?? null, this.error_uri = e.error_uri ?? null, this.state = e.userState, this.session_state = e.session_state ?? null, this.url_state = e.url_state;
|
|
323
|
+
}
|
|
324
|
+
}, b = class extends Error {
|
|
325
|
+
constructor(e) {
|
|
326
|
+
super(e), this.name = "ErrorTimeout";
|
|
327
|
+
}
|
|
328
|
+
}, x = class {
|
|
329
|
+
constructor(e) {
|
|
330
|
+
this._logger = new c("AccessTokenEvents"), this._expiringTimer = new g("Access token expiring"), this._expiredTimer = new g("Access token expired"), this._expiringNotificationTimeInSeconds = e.expiringNotificationTimeInSeconds;
|
|
331
|
+
}
|
|
332
|
+
async load(e) {
|
|
333
|
+
let t = this._logger.create("load");
|
|
334
|
+
if (e.access_token && e.expires_in !== void 0) {
|
|
335
|
+
let n = e.expires_in;
|
|
336
|
+
if (t.debug("access token present, remaining duration:", n), n > 0) {
|
|
337
|
+
let e = n - this._expiringNotificationTimeInSeconds;
|
|
338
|
+
e <= 0 && (e = 1), t.debug("registering expiring timer, raising in", e, "seconds"), this._expiringTimer.init(e);
|
|
339
|
+
} else t.debug("canceling existing expiring timer because we're past expiration."), this._expiringTimer.cancel();
|
|
340
|
+
let r = n + 1;
|
|
341
|
+
t.debug("registering expired timer, raising in", r, "seconds"), this._expiredTimer.init(r);
|
|
342
|
+
} else this._expiringTimer.cancel(), this._expiredTimer.cancel();
|
|
343
|
+
}
|
|
344
|
+
async unload() {
|
|
345
|
+
this._logger.debug("unload: canceling existing access token timers"), this._expiringTimer.cancel(), this._expiredTimer.cancel();
|
|
346
|
+
}
|
|
347
|
+
addAccessTokenExpiring(e) {
|
|
348
|
+
return this._expiringTimer.addHandler(e);
|
|
349
|
+
}
|
|
350
|
+
removeAccessTokenExpiring(e) {
|
|
351
|
+
this._expiringTimer.removeHandler(e);
|
|
352
|
+
}
|
|
353
|
+
addAccessTokenExpired(e) {
|
|
354
|
+
return this._expiredTimer.addHandler(e);
|
|
355
|
+
}
|
|
356
|
+
removeAccessTokenExpired(e) {
|
|
357
|
+
this._expiredTimer.removeHandler(e);
|
|
358
|
+
}
|
|
359
|
+
}, S = class {
|
|
360
|
+
constructor(e, t, n, r, i) {
|
|
361
|
+
this._callback = e, this._client_id = t, this._intervalInSeconds = r, this._stopOnError = i, this._logger = new c("CheckSessionIFrame"), this._timer = null, this._session_state = null, this._message = (e) => {
|
|
362
|
+
e.origin === this._frame_origin && e.source === this._frame.contentWindow && (e.data === "error" ? (this._logger.error("error message from check session op iframe"), this._stopOnError && this.stop()) : e.data === "changed" ? (this._logger.debug("changed message from check session op iframe"), this.stop(), this._callback()) : this._logger.debug(e.data + " message from check session op iframe"));
|
|
363
|
+
};
|
|
364
|
+
let a = new URL(n);
|
|
365
|
+
this._frame_origin = a.origin, this._frame = window.document.createElement("iframe"), this._frame.style.visibility = "hidden", this._frame.style.position = "fixed", this._frame.style.left = "-1000px", this._frame.style.top = "0", this._frame.width = "0", this._frame.height = "0", this._frame.src = a.href;
|
|
366
|
+
}
|
|
367
|
+
load() {
|
|
368
|
+
return new Promise((e) => {
|
|
369
|
+
this._frame.onload = () => {
|
|
370
|
+
e();
|
|
371
|
+
}, window.document.body.appendChild(this._frame), window.addEventListener("message", this._message, !1);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
start(e) {
|
|
375
|
+
if (this._session_state === e) return;
|
|
376
|
+
this._logger.create("start"), this.stop(), this._session_state = e;
|
|
377
|
+
let t = () => {
|
|
378
|
+
!this._frame.contentWindow || !this._session_state || this._frame.contentWindow.postMessage(this._client_id + " " + this._session_state, this._frame_origin);
|
|
379
|
+
};
|
|
380
|
+
t(), this._timer = setInterval(t, this._intervalInSeconds * 1e3);
|
|
381
|
+
}
|
|
382
|
+
stop() {
|
|
383
|
+
this._logger.create("stop"), this._session_state = null, this._timer &&= (clearInterval(this._timer), null);
|
|
384
|
+
}
|
|
385
|
+
}, C = class {
|
|
386
|
+
constructor() {
|
|
387
|
+
this._logger = new c("InMemoryWebStorage"), this._data = {};
|
|
388
|
+
}
|
|
389
|
+
clear() {
|
|
390
|
+
this._logger.create("clear"), this._data = {};
|
|
391
|
+
}
|
|
392
|
+
getItem(e) {
|
|
393
|
+
return this._logger.create(`getItem('${e}')`), this._data[e];
|
|
394
|
+
}
|
|
395
|
+
setItem(e, t) {
|
|
396
|
+
this._logger.create(`setItem('${e}')`), this._data[e] = t;
|
|
397
|
+
}
|
|
398
|
+
removeItem(e) {
|
|
399
|
+
this._logger.create(`removeItem('${e}')`), delete this._data[e];
|
|
400
|
+
}
|
|
401
|
+
get length() {
|
|
402
|
+
return Object.getOwnPropertyNames(this._data).length;
|
|
403
|
+
}
|
|
404
|
+
key(e) {
|
|
405
|
+
return Object.getOwnPropertyNames(this._data)[e];
|
|
406
|
+
}
|
|
407
|
+
}, w = class extends Error {
|
|
408
|
+
constructor(e, t) {
|
|
409
|
+
super(t), this.name = "ErrorDPoPNonce", this.nonce = e;
|
|
410
|
+
}
|
|
411
|
+
}, T = class {
|
|
412
|
+
constructor(e = [], t = null, n = {}) {
|
|
413
|
+
this._jwtHandler = t, this._extraHeaders = n, this._logger = new c("JsonService"), this._contentTypes = [], this._contentTypes.push(...e, "application/json"), t && this._contentTypes.push("application/jwt");
|
|
414
|
+
}
|
|
415
|
+
async fetchWithTimeout(e, t = {}) {
|
|
416
|
+
let { timeoutInSeconds: n, ...r } = t;
|
|
417
|
+
if (!n) return await fetch(e, r);
|
|
418
|
+
let i = new AbortController(), a = setTimeout(() => i.abort(), n * 1e3);
|
|
419
|
+
try {
|
|
420
|
+
return await fetch(e, {
|
|
421
|
+
...t,
|
|
422
|
+
signal: i.signal
|
|
423
|
+
});
|
|
424
|
+
} catch (e) {
|
|
425
|
+
throw e instanceof DOMException && e.name === "AbortError" ? new b("Network timed out") : e;
|
|
426
|
+
} finally {
|
|
427
|
+
clearTimeout(a);
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
async getJson(e, { token: t, credentials: n, timeoutInSeconds: r } = {}) {
|
|
431
|
+
let i = this._logger.create("getJson"), a = { Accept: this._contentTypes.join(", ") };
|
|
432
|
+
t && (i.debug("token passed, setting Authorization header"), a.Authorization = "Bearer " + t), this._appendExtraHeaders(a);
|
|
433
|
+
let o;
|
|
434
|
+
try {
|
|
435
|
+
i.debug("url:", e), o = await this.fetchWithTimeout(e, {
|
|
436
|
+
method: "GET",
|
|
437
|
+
headers: a,
|
|
438
|
+
timeoutInSeconds: r,
|
|
439
|
+
credentials: n
|
|
440
|
+
});
|
|
441
|
+
} catch (e) {
|
|
442
|
+
throw i.error("Network Error"), e;
|
|
443
|
+
}
|
|
444
|
+
i.debug("HTTP response received, status", o.status);
|
|
445
|
+
let s = o.headers.get("Content-Type");
|
|
446
|
+
if (s && !this._contentTypes.find((e) => s.startsWith(e)) && i.throw(/* @__PURE__ */ Error(`Invalid response Content-Type: ${s ?? "undefined"}, from URL: ${e}`)), o.ok && this._jwtHandler && s?.startsWith("application/jwt")) return await this._jwtHandler(await o.text());
|
|
447
|
+
let c;
|
|
448
|
+
try {
|
|
449
|
+
c = await o.json();
|
|
450
|
+
} catch (e) {
|
|
451
|
+
throw i.error("Error parsing JSON response", e), o.ok ? e : Error(`${o.statusText} (${o.status})`);
|
|
452
|
+
}
|
|
453
|
+
if (!o.ok) throw i.error("Error from server:", c), c.error ? new y(c) : Error(`${o.statusText} (${o.status}): ${JSON.stringify(c)}`);
|
|
454
|
+
return c;
|
|
455
|
+
}
|
|
456
|
+
async postForm(e, { body: t, basicAuth: n, timeoutInSeconds: r, initCredentials: i, extraHeaders: a }) {
|
|
457
|
+
let o = this._logger.create("postForm"), s = {
|
|
458
|
+
Accept: this._contentTypes.join(", "),
|
|
459
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
460
|
+
...a
|
|
461
|
+
};
|
|
462
|
+
n !== void 0 && (s.Authorization = "Basic " + n), this._appendExtraHeaders(s);
|
|
463
|
+
let c;
|
|
464
|
+
try {
|
|
465
|
+
o.debug("url:", e), c = await this.fetchWithTimeout(e, {
|
|
466
|
+
method: "POST",
|
|
467
|
+
headers: s,
|
|
468
|
+
body: t,
|
|
469
|
+
timeoutInSeconds: r,
|
|
470
|
+
credentials: i
|
|
471
|
+
});
|
|
472
|
+
} catch (e) {
|
|
473
|
+
throw o.error("Network error"), e;
|
|
474
|
+
}
|
|
475
|
+
o.debug("HTTP response received, status", c.status);
|
|
476
|
+
let l = c.headers.get("Content-Type");
|
|
477
|
+
if (l && !this._contentTypes.find((e) => l.startsWith(e))) throw Error(`Invalid response Content-Type: ${l ?? "undefined"}, from URL: ${e}`);
|
|
478
|
+
let u = await c.text(), d = {};
|
|
479
|
+
if (u) try {
|
|
480
|
+
d = JSON.parse(u);
|
|
481
|
+
} catch (e) {
|
|
482
|
+
throw o.error("Error parsing JSON response", e), c.ok ? e : Error(`${c.statusText} (${c.status})`);
|
|
483
|
+
}
|
|
484
|
+
if (!c.ok) throw o.error("Error from server:", d), c.headers.has("dpop-nonce") ? new w(c.headers.get("dpop-nonce"), `${JSON.stringify(d)}`) : d.error ? new y(d, t) : Error(`${c.statusText} (${c.status}): ${JSON.stringify(d)}`);
|
|
485
|
+
return d;
|
|
486
|
+
}
|
|
487
|
+
_appendExtraHeaders(e) {
|
|
488
|
+
let t = this._logger.create("appendExtraHeaders"), n = Object.keys(this._extraHeaders), r = ["accept", "content-type"], i = ["authorization"];
|
|
489
|
+
n.length !== 0 && n.forEach((n) => {
|
|
490
|
+
if (r.includes(n.toLocaleLowerCase())) {
|
|
491
|
+
t.warn("Protected header could not be set", n, r);
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
if (i.includes(n.toLocaleLowerCase()) && Object.keys(e).includes(n)) {
|
|
495
|
+
t.warn("Header could not be overridden", n, i);
|
|
496
|
+
return;
|
|
497
|
+
}
|
|
498
|
+
let a = typeof this._extraHeaders[n] == "function" ? this._extraHeaders[n]() : this._extraHeaders[n];
|
|
499
|
+
a && a !== "" && (e[n] = a);
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
}, E = class {
|
|
503
|
+
constructor(e) {
|
|
504
|
+
this._settings = e, this._logger = new c("MetadataService"), this._signingKeys = null, this._metadata = null, this._metadataUrl = this._settings.metadataUrl, this._jsonService = new T(["application/jwk-set+json"], null, this._settings.extraHeaders), this._settings.signingKeys && (this._logger.debug("using signingKeys from settings"), this._signingKeys = this._settings.signingKeys), this._settings.metadata && (this._logger.debug("using metadata from settings"), this._metadata = this._settings.metadata), this._settings.fetchRequestCredentials && (this._logger.debug("using fetchRequestCredentials from settings"), this._fetchRequestCredentials = this._settings.fetchRequestCredentials);
|
|
505
|
+
}
|
|
506
|
+
resetSigningKeys() {
|
|
507
|
+
this._signingKeys = null;
|
|
508
|
+
}
|
|
509
|
+
async getMetadata() {
|
|
510
|
+
let e = this._logger.create("getMetadata");
|
|
511
|
+
if (this._metadata) return e.debug("using cached values"), this._metadata;
|
|
512
|
+
if (!this._metadataUrl) throw e.throw(/* @__PURE__ */ Error("No authority or metadataUrl configured on settings")), null;
|
|
513
|
+
e.debug("getting metadata from", this._metadataUrl);
|
|
514
|
+
let t = await this._jsonService.getJson(this._metadataUrl, {
|
|
515
|
+
credentials: this._fetchRequestCredentials,
|
|
516
|
+
timeoutInSeconds: this._settings.requestTimeoutInSeconds
|
|
517
|
+
});
|
|
518
|
+
return e.debug("merging remote JSON with seed metadata"), this._metadata = Object.assign({}, t, this._settings.metadataSeed), this._metadata;
|
|
519
|
+
}
|
|
520
|
+
getIssuer() {
|
|
521
|
+
return this._getMetadataProperty("issuer");
|
|
522
|
+
}
|
|
523
|
+
getAuthorizationEndpoint() {
|
|
524
|
+
return this._getMetadataProperty("authorization_endpoint");
|
|
525
|
+
}
|
|
526
|
+
getUserInfoEndpoint() {
|
|
527
|
+
return this._getMetadataProperty("userinfo_endpoint");
|
|
528
|
+
}
|
|
529
|
+
getTokenEndpoint(e = !0) {
|
|
530
|
+
return this._getMetadataProperty("token_endpoint", e);
|
|
531
|
+
}
|
|
532
|
+
getCheckSessionIframe() {
|
|
533
|
+
return this._getMetadataProperty("check_session_iframe", !0);
|
|
534
|
+
}
|
|
535
|
+
getEndSessionEndpoint() {
|
|
536
|
+
return this._getMetadataProperty("end_session_endpoint", !0);
|
|
537
|
+
}
|
|
538
|
+
getRevocationEndpoint(e = !0) {
|
|
539
|
+
return this._getMetadataProperty("revocation_endpoint", e);
|
|
540
|
+
}
|
|
541
|
+
getKeysEndpoint(e = !0) {
|
|
542
|
+
return this._getMetadataProperty("jwks_uri", e);
|
|
543
|
+
}
|
|
544
|
+
async _getMetadataProperty(e, t = !1) {
|
|
545
|
+
let n = this._logger.create(`_getMetadataProperty('${e}')`), r = await this.getMetadata();
|
|
546
|
+
if (n.debug("resolved"), r[e] === void 0) {
|
|
547
|
+
if (t === !0) {
|
|
548
|
+
n.warn("Metadata does not contain optional property");
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
n.throw(/* @__PURE__ */ Error("Metadata does not contain property " + e));
|
|
552
|
+
}
|
|
553
|
+
return r[e];
|
|
554
|
+
}
|
|
555
|
+
async getSigningKeys() {
|
|
556
|
+
let e = this._logger.create("getSigningKeys");
|
|
557
|
+
if (this._signingKeys) return e.debug("returning signingKeys from cache"), this._signingKeys;
|
|
558
|
+
let t = await this.getKeysEndpoint(!1);
|
|
559
|
+
e.debug("got jwks_uri", t);
|
|
560
|
+
let n = await this._jsonService.getJson(t, { timeoutInSeconds: this._settings.requestTimeoutInSeconds });
|
|
561
|
+
if (e.debug("got key set", n), !Array.isArray(n.keys)) throw e.throw(/* @__PURE__ */ Error("Missing keys on keyset")), null;
|
|
562
|
+
return this._signingKeys = n.keys, this._signingKeys;
|
|
563
|
+
}
|
|
564
|
+
}, D = class {
|
|
565
|
+
constructor({ prefix: e = "oidc.", store: t = localStorage } = {}) {
|
|
566
|
+
this._logger = new c("WebStorageStateStore"), this._store = t, this._prefix = e;
|
|
567
|
+
}
|
|
568
|
+
async set(e, t) {
|
|
569
|
+
this._logger.create(`set('${e}')`), e = this._prefix + e, await this._store.setItem(e, t);
|
|
570
|
+
}
|
|
571
|
+
async get(e) {
|
|
572
|
+
return this._logger.create(`get('${e}')`), e = this._prefix + e, await this._store.getItem(e);
|
|
573
|
+
}
|
|
574
|
+
async remove(e) {
|
|
575
|
+
this._logger.create(`remove('${e}')`), e = this._prefix + e;
|
|
576
|
+
let t = await this._store.getItem(e);
|
|
577
|
+
return await this._store.removeItem(e), t;
|
|
578
|
+
}
|
|
579
|
+
async getAllKeys() {
|
|
580
|
+
this._logger.create("getAllKeys");
|
|
581
|
+
let e = await this._store.length, t = [];
|
|
582
|
+
for (let n = 0; n < e; n++) {
|
|
583
|
+
let e = await this._store.key(n);
|
|
584
|
+
e && e.indexOf(this._prefix) === 0 && t.push(e.substr(this._prefix.length));
|
|
585
|
+
}
|
|
586
|
+
return t;
|
|
587
|
+
}
|
|
588
|
+
}, ee = "code", O = "openid", te = "client_secret_post", k = 900, A = class {
|
|
589
|
+
constructor({ authority: e, metadataUrl: t, metadata: n, signingKeys: r, metadataSeed: i, client_id: a, client_secret: o, response_type: s = ee, scope: c = O, redirect_uri: l, post_logout_redirect_uri: u, client_authentication: d = te, token_endpoint_auth_signing_alg: f = "HS256", prompt: p, display: m, max_age: h, ui_locales: g, acr_values: _, resource: v, response_mode: y, filterProtocolClaims: b = !0, loadUserInfo: x = !1, requestTimeoutInSeconds: S, staleStateAgeInSeconds: w = k, mergeClaimsStrategy: T = { array: "replace" }, disablePKCE: E = !1, stateStore: A, revokeTokenAdditionalContentTypes: j, fetchRequestCredentials: M, refreshTokenAllowedScope: N, extraQueryParams: P = {}, extraTokenParams: F = {}, extraHeaders: I = {}, dpop: L, omitScopeWhenRequesting: R = !1 }) {
|
|
590
|
+
if (this.authority = e, t ? this.metadataUrl = t : (this.metadataUrl = e, e && (this.metadataUrl.endsWith("/") || (this.metadataUrl += "/"), this.metadataUrl += ".well-known/openid-configuration")), this.metadata = n, this.metadataSeed = i, this.signingKeys = r, this.client_id = a, this.client_secret = o, this.response_type = s, this.scope = c, this.redirect_uri = l, this.post_logout_redirect_uri = u, this.client_authentication = d, this.token_endpoint_auth_signing_alg = f, this.prompt = p, this.display = m, this.max_age = h, this.ui_locales = g, this.acr_values = _, this.resource = v, this.response_mode = y, this.filterProtocolClaims = b ?? !0, this.loadUserInfo = !!x, this.staleStateAgeInSeconds = w, this.mergeClaimsStrategy = T, this.omitScopeWhenRequesting = R, this.disablePKCE = !!E, this.revokeTokenAdditionalContentTypes = j, this.fetchRequestCredentials = M || "same-origin", this.requestTimeoutInSeconds = S, A) this.stateStore = A;
|
|
591
|
+
else {
|
|
592
|
+
let e = typeof window < "u" ? window.localStorage : new C();
|
|
593
|
+
this.stateStore = new D({ store: e });
|
|
594
|
+
}
|
|
595
|
+
if (this.refreshTokenAllowedScope = N, this.extraQueryParams = P, this.extraTokenParams = F, this.extraHeaders = I, this.dpop = L, this.dpop && !this.dpop?.store) throw Error("A DPoPStore is required when dpop is enabled");
|
|
596
|
+
}
|
|
597
|
+
}, j = class {
|
|
598
|
+
constructor(e, t) {
|
|
599
|
+
this._settings = e, this._metadataService = t, this._logger = new c("UserInfoService"), this._getClaimsFromJwt = async (e) => {
|
|
600
|
+
let t = this._logger.create("_getClaimsFromJwt");
|
|
601
|
+
try {
|
|
602
|
+
let n = l.decode(e);
|
|
603
|
+
return t.debug("JWT decoding successful"), n;
|
|
604
|
+
} catch (e) {
|
|
605
|
+
throw t.error("Error parsing JWT response"), e;
|
|
606
|
+
}
|
|
607
|
+
}, this._jsonService = new T(void 0, this._getClaimsFromJwt, this._settings.extraHeaders);
|
|
608
|
+
}
|
|
609
|
+
async getClaims(e) {
|
|
610
|
+
let t = this._logger.create("getClaims");
|
|
611
|
+
e || this._logger.throw(/* @__PURE__ */ Error("No token passed"));
|
|
612
|
+
let n = await this._metadataService.getUserInfoEndpoint();
|
|
613
|
+
t.debug("got userinfo url", n);
|
|
614
|
+
let r = await this._jsonService.getJson(n, {
|
|
615
|
+
token: e,
|
|
616
|
+
credentials: this._settings.fetchRequestCredentials,
|
|
617
|
+
timeoutInSeconds: this._settings.requestTimeoutInSeconds
|
|
618
|
+
});
|
|
619
|
+
return t.debug("got claims", r), r;
|
|
620
|
+
}
|
|
621
|
+
}, M = class {
|
|
622
|
+
constructor(e, t) {
|
|
623
|
+
this._settings = e, this._metadataService = t, this._logger = new c("TokenClient"), this._jsonService = new T(this._settings.revokeTokenAdditionalContentTypes, null, this._settings.extraHeaders);
|
|
624
|
+
}
|
|
625
|
+
async exchangeCode({ grant_type: e = "authorization_code", redirect_uri: t = this._settings.redirect_uri, client_id: n = this._settings.client_id, client_secret: r = this._settings.client_secret, extraHeaders: i, ...a }) {
|
|
626
|
+
let o = this._logger.create("exchangeCode");
|
|
627
|
+
n || o.throw(/* @__PURE__ */ Error("A client_id is required")), t || o.throw(/* @__PURE__ */ Error("A redirect_uri is required")), a.code || o.throw(/* @__PURE__ */ Error("A code is required"));
|
|
628
|
+
let s = new URLSearchParams({
|
|
629
|
+
grant_type: e,
|
|
630
|
+
redirect_uri: t
|
|
631
|
+
});
|
|
632
|
+
for (let [e, t] of Object.entries(a)) t != null && s.set(e, t);
|
|
633
|
+
if ((this._settings.client_authentication === "client_secret_basic" || this._settings.client_authentication === "client_secret_jwt") && r == null) throw o.throw(/* @__PURE__ */ Error("A client_secret is required")), null;
|
|
634
|
+
let c, l = await this._metadataService.getTokenEndpoint(!1);
|
|
635
|
+
switch (this._settings.client_authentication) {
|
|
636
|
+
case "client_secret_basic":
|
|
637
|
+
c = p.generateBasicAuth(n, r);
|
|
638
|
+
break;
|
|
639
|
+
case "client_secret_post":
|
|
640
|
+
s.append("client_id", n), r && s.append("client_secret", r);
|
|
641
|
+
break;
|
|
642
|
+
case "client_secret_jwt": {
|
|
643
|
+
let e = await p.generateClientAssertionJwt(n, r, l, this._settings.token_endpoint_auth_signing_alg);
|
|
644
|
+
s.append("client_id", n), s.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), s.append("client_assertion", e);
|
|
645
|
+
break;
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
o.debug("got token endpoint");
|
|
649
|
+
let u = await this._jsonService.postForm(l, {
|
|
650
|
+
body: s,
|
|
651
|
+
basicAuth: c,
|
|
652
|
+
timeoutInSeconds: this._settings.requestTimeoutInSeconds,
|
|
653
|
+
initCredentials: this._settings.fetchRequestCredentials,
|
|
654
|
+
extraHeaders: i
|
|
655
|
+
});
|
|
656
|
+
return o.debug("got response"), u;
|
|
657
|
+
}
|
|
658
|
+
async exchangeCredentials({ grant_type: e = "password", client_id: t = this._settings.client_id, client_secret: n = this._settings.client_secret, scope: r = this._settings.scope, ...i }) {
|
|
659
|
+
let a = this._logger.create("exchangeCredentials");
|
|
660
|
+
t || a.throw(/* @__PURE__ */ Error("A client_id is required"));
|
|
661
|
+
let o = new URLSearchParams({ grant_type: e });
|
|
662
|
+
this._settings.omitScopeWhenRequesting || o.set("scope", r);
|
|
663
|
+
for (let [e, t] of Object.entries(i)) t != null && o.set(e, t);
|
|
664
|
+
if ((this._settings.client_authentication === "client_secret_basic" || this._settings.client_authentication === "client_secret_jwt") && n == null) throw a.throw(/* @__PURE__ */ Error("A client_secret is required")), null;
|
|
665
|
+
let s, c = await this._metadataService.getTokenEndpoint(!1);
|
|
666
|
+
switch (this._settings.client_authentication) {
|
|
667
|
+
case "client_secret_basic":
|
|
668
|
+
s = p.generateBasicAuth(t, n);
|
|
669
|
+
break;
|
|
670
|
+
case "client_secret_post":
|
|
671
|
+
o.append("client_id", t), n && o.append("client_secret", n);
|
|
672
|
+
break;
|
|
673
|
+
case "client_secret_jwt": {
|
|
674
|
+
let e = await p.generateClientAssertionJwt(t, n, c, this._settings.token_endpoint_auth_signing_alg);
|
|
675
|
+
o.append("client_id", t), o.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), o.append("client_assertion", e);
|
|
676
|
+
break;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
a.debug("got token endpoint");
|
|
680
|
+
let l = await this._jsonService.postForm(c, {
|
|
681
|
+
body: o,
|
|
682
|
+
basicAuth: s,
|
|
683
|
+
timeoutInSeconds: this._settings.requestTimeoutInSeconds,
|
|
684
|
+
initCredentials: this._settings.fetchRequestCredentials
|
|
685
|
+
});
|
|
686
|
+
return a.debug("got response"), l;
|
|
687
|
+
}
|
|
688
|
+
async exchangeRefreshToken({ grant_type: e = "refresh_token", client_id: t = this._settings.client_id, client_secret: n = this._settings.client_secret, timeoutInSeconds: r, extraHeaders: i, ...a }) {
|
|
689
|
+
let o = this._logger.create("exchangeRefreshToken");
|
|
690
|
+
t || o.throw(/* @__PURE__ */ Error("A client_id is required")), a.refresh_token || o.throw(/* @__PURE__ */ Error("A refresh_token is required"));
|
|
691
|
+
let s = new URLSearchParams({ grant_type: e });
|
|
692
|
+
for (let [e, t] of Object.entries(a)) Array.isArray(t) ? t.forEach((t) => s.append(e, t)) : t != null && s.set(e, t);
|
|
693
|
+
if ((this._settings.client_authentication === "client_secret_basic" || this._settings.client_authentication === "client_secret_jwt") && n == null) throw o.throw(/* @__PURE__ */ Error("A client_secret is required")), null;
|
|
694
|
+
let c, l = await this._metadataService.getTokenEndpoint(!1);
|
|
695
|
+
switch (this._settings.client_authentication) {
|
|
696
|
+
case "client_secret_basic":
|
|
697
|
+
c = p.generateBasicAuth(t, n);
|
|
698
|
+
break;
|
|
699
|
+
case "client_secret_post":
|
|
700
|
+
s.append("client_id", t), n && s.append("client_secret", n);
|
|
701
|
+
break;
|
|
702
|
+
case "client_secret_jwt": {
|
|
703
|
+
let e = await p.generateClientAssertionJwt(t, n, l, this._settings.token_endpoint_auth_signing_alg);
|
|
704
|
+
s.append("client_id", t), s.append("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"), s.append("client_assertion", e);
|
|
705
|
+
break;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
o.debug("got token endpoint");
|
|
709
|
+
let u = await this._jsonService.postForm(l, {
|
|
710
|
+
body: s,
|
|
711
|
+
basicAuth: c,
|
|
712
|
+
timeoutInSeconds: r,
|
|
713
|
+
initCredentials: this._settings.fetchRequestCredentials,
|
|
714
|
+
extraHeaders: i
|
|
715
|
+
});
|
|
716
|
+
return o.debug("got response"), u;
|
|
717
|
+
}
|
|
718
|
+
async revoke(e) {
|
|
719
|
+
let t = this._logger.create("revoke");
|
|
720
|
+
e.token || t.throw(/* @__PURE__ */ Error("A token is required"));
|
|
721
|
+
let n = await this._metadataService.getRevocationEndpoint(!1);
|
|
722
|
+
t.debug(`got revocation endpoint, revoking ${e.token_type_hint ?? "default token type"}`);
|
|
723
|
+
let r = new URLSearchParams();
|
|
724
|
+
for (let [t, n] of Object.entries(e)) n != null && r.set(t, n);
|
|
725
|
+
r.set("client_id", this._settings.client_id), this._settings.client_secret && r.set("client_secret", this._settings.client_secret), await this._jsonService.postForm(n, {
|
|
726
|
+
body: r,
|
|
727
|
+
timeoutInSeconds: this._settings.requestTimeoutInSeconds
|
|
728
|
+
}), t.debug("got response");
|
|
729
|
+
}
|
|
730
|
+
}, N = class {
|
|
731
|
+
constructor(e, t, n) {
|
|
732
|
+
this._settings = e, this._metadataService = t, this._claimsService = n, this._logger = new c("ResponseValidator"), this._userInfoService = new j(this._settings, this._metadataService), this._tokenClient = new M(this._settings, this._metadataService);
|
|
733
|
+
}
|
|
734
|
+
async validateSigninResponse(e, t, n) {
|
|
735
|
+
let r = this._logger.create("validateSigninResponse");
|
|
736
|
+
this._processSigninState(e, t), r.debug("state processed"), await this._processCode(e, t, n), r.debug("code processed"), e.isOpenId && this._validateIdTokenAttributes(e, "", t.nonce), r.debug("tokens validated"), await this._processClaims(e, t?.skipUserInfo, e.isOpenId), r.debug("claims processed");
|
|
737
|
+
}
|
|
738
|
+
async validateCredentialsResponse(e, t) {
|
|
739
|
+
let n = this._logger.create("validateCredentialsResponse"), r = e.isOpenId && !!e.id_token;
|
|
740
|
+
r && this._validateIdTokenAttributes(e), n.debug("tokens validated"), await this._processClaims(e, t, r), n.debug("claims processed");
|
|
741
|
+
}
|
|
742
|
+
async validateRefreshResponse(e, t) {
|
|
743
|
+
let n = this._logger.create("validateRefreshResponse");
|
|
744
|
+
e.userState = t.data, e.session_state ??= t.session_state, e.scope ??= t.scope, e.isOpenId && e.id_token && (this._validateIdTokenAttributes(e, t.id_token), n.debug("ID Token validated")), e.id_token || (e.id_token = t.id_token, e.profile = t.profile);
|
|
745
|
+
let r = e.isOpenId && !!e.id_token;
|
|
746
|
+
await this._processClaims(e, !1, r), n.debug("claims processed");
|
|
747
|
+
}
|
|
748
|
+
validateSignoutResponse(e, t) {
|
|
749
|
+
let n = this._logger.create("validateSignoutResponse");
|
|
750
|
+
if (t.id !== e.state && n.throw(/* @__PURE__ */ Error("State does not match")), n.debug("state validated"), e.userState = t.data, e.error) throw n.warn("Response was error", e.error), new y(e);
|
|
751
|
+
}
|
|
752
|
+
_processSigninState(e, t) {
|
|
753
|
+
let n = this._logger.create("_processSigninState");
|
|
754
|
+
if (t.id !== e.state && n.throw(/* @__PURE__ */ Error("State does not match")), t.client_id || n.throw(/* @__PURE__ */ Error("No client_id on state")), t.authority || n.throw(/* @__PURE__ */ Error("No authority on state")), this._settings.authority !== t.authority && n.throw(/* @__PURE__ */ Error("authority mismatch on settings vs. signin state")), this._settings.client_id && this._settings.client_id !== t.client_id && n.throw(/* @__PURE__ */ Error("client_id mismatch on settings vs. signin state")), n.debug("state validated"), e.userState = t.data, e.url_state = t.url_state, e.scope ??= t.scope, e.error) throw n.warn("Response was error", e.error), new y(e);
|
|
755
|
+
t.code_verifier && !e.code && n.throw(/* @__PURE__ */ Error("Expected code in response"));
|
|
756
|
+
}
|
|
757
|
+
async _processClaims(e, t = !1, n = !0) {
|
|
758
|
+
let r = this._logger.create("_processClaims");
|
|
759
|
+
if (e.profile = this._claimsService.filterProtocolClaims(e.profile), t || !this._settings.loadUserInfo || !e.access_token) {
|
|
760
|
+
r.debug("not loading user info");
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
r.debug("loading user info");
|
|
764
|
+
let i = await this._userInfoService.getClaims(e.access_token);
|
|
765
|
+
r.debug("user info claims received from user info endpoint"), n && i.sub !== e.profile.sub && r.throw(/* @__PURE__ */ Error("subject from UserInfo response does not match subject in ID Token")), e.profile = this._claimsService.mergeClaims(e.profile, this._claimsService.filterProtocolClaims(i)), r.debug("user info claims received, updated profile:", e.profile);
|
|
766
|
+
}
|
|
767
|
+
async _processCode(e, t, n) {
|
|
768
|
+
let r = this._logger.create("_processCode");
|
|
769
|
+
if (e.code) {
|
|
770
|
+
r.debug("Validating code");
|
|
771
|
+
let i = await this._tokenClient.exchangeCode({
|
|
772
|
+
client_id: t.client_id,
|
|
773
|
+
client_secret: t.client_secret,
|
|
774
|
+
code: e.code,
|
|
775
|
+
redirect_uri: t.redirect_uri,
|
|
776
|
+
code_verifier: t.code_verifier,
|
|
777
|
+
extraHeaders: n,
|
|
778
|
+
...t.extraTokenParams
|
|
779
|
+
});
|
|
780
|
+
Object.assign(e, i);
|
|
781
|
+
} else r.debug("No code to process");
|
|
782
|
+
}
|
|
783
|
+
_validateIdTokenAttributes(e, t, n) {
|
|
784
|
+
let r = this._logger.create("_validateIdTokenAttributes");
|
|
785
|
+
r.debug("decoding ID Token JWT");
|
|
786
|
+
let i = l.decode(e.id_token ?? "");
|
|
787
|
+
if (i.sub || r.throw(/* @__PURE__ */ Error("ID Token is missing a subject claim")), n && i.nonce !== n && r.throw(/* @__PURE__ */ Error("nonce in id_token does not match nonce in client storage")), t) {
|
|
788
|
+
let e = l.decode(t);
|
|
789
|
+
i.sub !== e.sub && r.throw(/* @__PURE__ */ Error("sub in id_token does not match current sub")), i.auth_time && i.auth_time !== e.auth_time && r.throw(/* @__PURE__ */ Error("auth_time in id_token does not match original auth_time")), i.azp && i.azp !== e.azp && r.throw(/* @__PURE__ */ Error("azp in id_token does not match original azp")), !i.azp && e.azp && r.throw(/* @__PURE__ */ Error("azp not in id_token, but present in original id_token"));
|
|
790
|
+
}
|
|
791
|
+
e.profile = i;
|
|
792
|
+
}
|
|
793
|
+
}, P = class e {
|
|
794
|
+
constructor(e) {
|
|
795
|
+
this.id = e.id || p.generateUUIDv4(), this.data = e.data, e.created && e.created > 0 ? this.created = e.created : this.created = g.getEpochTime(), this.request_type = e.request_type, this.url_state = e.url_state;
|
|
796
|
+
}
|
|
797
|
+
toStorageString() {
|
|
798
|
+
return new c("State").create("toStorageString"), JSON.stringify({
|
|
799
|
+
id: this.id,
|
|
800
|
+
data: this.data,
|
|
801
|
+
created: this.created,
|
|
802
|
+
request_type: this.request_type,
|
|
803
|
+
url_state: this.url_state
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
static fromStorageString(t) {
|
|
807
|
+
return c.createStatic("State", "fromStorageString"), Promise.resolve(new e(JSON.parse(t)));
|
|
808
|
+
}
|
|
809
|
+
static async clearStaleState(t, n) {
|
|
810
|
+
let r = c.createStatic("State", "clearStaleState"), i = g.getEpochTime() - n, a = await t.getAllKeys();
|
|
811
|
+
r.debug("got keys", a);
|
|
812
|
+
for (let n = 0; n < a.length; n++) {
|
|
813
|
+
let o = a[n], s = await t.get(o), c = !1;
|
|
814
|
+
if (s) try {
|
|
815
|
+
let t = await e.fromStorageString(s);
|
|
816
|
+
r.debug("got item from key:", o, t.created), t.created <= i && (c = !0);
|
|
817
|
+
} catch (e) {
|
|
818
|
+
r.error("Error parsing state for key:", o, e), c = !0;
|
|
819
|
+
}
|
|
820
|
+
else r.debug("no item in storage for key:", o), c = !0;
|
|
821
|
+
c && (r.debug("removed item for key:", o), t.remove(o));
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
}, F = class e extends P {
|
|
825
|
+
constructor(e) {
|
|
826
|
+
super(e), this.code_verifier = e.code_verifier, this.code_challenge = e.code_challenge, this.authority = e.authority, this.client_id = e.client_id, this.redirect_uri = e.redirect_uri, this.scope = e.scope, this.client_secret = e.client_secret, this.extraTokenParams = e.extraTokenParams, this.response_mode = e.response_mode, this.skipUserInfo = e.skipUserInfo, this.nonce = e.nonce;
|
|
827
|
+
}
|
|
828
|
+
static async create(t) {
|
|
829
|
+
let n = t.code_verifier === !0 ? p.generateCodeVerifier() : t.code_verifier || void 0, r = n ? await p.generateCodeChallenge(n) : void 0;
|
|
830
|
+
return new e({
|
|
831
|
+
...t,
|
|
832
|
+
code_verifier: n,
|
|
833
|
+
code_challenge: r
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
toStorageString() {
|
|
837
|
+
return new c("SigninState").create("toStorageString"), JSON.stringify({
|
|
838
|
+
id: this.id,
|
|
839
|
+
data: this.data,
|
|
840
|
+
created: this.created,
|
|
841
|
+
request_type: this.request_type,
|
|
842
|
+
url_state: this.url_state,
|
|
843
|
+
code_verifier: this.code_verifier,
|
|
844
|
+
authority: this.authority,
|
|
845
|
+
client_id: this.client_id,
|
|
846
|
+
redirect_uri: this.redirect_uri,
|
|
847
|
+
scope: this.scope,
|
|
848
|
+
client_secret: this.client_secret,
|
|
849
|
+
extraTokenParams: this.extraTokenParams,
|
|
850
|
+
response_mode: this.response_mode,
|
|
851
|
+
skipUserInfo: this.skipUserInfo,
|
|
852
|
+
nonce: this.nonce
|
|
853
|
+
});
|
|
854
|
+
}
|
|
855
|
+
static fromStorageString(t) {
|
|
856
|
+
c.createStatic("SigninState", "fromStorageString");
|
|
857
|
+
let n = JSON.parse(t);
|
|
858
|
+
return e.create(n);
|
|
859
|
+
}
|
|
860
|
+
}, I = class e {
|
|
861
|
+
constructor(e) {
|
|
862
|
+
this.url = e.url, this.state = e.state;
|
|
863
|
+
}
|
|
864
|
+
static async create({ url: t, authority: n, client_id: r, redirect_uri: i, response_type: a, scope: o, state_data: s, response_mode: c, request_type: l, client_secret: u, nonce: d, url_state: f, resource: p, skipUserInfo: m, extraQueryParams: h, extraTokenParams: g, disablePKCE: _, dpopJkt: y, omitScopeWhenRequesting: b, ...x }) {
|
|
865
|
+
if (!t) throw this._logger.error("create: No url passed"), Error("url");
|
|
866
|
+
if (!r) throw this._logger.error("create: No client_id passed"), Error("client_id");
|
|
867
|
+
if (!i) throw this._logger.error("create: No redirect_uri passed"), Error("redirect_uri");
|
|
868
|
+
if (!a) throw this._logger.error("create: No response_type passed"), Error("response_type");
|
|
869
|
+
if (!o) throw this._logger.error("create: No scope passed"), Error("scope");
|
|
870
|
+
if (!n) throw this._logger.error("create: No authority passed"), Error("authority");
|
|
871
|
+
let S = await F.create({
|
|
872
|
+
data: s,
|
|
873
|
+
request_type: l,
|
|
874
|
+
url_state: f,
|
|
875
|
+
code_verifier: !_,
|
|
876
|
+
client_id: r,
|
|
877
|
+
authority: n,
|
|
878
|
+
redirect_uri: i,
|
|
879
|
+
response_mode: c,
|
|
880
|
+
client_secret: u,
|
|
881
|
+
scope: o,
|
|
882
|
+
extraTokenParams: g,
|
|
883
|
+
skipUserInfo: m,
|
|
884
|
+
nonce: d
|
|
885
|
+
}), C = new URL(t);
|
|
886
|
+
C.searchParams.append("client_id", r), C.searchParams.append("redirect_uri", i), C.searchParams.append("response_type", a), b || C.searchParams.append("scope", o), d && C.searchParams.append("nonce", d), y && C.searchParams.append("dpop_jkt", y);
|
|
887
|
+
let w = S.id;
|
|
888
|
+
f && (w = `${w}${v}${f}`), C.searchParams.append("state", w), S.code_challenge && (C.searchParams.append("code_challenge", S.code_challenge), C.searchParams.append("code_challenge_method", "S256")), p && (Array.isArray(p) ? p : [p]).forEach((e) => C.searchParams.append("resource", e));
|
|
889
|
+
for (let [e, t] of Object.entries({
|
|
890
|
+
response_mode: c,
|
|
891
|
+
...x,
|
|
892
|
+
...h
|
|
893
|
+
})) t != null && C.searchParams.append(e, t.toString());
|
|
894
|
+
return new e({
|
|
895
|
+
url: C.href,
|
|
896
|
+
state: S
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
I._logger = new c("SigninRequest");
|
|
901
|
+
var L = I, R = "openid", z = class {
|
|
902
|
+
constructor(e) {
|
|
903
|
+
if (this.access_token = "", this.token_type = "", this.profile = {}, this.state = e.get("state"), this.session_state = e.get("session_state"), this.state) {
|
|
904
|
+
let e = decodeURIComponent(this.state).split(v);
|
|
905
|
+
this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(v));
|
|
906
|
+
}
|
|
907
|
+
this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri"), this.code = e.get("code");
|
|
908
|
+
}
|
|
909
|
+
get expires_in() {
|
|
910
|
+
if (this.expires_at !== void 0) return this.expires_at - g.getEpochTime();
|
|
911
|
+
}
|
|
912
|
+
set expires_in(e) {
|
|
913
|
+
typeof e == "string" && (e = Number(e)), e !== void 0 && e >= 0 && (this.expires_at = Math.floor(e) + g.getEpochTime());
|
|
914
|
+
}
|
|
915
|
+
get isOpenId() {
|
|
916
|
+
return this.scope?.split(" ").includes(R) || !!this.id_token;
|
|
917
|
+
}
|
|
918
|
+
}, B = class {
|
|
919
|
+
constructor({ url: e, state_data: t, id_token_hint: n, post_logout_redirect_uri: r, extraQueryParams: i, request_type: a, client_id: o, url_state: s }) {
|
|
920
|
+
if (this._logger = new c("SignoutRequest"), !e) throw this._logger.error("ctor: No url passed"), Error("url");
|
|
921
|
+
let l = new URL(e);
|
|
922
|
+
if (n && l.searchParams.append("id_token_hint", n), o && l.searchParams.append("client_id", o), r && (l.searchParams.append("post_logout_redirect_uri", r), t || s)) {
|
|
923
|
+
this.state = new P({
|
|
924
|
+
data: t,
|
|
925
|
+
request_type: a,
|
|
926
|
+
url_state: s
|
|
927
|
+
});
|
|
928
|
+
let e = this.state.id;
|
|
929
|
+
s && (e = `${e}${v}${s}`), l.searchParams.append("state", e);
|
|
930
|
+
}
|
|
931
|
+
for (let [e, t] of Object.entries({ ...i })) t != null && l.searchParams.append(e, t.toString());
|
|
932
|
+
this.url = l.href;
|
|
933
|
+
}
|
|
934
|
+
}, V = class {
|
|
935
|
+
constructor(e) {
|
|
936
|
+
if (this.state = e.get("state"), this.state) {
|
|
937
|
+
let e = decodeURIComponent(this.state).split(v);
|
|
938
|
+
this.state = e[0], e.length > 1 && (this.url_state = e.slice(1).join(v));
|
|
939
|
+
}
|
|
940
|
+
this.error = e.get("error"), this.error_description = e.get("error_description"), this.error_uri = e.get("error_uri");
|
|
941
|
+
}
|
|
942
|
+
}, H = [
|
|
943
|
+
"nbf",
|
|
944
|
+
"jti",
|
|
945
|
+
"auth_time",
|
|
946
|
+
"nonce",
|
|
947
|
+
"acr",
|
|
948
|
+
"amr",
|
|
949
|
+
"azp",
|
|
950
|
+
"at_hash"
|
|
951
|
+
], ne = [
|
|
952
|
+
"sub",
|
|
953
|
+
"iss",
|
|
954
|
+
"aud",
|
|
955
|
+
"exp",
|
|
956
|
+
"iat"
|
|
957
|
+
], re = class {
|
|
958
|
+
constructor(e) {
|
|
959
|
+
this._settings = e, this._logger = new c("ClaimsService");
|
|
960
|
+
}
|
|
961
|
+
filterProtocolClaims(e) {
|
|
962
|
+
let t = { ...e };
|
|
963
|
+
if (this._settings.filterProtocolClaims) {
|
|
964
|
+
let e;
|
|
965
|
+
e = Array.isArray(this._settings.filterProtocolClaims) ? this._settings.filterProtocolClaims : H;
|
|
966
|
+
for (let n of e) ne.includes(n) || delete t[n];
|
|
967
|
+
}
|
|
968
|
+
return t;
|
|
969
|
+
}
|
|
970
|
+
mergeClaims(e, t) {
|
|
971
|
+
let n = { ...e };
|
|
972
|
+
for (let [e, r] of Object.entries(t)) if (n[e] !== r) if (Array.isArray(n[e]) || Array.isArray(r)) if (this._settings.mergeClaimsStrategy.array == "replace") n[e] = r;
|
|
973
|
+
else {
|
|
974
|
+
let t = Array.isArray(n[e]) ? n[e] : [n[e]];
|
|
975
|
+
for (let e of Array.isArray(r) ? r : [r]) t.includes(e) || t.push(e);
|
|
976
|
+
n[e] = t;
|
|
977
|
+
}
|
|
978
|
+
else typeof n[e] == "object" && typeof r == "object" ? n[e] = this.mergeClaims(n[e], r) : n[e] = r;
|
|
979
|
+
return n;
|
|
980
|
+
}
|
|
981
|
+
}, U = class {
|
|
982
|
+
constructor(e, t) {
|
|
983
|
+
this.keys = e, this.nonce = t;
|
|
984
|
+
}
|
|
985
|
+
}, ie = class {
|
|
986
|
+
constructor(e, t) {
|
|
987
|
+
this._logger = new c("OidcClient"), this.settings = e instanceof A ? e : new A(e), this.metadataService = t ?? new E(this.settings), this._claimsService = new re(this.settings), this._validator = new N(this.settings, this.metadataService, this._claimsService), this._tokenClient = new M(this.settings, this.metadataService);
|
|
988
|
+
}
|
|
989
|
+
async createSigninRequest({ state: e, request: t, request_uri: n, request_type: r, id_token_hint: i, login_hint: a, skipUserInfo: o, nonce: s, url_state: c, response_type: l = this.settings.response_type, scope: u = this.settings.scope, redirect_uri: d = this.settings.redirect_uri, prompt: f = this.settings.prompt, display: p = this.settings.display, max_age: m = this.settings.max_age, ui_locales: h = this.settings.ui_locales, acr_values: g = this.settings.acr_values, resource: _ = this.settings.resource, response_mode: v = this.settings.response_mode, extraQueryParams: y = this.settings.extraQueryParams, extraTokenParams: b = this.settings.extraTokenParams, dpopJkt: x, omitScopeWhenRequesting: S = this.settings.omitScopeWhenRequesting }) {
|
|
990
|
+
let C = this._logger.create("createSigninRequest");
|
|
991
|
+
if (l !== "code") throw Error("Only the Authorization Code flow (with PKCE) is supported");
|
|
992
|
+
let w = await this.metadataService.getAuthorizationEndpoint();
|
|
993
|
+
C.debug("Received authorization endpoint", w);
|
|
994
|
+
let T = await L.create({
|
|
995
|
+
url: w,
|
|
996
|
+
authority: this.settings.authority,
|
|
997
|
+
client_id: this.settings.client_id,
|
|
998
|
+
redirect_uri: d,
|
|
999
|
+
response_type: l,
|
|
1000
|
+
scope: u,
|
|
1001
|
+
state_data: e,
|
|
1002
|
+
url_state: c,
|
|
1003
|
+
prompt: f,
|
|
1004
|
+
display: p,
|
|
1005
|
+
max_age: m,
|
|
1006
|
+
ui_locales: h,
|
|
1007
|
+
id_token_hint: i,
|
|
1008
|
+
login_hint: a,
|
|
1009
|
+
acr_values: g,
|
|
1010
|
+
dpopJkt: x,
|
|
1011
|
+
resource: _,
|
|
1012
|
+
request: t,
|
|
1013
|
+
request_uri: n,
|
|
1014
|
+
extraQueryParams: y,
|
|
1015
|
+
extraTokenParams: b,
|
|
1016
|
+
request_type: r,
|
|
1017
|
+
response_mode: v,
|
|
1018
|
+
client_secret: this.settings.client_secret,
|
|
1019
|
+
skipUserInfo: o,
|
|
1020
|
+
nonce: s,
|
|
1021
|
+
disablePKCE: this.settings.disablePKCE,
|
|
1022
|
+
omitScopeWhenRequesting: S
|
|
1023
|
+
});
|
|
1024
|
+
await this.clearStaleState();
|
|
1025
|
+
let E = T.state;
|
|
1026
|
+
return await this.settings.stateStore.set(E.id, E.toStorageString()), T;
|
|
1027
|
+
}
|
|
1028
|
+
async readSigninResponseState(e, t = !1) {
|
|
1029
|
+
let n = this._logger.create("readSigninResponseState"), r = new z(_.readParams(e, this.settings.response_mode));
|
|
1030
|
+
if (!r.state) throw n.throw(/* @__PURE__ */ Error("No state in response")), null;
|
|
1031
|
+
let i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
|
|
1032
|
+
if (!i) throw n.throw(/* @__PURE__ */ Error("No matching state found in storage")), null;
|
|
1033
|
+
return {
|
|
1034
|
+
state: await F.fromStorageString(i),
|
|
1035
|
+
response: r
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
async processSigninResponse(e, t, n = !0) {
|
|
1039
|
+
let r = this._logger.create("processSigninResponse"), { state: i, response: a } = await this.readSigninResponseState(e, n);
|
|
1040
|
+
if (r.debug("received state from storage; validating response"), this.settings.dpop && this.settings.dpop.store) {
|
|
1041
|
+
let e = await this.getDpopProof(this.settings.dpop.store);
|
|
1042
|
+
t = {
|
|
1043
|
+
...t,
|
|
1044
|
+
DPoP: e
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
try {
|
|
1048
|
+
await this._validator.validateSigninResponse(a, i, t);
|
|
1049
|
+
} catch (e) {
|
|
1050
|
+
if (e instanceof w && this.settings.dpop) {
|
|
1051
|
+
let n = await this.getDpopProof(this.settings.dpop.store, e.nonce);
|
|
1052
|
+
t.DPoP = n, await this._validator.validateSigninResponse(a, i, t);
|
|
1053
|
+
} else throw e;
|
|
1054
|
+
}
|
|
1055
|
+
return a;
|
|
1056
|
+
}
|
|
1057
|
+
async getDpopProof(e, t) {
|
|
1058
|
+
let n, r;
|
|
1059
|
+
return (await e.getAllKeys()).includes(this.settings.client_id) ? (r = await e.get(this.settings.client_id), r.nonce !== t && t && (r.nonce = t, await e.set(this.settings.client_id, r))) : (n = await p.generateDPoPKeys(), r = new U(n, t), await e.set(this.settings.client_id, r)), await p.generateDPoPProof({
|
|
1060
|
+
url: await this.metadataService.getTokenEndpoint(!1),
|
|
1061
|
+
httpMethod: "POST",
|
|
1062
|
+
keyPair: r.keys,
|
|
1063
|
+
nonce: r.nonce
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1066
|
+
async processResourceOwnerPasswordCredentials({ username: e, password: t, skipUserInfo: n = !1, extraTokenParams: r = {} }) {
|
|
1067
|
+
let i = await this._tokenClient.exchangeCredentials({
|
|
1068
|
+
username: e,
|
|
1069
|
+
password: t,
|
|
1070
|
+
...r
|
|
1071
|
+
}), a = new z(new URLSearchParams());
|
|
1072
|
+
return Object.assign(a, i), await this._validator.validateCredentialsResponse(a, n), a;
|
|
1073
|
+
}
|
|
1074
|
+
async useRefreshToken({ state: e, redirect_uri: t, resource: n, timeoutInSeconds: r, extraHeaders: i, extraTokenParams: a }) {
|
|
1075
|
+
let o = this._logger.create("useRefreshToken"), s;
|
|
1076
|
+
if (this.settings.refreshTokenAllowedScope === void 0) s = e.scope;
|
|
1077
|
+
else {
|
|
1078
|
+
let t = this.settings.refreshTokenAllowedScope.split(" ");
|
|
1079
|
+
s = (e.scope?.split(" ") || []).filter((e) => t.includes(e)).join(" ");
|
|
1080
|
+
}
|
|
1081
|
+
if (this.settings.dpop && this.settings.dpop.store) {
|
|
1082
|
+
let e = await this.getDpopProof(this.settings.dpop.store);
|
|
1083
|
+
i = {
|
|
1084
|
+
...i,
|
|
1085
|
+
DPoP: e
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
let c;
|
|
1089
|
+
try {
|
|
1090
|
+
c = await this._tokenClient.exchangeRefreshToken({
|
|
1091
|
+
refresh_token: e.refresh_token,
|
|
1092
|
+
scope: s,
|
|
1093
|
+
redirect_uri: t,
|
|
1094
|
+
resource: n,
|
|
1095
|
+
timeoutInSeconds: r,
|
|
1096
|
+
extraHeaders: i,
|
|
1097
|
+
...a
|
|
1098
|
+
});
|
|
1099
|
+
} catch (o) {
|
|
1100
|
+
if (o instanceof w && this.settings.dpop) i.DPoP = await this.getDpopProof(this.settings.dpop.store, o.nonce), c = await this._tokenClient.exchangeRefreshToken({
|
|
1101
|
+
refresh_token: e.refresh_token,
|
|
1102
|
+
scope: s,
|
|
1103
|
+
redirect_uri: t,
|
|
1104
|
+
resource: n,
|
|
1105
|
+
timeoutInSeconds: r,
|
|
1106
|
+
extraHeaders: i,
|
|
1107
|
+
...a
|
|
1108
|
+
});
|
|
1109
|
+
else throw o;
|
|
1110
|
+
}
|
|
1111
|
+
let l = new z(new URLSearchParams());
|
|
1112
|
+
return Object.assign(l, c), o.debug("validating response", l), await this._validator.validateRefreshResponse(l, {
|
|
1113
|
+
...e,
|
|
1114
|
+
scope: s
|
|
1115
|
+
}), l;
|
|
1116
|
+
}
|
|
1117
|
+
async createSignoutRequest({ state: e, id_token_hint: t, client_id: n, request_type: r, url_state: i, post_logout_redirect_uri: a = this.settings.post_logout_redirect_uri, extraQueryParams: o = this.settings.extraQueryParams } = {}) {
|
|
1118
|
+
let s = this._logger.create("createSignoutRequest"), c = await this.metadataService.getEndSessionEndpoint();
|
|
1119
|
+
if (!c) throw s.throw(/* @__PURE__ */ Error("No end session endpoint")), null;
|
|
1120
|
+
s.debug("Received end session endpoint", c), !n && a && !t && (n = this.settings.client_id);
|
|
1121
|
+
let l = new B({
|
|
1122
|
+
url: c,
|
|
1123
|
+
id_token_hint: t,
|
|
1124
|
+
client_id: n,
|
|
1125
|
+
post_logout_redirect_uri: a,
|
|
1126
|
+
state_data: e,
|
|
1127
|
+
extraQueryParams: o,
|
|
1128
|
+
request_type: r,
|
|
1129
|
+
url_state: i
|
|
1130
|
+
});
|
|
1131
|
+
await this.clearStaleState();
|
|
1132
|
+
let u = l.state;
|
|
1133
|
+
return u && (s.debug("Signout request has state to persist"), await this.settings.stateStore.set(u.id, u.toStorageString())), l;
|
|
1134
|
+
}
|
|
1135
|
+
async readSignoutResponseState(e, t = !1) {
|
|
1136
|
+
let n = this._logger.create("readSignoutResponseState"), r = new V(_.readParams(e, this.settings.response_mode));
|
|
1137
|
+
if (!r.state) {
|
|
1138
|
+
if (n.debug("No state in response"), r.error) throw n.warn("Response was error:", r.error), new y(r);
|
|
1139
|
+
return {
|
|
1140
|
+
state: void 0,
|
|
1141
|
+
response: r
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
let i = await this.settings.stateStore[t ? "remove" : "get"](r.state);
|
|
1145
|
+
if (!i) throw n.throw(/* @__PURE__ */ Error("No matching state found in storage")), null;
|
|
1146
|
+
return {
|
|
1147
|
+
state: await P.fromStorageString(i),
|
|
1148
|
+
response: r
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
async processSignoutResponse(e) {
|
|
1152
|
+
let t = this._logger.create("processSignoutResponse"), { state: n, response: r } = await this.readSignoutResponseState(e, !0);
|
|
1153
|
+
return n ? (t.debug("Received state from storage; validating response"), this._validator.validateSignoutResponse(r, n)) : t.debug("No state from storage; skipping response validation"), r;
|
|
1154
|
+
}
|
|
1155
|
+
clearStaleState() {
|
|
1156
|
+
return this._logger.create("clearStaleState"), P.clearStaleState(this.settings.stateStore, this.settings.staleStateAgeInSeconds);
|
|
1157
|
+
}
|
|
1158
|
+
async revokeToken(e, t) {
|
|
1159
|
+
return this._logger.create("revokeToken"), await this._tokenClient.revoke({
|
|
1160
|
+
token: e,
|
|
1161
|
+
token_type_hint: t
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
}, W = class {
|
|
1165
|
+
constructor(e) {
|
|
1166
|
+
this._userManager = e, this._logger = new c("SessionMonitor"), this._start = async (e) => {
|
|
1167
|
+
let t = e.session_state;
|
|
1168
|
+
if (!t) return;
|
|
1169
|
+
let n = this._logger.create("_start");
|
|
1170
|
+
if (e.profile ? (this._sub = e.profile.sub, n.debug("session_state", t, ", sub", this._sub)) : (this._sub = void 0, n.debug("session_state", t, ", anonymous user")), this._checkSessionIFrame) {
|
|
1171
|
+
this._checkSessionIFrame.start(t);
|
|
1172
|
+
return;
|
|
1173
|
+
}
|
|
1174
|
+
try {
|
|
1175
|
+
let e = await this._userManager.metadataService.getCheckSessionIframe();
|
|
1176
|
+
if (e) {
|
|
1177
|
+
n.debug("initializing check session iframe");
|
|
1178
|
+
let r = this._userManager.settings.client_id, i = this._userManager.settings.checkSessionIntervalInSeconds, a = this._userManager.settings.stopCheckSessionOnError, o = new S(this._callback, r, e, i, a);
|
|
1179
|
+
await o.load(), this._checkSessionIFrame = o, o.start(t);
|
|
1180
|
+
} else n.warn("no check session iframe found in the metadata");
|
|
1181
|
+
} catch (e) {
|
|
1182
|
+
n.error("Error from getCheckSessionIframe:", e instanceof Error ? e.message : e);
|
|
1183
|
+
}
|
|
1184
|
+
}, this._stop = () => {
|
|
1185
|
+
let e = this._logger.create("_stop");
|
|
1186
|
+
if (this._sub = void 0, this._checkSessionIFrame && this._checkSessionIFrame.stop(), this._userManager.settings.monitorAnonymousSession) {
|
|
1187
|
+
let t = setInterval(async () => {
|
|
1188
|
+
clearInterval(t);
|
|
1189
|
+
try {
|
|
1190
|
+
let e = await this._userManager.querySessionStatus();
|
|
1191
|
+
if (e) {
|
|
1192
|
+
let t = {
|
|
1193
|
+
session_state: e.session_state,
|
|
1194
|
+
profile: e.sub ? { sub: e.sub } : null
|
|
1195
|
+
};
|
|
1196
|
+
this._start(t);
|
|
1197
|
+
}
|
|
1198
|
+
} catch (t) {
|
|
1199
|
+
e.error("error from querySessionStatus", t instanceof Error ? t.message : t);
|
|
1200
|
+
}
|
|
1201
|
+
}, 1e3);
|
|
1202
|
+
}
|
|
1203
|
+
}, this._callback = async () => {
|
|
1204
|
+
let e = this._logger.create("_callback");
|
|
1205
|
+
try {
|
|
1206
|
+
let t = await this._userManager.querySessionStatus(), n = !0;
|
|
1207
|
+
t && this._checkSessionIFrame ? t.sub === this._sub ? (n = !1, this._checkSessionIFrame.start(t.session_state), e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state", t.session_state), await this._userManager.events._raiseUserSessionChanged()) : e.debug("different subject signed into OP", t.sub) : e.debug("subject no longer signed into OP"), n ? this._sub ? await this._userManager.events._raiseUserSignedOut() : await this._userManager.events._raiseUserSignedIn() : e.debug("no change in session detected, no event to raise");
|
|
1208
|
+
} catch (t) {
|
|
1209
|
+
this._sub && (e.debug("Error calling queryCurrentSigninSession; raising signed out event", t), await this._userManager.events._raiseUserSignedOut());
|
|
1210
|
+
}
|
|
1211
|
+
}, e || this._logger.throw(/* @__PURE__ */ Error("No user manager passed")), this._userManager.events.addUserLoaded(this._start), this._userManager.events.addUserUnloaded(this._stop), this._init().catch((e) => {
|
|
1212
|
+
this._logger.error(e);
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1215
|
+
async _init() {
|
|
1216
|
+
this._logger.create("_init");
|
|
1217
|
+
let e = await this._userManager.getUser();
|
|
1218
|
+
if (e) this._start(e);
|
|
1219
|
+
else if (this._userManager.settings.monitorAnonymousSession) {
|
|
1220
|
+
let e = await this._userManager.querySessionStatus();
|
|
1221
|
+
if (e) {
|
|
1222
|
+
let t = {
|
|
1223
|
+
session_state: e.session_state,
|
|
1224
|
+
profile: e.sub ? { sub: e.sub } : null
|
|
1225
|
+
};
|
|
1226
|
+
this._start(t);
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}, G = class e {
|
|
1231
|
+
constructor(e) {
|
|
1232
|
+
this.id_token = e.id_token, this.session_state = e.session_state ?? null, this.access_token = e.access_token, this.refresh_token = e.refresh_token, this.token_type = e.token_type, this.scope = e.scope, this.profile = e.profile, this.expires_at = e.expires_at, this.state = e.userState, this.url_state = e.url_state;
|
|
1233
|
+
}
|
|
1234
|
+
get expires_in() {
|
|
1235
|
+
if (this.expires_at !== void 0) return this.expires_at - g.getEpochTime();
|
|
1236
|
+
}
|
|
1237
|
+
set expires_in(e) {
|
|
1238
|
+
e !== void 0 && (this.expires_at = Math.floor(e) + g.getEpochTime());
|
|
1239
|
+
}
|
|
1240
|
+
get expired() {
|
|
1241
|
+
let e = this.expires_in;
|
|
1242
|
+
if (e !== void 0) return e <= 0;
|
|
1243
|
+
}
|
|
1244
|
+
get scopes() {
|
|
1245
|
+
return this.scope?.split(" ") ?? [];
|
|
1246
|
+
}
|
|
1247
|
+
toStorageString() {
|
|
1248
|
+
return new c("User").create("toStorageString"), JSON.stringify({
|
|
1249
|
+
id_token: this.id_token,
|
|
1250
|
+
session_state: this.session_state,
|
|
1251
|
+
access_token: this.access_token,
|
|
1252
|
+
refresh_token: this.refresh_token,
|
|
1253
|
+
token_type: this.token_type,
|
|
1254
|
+
scope: this.scope,
|
|
1255
|
+
profile: this.profile,
|
|
1256
|
+
expires_at: this.expires_at
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
static fromStorageString(t) {
|
|
1260
|
+
return c.createStatic("User", "fromStorageString"), new e(JSON.parse(t));
|
|
1261
|
+
}
|
|
1262
|
+
}, K = "oidc-client", q = class {
|
|
1263
|
+
constructor() {
|
|
1264
|
+
this._abort = new m("Window navigation aborted"), this._disposeHandlers = /* @__PURE__ */ new Set(), this._window = null;
|
|
1265
|
+
}
|
|
1266
|
+
async navigate(e) {
|
|
1267
|
+
let t = this._logger.create("navigate");
|
|
1268
|
+
if (!this._window) throw Error("Attempted to navigate on a disposed window");
|
|
1269
|
+
t.debug("setting URL in window"), this._window.location.replace(e.url);
|
|
1270
|
+
let { url: n, keepOpen: r } = await new Promise((n, r) => {
|
|
1271
|
+
let i = (i) => {
|
|
1272
|
+
let a = i.data, o = e.scriptOrigin ?? window.location.origin;
|
|
1273
|
+
if (!(i.origin !== o || a?.source !== K)) {
|
|
1274
|
+
try {
|
|
1275
|
+
let n = _.readParams(a.url, e.response_mode).get("state");
|
|
1276
|
+
if (n || t.warn("no state found in response url"), i.source !== this._window && n !== e.state) return;
|
|
1277
|
+
} catch {
|
|
1278
|
+
this._dispose(), r(/* @__PURE__ */ Error("Invalid response from window"));
|
|
1279
|
+
}
|
|
1280
|
+
n(a);
|
|
1281
|
+
}
|
|
1282
|
+
};
|
|
1283
|
+
window.addEventListener("message", i, !1), this._disposeHandlers.add(() => window.removeEventListener("message", i, !1));
|
|
1284
|
+
let a = new BroadcastChannel(`oidc-client-popup-${e.state}`);
|
|
1285
|
+
a.addEventListener("message", i, !1), this._disposeHandlers.add(() => a.close()), this._disposeHandlers.add(this._abort.addHandler((e) => {
|
|
1286
|
+
this._dispose(), r(e);
|
|
1287
|
+
}));
|
|
1288
|
+
});
|
|
1289
|
+
return t.debug("got response from window"), this._dispose(), r || this.close(), { url: n };
|
|
1290
|
+
}
|
|
1291
|
+
_dispose() {
|
|
1292
|
+
this._logger.create("_dispose");
|
|
1293
|
+
for (let e of this._disposeHandlers) e();
|
|
1294
|
+
this._disposeHandlers.clear();
|
|
1295
|
+
}
|
|
1296
|
+
static _notifyParent(e, t, n = !1, r = window.location.origin) {
|
|
1297
|
+
let i = {
|
|
1298
|
+
source: K,
|
|
1299
|
+
url: t,
|
|
1300
|
+
keepOpen: n
|
|
1301
|
+
}, a = new c("_notifyParent");
|
|
1302
|
+
if (e) a.debug("With parent. Using parent.postMessage."), e.postMessage(i, r);
|
|
1303
|
+
else {
|
|
1304
|
+
a.debug("No parent. Using BroadcastChannel.");
|
|
1305
|
+
let e = new URL(t).searchParams.get("state");
|
|
1306
|
+
if (!e) throw Error("No parent and no state in URL. Can't complete notification.");
|
|
1307
|
+
let n = new BroadcastChannel(`oidc-client-popup-${e}`);
|
|
1308
|
+
n.postMessage(i), n.close();
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
}, J = {
|
|
1312
|
+
location: !1,
|
|
1313
|
+
toolbar: !1,
|
|
1314
|
+
height: 640,
|
|
1315
|
+
closePopupWindowAfterInSeconds: -1
|
|
1316
|
+
}, Y = "_blank", ae = 60, oe = 2, X = 10, se = class extends A {
|
|
1317
|
+
constructor(e) {
|
|
1318
|
+
let { popup_redirect_uri: t = e.redirect_uri, popup_post_logout_redirect_uri: n = e.post_logout_redirect_uri, popupWindowFeatures: r = J, popupWindowTarget: i = Y, redirectMethod: a = "assign", redirectTarget: o = "self", iframeNotifyParentOrigin: s = e.iframeNotifyParentOrigin, iframeScriptOrigin: c = e.iframeScriptOrigin, requestTimeoutInSeconds: l, silent_redirect_uri: u = e.redirect_uri, silentRequestTimeoutInSeconds: d, automaticSilentRenew: f = !0, validateSubOnSilentRenew: p = !0, includeIdTokenInSilentRenew: m = !1, monitorSession: h = !1, monitorAnonymousSession: g = !1, checkSessionIntervalInSeconds: _ = oe, query_status_response_type: v = "code", stopCheckSessionOnError: y = !0, revokeTokenTypes: b = ["access_token", "refresh_token"], revokeTokensOnSignout: x = !1, includeIdTokenInSilentSignout: S = !1, accessTokenExpiringNotificationTimeInSeconds: w = ae, maxSilentRenewTimeoutRetries: T, userStore: E } = e;
|
|
1319
|
+
if (super(e), this.popup_redirect_uri = t, this.popup_post_logout_redirect_uri = n, this.popupWindowFeatures = r, this.popupWindowTarget = i, this.redirectMethod = a, this.redirectTarget = o, this.iframeNotifyParentOrigin = s, this.iframeScriptOrigin = c, this.silent_redirect_uri = u, this.silentRequestTimeoutInSeconds = d || l || X, this.automaticSilentRenew = f, this.validateSubOnSilentRenew = p, this.includeIdTokenInSilentRenew = m, this.monitorSession = h, this.monitorAnonymousSession = g, this.checkSessionIntervalInSeconds = _, this.stopCheckSessionOnError = y, this.query_status_response_type = v, this.revokeTokenTypes = b, this.revokeTokensOnSignout = x, this.includeIdTokenInSilentSignout = S, this.accessTokenExpiringNotificationTimeInSeconds = w, this.maxSilentRenewTimeoutRetries = T, E) this.userStore = E;
|
|
1320
|
+
else {
|
|
1321
|
+
let e = typeof window < "u" ? window.sessionStorage : new C();
|
|
1322
|
+
this.userStore = new D({ store: e });
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
}, Z = class e extends q {
|
|
1326
|
+
constructor({ silentRequestTimeoutInSeconds: t = X }) {
|
|
1327
|
+
super(), this._logger = new c("IFrameWindow"), this._timeoutInSeconds = t, this._frame = e.createHiddenIframe(), this._window = this._frame.contentWindow;
|
|
1328
|
+
}
|
|
1329
|
+
static createHiddenIframe() {
|
|
1330
|
+
let e = window.document.createElement("iframe");
|
|
1331
|
+
return e.style.visibility = "hidden", e.style.position = "fixed", e.style.left = "-1000px", e.style.top = "0", e.width = "0", e.height = "0", window.document.body.appendChild(e), e;
|
|
1332
|
+
}
|
|
1333
|
+
async navigate(e) {
|
|
1334
|
+
this._logger.debug("navigate: Using timeout of:", this._timeoutInSeconds);
|
|
1335
|
+
let t = setTimeout(() => void this._abort.raise(new b("IFrame timed out without a response")), this._timeoutInSeconds * 1e3);
|
|
1336
|
+
return this._disposeHandlers.add(() => clearTimeout(t)), await super.navigate(e);
|
|
1337
|
+
}
|
|
1338
|
+
close() {
|
|
1339
|
+
var e;
|
|
1340
|
+
this._frame &&= (this._frame.parentNode && (this._frame.addEventListener("load", (e) => {
|
|
1341
|
+
var t;
|
|
1342
|
+
let n = e.target;
|
|
1343
|
+
(t = n.parentNode) == null || t.removeChild(n), this._abort.raise(/* @__PURE__ */ Error("IFrame removed from DOM"));
|
|
1344
|
+
}, !0), (e = this._frame.contentWindow) == null || e.location.replace("about:blank")), null), this._window = null;
|
|
1345
|
+
}
|
|
1346
|
+
static notifyParent(e, t) {
|
|
1347
|
+
return super._notifyParent(window.parent, e, !1, t);
|
|
1348
|
+
}
|
|
1349
|
+
}, ce = class {
|
|
1350
|
+
constructor(e) {
|
|
1351
|
+
this._settings = e, this._logger = new c("IFrameNavigator");
|
|
1352
|
+
}
|
|
1353
|
+
async prepare({ silentRequestTimeoutInSeconds: e = this._settings.silentRequestTimeoutInSeconds }) {
|
|
1354
|
+
return new Z({ silentRequestTimeoutInSeconds: e });
|
|
1355
|
+
}
|
|
1356
|
+
async callback(e) {
|
|
1357
|
+
this._logger.create("callback"), Z.notifyParent(e, this._settings.iframeNotifyParentOrigin);
|
|
1358
|
+
}
|
|
1359
|
+
}, le = 500, ue = 1e3, Q = class extends q {
|
|
1360
|
+
constructor({ popupWindowTarget: e = Y, popupWindowFeatures: t = {}, popupSignal: n, popupAbortOnClose: r }) {
|
|
1361
|
+
super(), this._logger = new c("PopupWindow");
|
|
1362
|
+
let i = h.center({
|
|
1363
|
+
...J,
|
|
1364
|
+
...t
|
|
1365
|
+
});
|
|
1366
|
+
this._window = window.open(void 0, e, h.serialize(i)), this.abortOnClose = !!r, n && n.addEventListener("abort", () => {
|
|
1367
|
+
this._abort.raise(Error(n.reason ?? "Popup aborted"));
|
|
1368
|
+
}), t.closePopupWindowAfterInSeconds && t.closePopupWindowAfterInSeconds > 0 && setTimeout(() => {
|
|
1369
|
+
if (!this._window || typeof this._window.closed != "boolean" || this._window.closed) {
|
|
1370
|
+
this._abort.raise(/* @__PURE__ */ Error("Popup blocked by user"));
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
this.close();
|
|
1374
|
+
}, t.closePopupWindowAfterInSeconds * ue);
|
|
1375
|
+
}
|
|
1376
|
+
async navigate(e) {
|
|
1377
|
+
var t;
|
|
1378
|
+
(t = this._window) == null || t.focus();
|
|
1379
|
+
let n = setInterval(() => {
|
|
1380
|
+
(!this._window || this._window.closed) && (this._logger.debug("Popup closed by user or isolated by redirect"), r(), this._disposeHandlers.delete(r), this.abortOnClose && this._abort.raise(/* @__PURE__ */ Error("Popup closed by user")));
|
|
1381
|
+
}, le), r = () => clearInterval(n);
|
|
1382
|
+
return this._disposeHandlers.add(r), await super.navigate(e);
|
|
1383
|
+
}
|
|
1384
|
+
close() {
|
|
1385
|
+
this._window && (this._window.closed || (this._window.close(), this._abort.raise(/* @__PURE__ */ Error("Popup closed")))), this._window = null;
|
|
1386
|
+
}
|
|
1387
|
+
static notifyOpener(e, t) {
|
|
1388
|
+
super._notifyParent(window.opener, e, t), !t && !window.opener && window.close();
|
|
1389
|
+
}
|
|
1390
|
+
}, $ = class {
|
|
1391
|
+
constructor(e) {
|
|
1392
|
+
this._settings = e, this._logger = new c("PopupNavigator");
|
|
1393
|
+
}
|
|
1394
|
+
async prepare({ popupWindowFeatures: e = this._settings.popupWindowFeatures, popupWindowTarget: t = this._settings.popupWindowTarget, popupSignal: n, popupAbortOnClose: r }) {
|
|
1395
|
+
return new Q({
|
|
1396
|
+
popupWindowFeatures: e,
|
|
1397
|
+
popupWindowTarget: t,
|
|
1398
|
+
popupSignal: n,
|
|
1399
|
+
popupAbortOnClose: r
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
async callback(e, { keepOpen: t = !1 }) {
|
|
1403
|
+
this._logger.create("callback"), Q.notifyOpener(e, t);
|
|
1404
|
+
}
|
|
1405
|
+
}, de = class {
|
|
1406
|
+
constructor(e) {
|
|
1407
|
+
this._settings = e, this._logger = new c("RedirectNavigator");
|
|
1408
|
+
}
|
|
1409
|
+
async prepare({ redirectMethod: e = this._settings.redirectMethod, redirectTarget: t = this._settings.redirectTarget }) {
|
|
1410
|
+
this._logger.create("prepare");
|
|
1411
|
+
let n = window.self;
|
|
1412
|
+
t === "top" && (n = window.top ?? window.self);
|
|
1413
|
+
let r = n.location[e].bind(n.location), i;
|
|
1414
|
+
return {
|
|
1415
|
+
navigate: async (e) => (this._logger.create("navigate"), await new Promise((t, n) => {
|
|
1416
|
+
i = n, window.addEventListener("pageshow", () => t(window.location.href)), r(e.url);
|
|
1417
|
+
})),
|
|
1418
|
+
close: () => {
|
|
1419
|
+
this._logger.create("close"), i?.(/* @__PURE__ */ Error("Redirect aborted")), n.stop();
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
}
|
|
1423
|
+
async callback() {}
|
|
1424
|
+
}, fe = class extends x {
|
|
1425
|
+
constructor(e) {
|
|
1426
|
+
super({ expiringNotificationTimeInSeconds: e.accessTokenExpiringNotificationTimeInSeconds }), this._logger = new c("UserManagerEvents"), this._userLoaded = new m("User loaded"), this._userUnloaded = new m("User unloaded"), this._silentRenewError = new m("Silent renew error"), this._userSignedIn = new m("User signed in"), this._userSignedOut = new m("User signed out"), this._userSessionChanged = new m("User session changed");
|
|
1427
|
+
}
|
|
1428
|
+
async load(e, t = !0) {
|
|
1429
|
+
await super.load(e), t && await this._userLoaded.raise(e);
|
|
1430
|
+
}
|
|
1431
|
+
async unload() {
|
|
1432
|
+
await super.unload(), await this._userUnloaded.raise();
|
|
1433
|
+
}
|
|
1434
|
+
addUserLoaded(e) {
|
|
1435
|
+
return this._userLoaded.addHandler(e);
|
|
1436
|
+
}
|
|
1437
|
+
removeUserLoaded(e) {
|
|
1438
|
+
return this._userLoaded.removeHandler(e);
|
|
1439
|
+
}
|
|
1440
|
+
addUserUnloaded(e) {
|
|
1441
|
+
return this._userUnloaded.addHandler(e);
|
|
1442
|
+
}
|
|
1443
|
+
removeUserUnloaded(e) {
|
|
1444
|
+
return this._userUnloaded.removeHandler(e);
|
|
1445
|
+
}
|
|
1446
|
+
addSilentRenewError(e) {
|
|
1447
|
+
return this._silentRenewError.addHandler(e);
|
|
1448
|
+
}
|
|
1449
|
+
removeSilentRenewError(e) {
|
|
1450
|
+
return this._silentRenewError.removeHandler(e);
|
|
1451
|
+
}
|
|
1452
|
+
async _raiseSilentRenewError(e) {
|
|
1453
|
+
await this._silentRenewError.raise(e);
|
|
1454
|
+
}
|
|
1455
|
+
addUserSignedIn(e) {
|
|
1456
|
+
return this._userSignedIn.addHandler(e);
|
|
1457
|
+
}
|
|
1458
|
+
removeUserSignedIn(e) {
|
|
1459
|
+
this._userSignedIn.removeHandler(e);
|
|
1460
|
+
}
|
|
1461
|
+
async _raiseUserSignedIn() {
|
|
1462
|
+
await this._userSignedIn.raise();
|
|
1463
|
+
}
|
|
1464
|
+
addUserSignedOut(e) {
|
|
1465
|
+
return this._userSignedOut.addHandler(e);
|
|
1466
|
+
}
|
|
1467
|
+
removeUserSignedOut(e) {
|
|
1468
|
+
this._userSignedOut.removeHandler(e);
|
|
1469
|
+
}
|
|
1470
|
+
async _raiseUserSignedOut() {
|
|
1471
|
+
await this._userSignedOut.raise();
|
|
1472
|
+
}
|
|
1473
|
+
addUserSessionChanged(e) {
|
|
1474
|
+
return this._userSessionChanged.addHandler(e);
|
|
1475
|
+
}
|
|
1476
|
+
removeUserSessionChanged(e) {
|
|
1477
|
+
this._userSessionChanged.removeHandler(e);
|
|
1478
|
+
}
|
|
1479
|
+
async _raiseUserSessionChanged() {
|
|
1480
|
+
await this._userSessionChanged.raise();
|
|
1481
|
+
}
|
|
1482
|
+
}, pe = class {
|
|
1483
|
+
constructor(e) {
|
|
1484
|
+
this._userManager = e, this._logger = new c("SilentRenewService"), this._isStarted = !1, this._retryTimer = new g("Retry Silent Renew"), this._timeoutRetryCount = 0, this._tokenExpiring = async () => {
|
|
1485
|
+
let e = this._logger.create("_tokenExpiring");
|
|
1486
|
+
try {
|
|
1487
|
+
await this._userManager.signinSilent(), this._timeoutRetryCount = 0, e.debug("silent token renewal successful");
|
|
1488
|
+
} catch (t) {
|
|
1489
|
+
if (t instanceof b) {
|
|
1490
|
+
this._timeoutRetryCount++;
|
|
1491
|
+
let n = this._userManager.settings.maxSilentRenewTimeoutRetries;
|
|
1492
|
+
if (n !== void 0 && this._timeoutRetryCount > n) {
|
|
1493
|
+
e.error(`Timeout retry limit reached (${this._timeoutRetryCount} > ${n}), raising silentRenewError:`, t), this._timeoutRetryCount = 0, await this._userManager.events._raiseSilentRenewError(t);
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
e.warn(`ErrorTimeout from signinSilent (attempt ${this._timeoutRetryCount}), retry in 5s:`, t), this._retryTimer.init(5);
|
|
1497
|
+
return;
|
|
1498
|
+
}
|
|
1499
|
+
e.error("Error from signinSilent:", t), this._timeoutRetryCount = 0, await this._userManager.events._raiseSilentRenewError(t);
|
|
1500
|
+
}
|
|
1501
|
+
};
|
|
1502
|
+
}
|
|
1503
|
+
async start() {
|
|
1504
|
+
let e = this._logger.create("start");
|
|
1505
|
+
if (!this._isStarted) {
|
|
1506
|
+
this._isStarted = !0, this._userManager.events.addAccessTokenExpiring(this._tokenExpiring), this._retryTimer.addHandler(this._tokenExpiring);
|
|
1507
|
+
try {
|
|
1508
|
+
await this._userManager.getUser();
|
|
1509
|
+
} catch (t) {
|
|
1510
|
+
e.error("getUser error", t);
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
stop() {
|
|
1515
|
+
this._isStarted &&= (this._retryTimer.cancel(), this._retryTimer.removeHandler(this._tokenExpiring), this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring), !1);
|
|
1516
|
+
}
|
|
1517
|
+
}, me = class {
|
|
1518
|
+
constructor(e) {
|
|
1519
|
+
this.refresh_token = e.refresh_token, this.id_token = e.id_token, this.session_state = e.session_state, this.scope = e.scope, this.profile = e.profile, this.data = e.state;
|
|
1520
|
+
}
|
|
1521
|
+
}, he = class {
|
|
1522
|
+
constructor(e, t, n, r) {
|
|
1523
|
+
this._logger = new c("UserManager"), this.settings = new se(e), this._client = new ie(e), this._redirectNavigator = t ?? new de(this.settings), this._popupNavigator = n ?? new $(this.settings), this._iframeNavigator = r ?? new ce(this.settings), this._events = new fe(this.settings), this._silentRenewService = new pe(this), this.settings.automaticSilentRenew && this.startSilentRenew(), this._sessionMonitor = null, this.settings.monitorSession && (this._sessionMonitor = new W(this));
|
|
1524
|
+
}
|
|
1525
|
+
get events() {
|
|
1526
|
+
return this._events;
|
|
1527
|
+
}
|
|
1528
|
+
get metadataService() {
|
|
1529
|
+
return this._client.metadataService;
|
|
1530
|
+
}
|
|
1531
|
+
async getUser(e = !1) {
|
|
1532
|
+
let t = this._logger.create("getUser"), n = await this._loadUser();
|
|
1533
|
+
return n ? (t.info("user loaded"), await this._events.load(n, e), n) : (t.info("user not found in storage"), null);
|
|
1534
|
+
}
|
|
1535
|
+
async removeUser() {
|
|
1536
|
+
let e = this._logger.create("removeUser");
|
|
1537
|
+
await this.storeUser(null), e.info("user removed from storage"), await this._events.unload();
|
|
1538
|
+
}
|
|
1539
|
+
async signinRedirect(e = {}) {
|
|
1540
|
+
this._logger.create("signinRedirect");
|
|
1541
|
+
let { redirectMethod: t, ...n } = e, r;
|
|
1542
|
+
this.settings.dpop?.bind_authorization_code && (r = await this.generateDPoPJkt(this.settings.dpop));
|
|
1543
|
+
let i = await this._redirectNavigator.prepare({ redirectMethod: t });
|
|
1544
|
+
await this._signinStart({
|
|
1545
|
+
request_type: "si:r",
|
|
1546
|
+
dpopJkt: r,
|
|
1547
|
+
...n
|
|
1548
|
+
}, i);
|
|
1549
|
+
}
|
|
1550
|
+
async signinRedirectCallback(e = window.location.href) {
|
|
1551
|
+
let t = this._logger.create("signinRedirectCallback"), n = await this._signinEnd(e);
|
|
1552
|
+
return n.profile && n.profile.sub ? t.info("success, signed in subject", n.profile.sub) : t.info("no subject"), n;
|
|
1553
|
+
}
|
|
1554
|
+
async signinResourceOwnerCredentials({ username: e, password: t, skipUserInfo: n = !1 }) {
|
|
1555
|
+
let r = this._logger.create("signinResourceOwnerCredential"), i = await this._client.processResourceOwnerPasswordCredentials({
|
|
1556
|
+
username: e,
|
|
1557
|
+
password: t,
|
|
1558
|
+
skipUserInfo: n,
|
|
1559
|
+
extraTokenParams: this.settings.extraTokenParams
|
|
1560
|
+
});
|
|
1561
|
+
r.debug("got signin response");
|
|
1562
|
+
let a = await this._buildUser(i);
|
|
1563
|
+
return a.profile && a.profile.sub ? r.info("success, signed in subject", a.profile.sub) : r.info("no subject"), a;
|
|
1564
|
+
}
|
|
1565
|
+
async signinPopup(e = {}) {
|
|
1566
|
+
let t = this._logger.create("signinPopup"), n;
|
|
1567
|
+
this.settings.dpop?.bind_authorization_code && (n = await this.generateDPoPJkt(this.settings.dpop));
|
|
1568
|
+
let { popupWindowFeatures: r, popupWindowTarget: i, popupSignal: a, popupAbortOnClose: o, ...s } = e, c = this.settings.popup_redirect_uri;
|
|
1569
|
+
c || t.throw(/* @__PURE__ */ Error("No popup_redirect_uri configured"));
|
|
1570
|
+
let l = await this._popupNavigator.prepare({
|
|
1571
|
+
popupWindowFeatures: r,
|
|
1572
|
+
popupWindowTarget: i,
|
|
1573
|
+
popupSignal: a,
|
|
1574
|
+
popupAbortOnClose: o
|
|
1575
|
+
}), u = await this._signin({
|
|
1576
|
+
request_type: "si:p",
|
|
1577
|
+
redirect_uri: c,
|
|
1578
|
+
display: "popup",
|
|
1579
|
+
dpopJkt: n,
|
|
1580
|
+
...s
|
|
1581
|
+
}, l);
|
|
1582
|
+
return u && (u.profile && u.profile.sub ? t.info("success, signed in subject", u.profile.sub) : t.info("no subject")), u;
|
|
1583
|
+
}
|
|
1584
|
+
async signinPopupCallback(e = window.location.href, t = !1) {
|
|
1585
|
+
let n = this._logger.create("signinPopupCallback");
|
|
1586
|
+
await this._popupNavigator.callback(e, { keepOpen: t }), n.info("success");
|
|
1587
|
+
}
|
|
1588
|
+
async signinSilent(e = {}) {
|
|
1589
|
+
let t = this._logger.create("signinSilent"), { silentRequestTimeoutInSeconds: n, ...r } = e, i = await this._loadUser();
|
|
1590
|
+
if (!e.forceIframeAuth && i?.refresh_token) {
|
|
1591
|
+
t.debug("using refresh token");
|
|
1592
|
+
let e = new me(i);
|
|
1593
|
+
return await this._useRefreshToken({
|
|
1594
|
+
state: e,
|
|
1595
|
+
redirect_uri: r.redirect_uri,
|
|
1596
|
+
resource: r.resource,
|
|
1597
|
+
extraTokenParams: r.extraTokenParams,
|
|
1598
|
+
timeoutInSeconds: n
|
|
1599
|
+
});
|
|
1600
|
+
}
|
|
1601
|
+
let a;
|
|
1602
|
+
this.settings.dpop?.bind_authorization_code && (a = await this.generateDPoPJkt(this.settings.dpop));
|
|
1603
|
+
let o = this.settings.silent_redirect_uri;
|
|
1604
|
+
o || t.throw(/* @__PURE__ */ Error("No silent_redirect_uri configured"));
|
|
1605
|
+
let s;
|
|
1606
|
+
i && this.settings.validateSubOnSilentRenew && (t.debug("subject prior to silent renew:", i.profile.sub), s = i.profile.sub);
|
|
1607
|
+
let c = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: n });
|
|
1608
|
+
return i = await this._signin({
|
|
1609
|
+
request_type: "si:s",
|
|
1610
|
+
redirect_uri: o,
|
|
1611
|
+
prompt: "none",
|
|
1612
|
+
id_token_hint: this.settings.includeIdTokenInSilentRenew ? i?.id_token : void 0,
|
|
1613
|
+
dpopJkt: a,
|
|
1614
|
+
...r
|
|
1615
|
+
}, c, s), i && (i.profile?.sub ? t.info("success, signed in subject", i.profile.sub) : t.info("no subject")), i;
|
|
1616
|
+
}
|
|
1617
|
+
async _useRefreshToken(e) {
|
|
1618
|
+
let t = await this._client.useRefreshToken({
|
|
1619
|
+
timeoutInSeconds: this.settings.silentRequestTimeoutInSeconds,
|
|
1620
|
+
...e
|
|
1621
|
+
}), n = new G({
|
|
1622
|
+
...e.state,
|
|
1623
|
+
...t
|
|
1624
|
+
});
|
|
1625
|
+
return await this.storeUser(n), await this._events.load(n), n;
|
|
1626
|
+
}
|
|
1627
|
+
async signinSilentCallback(e = window.location.href) {
|
|
1628
|
+
let t = this._logger.create("signinSilentCallback");
|
|
1629
|
+
await this._iframeNavigator.callback(e), t.info("success");
|
|
1630
|
+
}
|
|
1631
|
+
async signinCallback(e = window.location.href) {
|
|
1632
|
+
let { state: t } = await this._client.readSigninResponseState(e);
|
|
1633
|
+
switch (t.request_type) {
|
|
1634
|
+
case "si:r": return await this.signinRedirectCallback(e);
|
|
1635
|
+
case "si:p":
|
|
1636
|
+
await this.signinPopupCallback(e);
|
|
1637
|
+
break;
|
|
1638
|
+
case "si:s":
|
|
1639
|
+
await this.signinSilentCallback(e);
|
|
1640
|
+
break;
|
|
1641
|
+
default: throw Error("invalid request_type in state");
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
async signoutCallback(e = window.location.href, t = !1) {
|
|
1645
|
+
let { state: n } = await this._client.readSignoutResponseState(e);
|
|
1646
|
+
if (n) switch (n.request_type) {
|
|
1647
|
+
case "so:r": return await this.signoutRedirectCallback(e);
|
|
1648
|
+
case "so:p":
|
|
1649
|
+
await this.signoutPopupCallback(e, t);
|
|
1650
|
+
break;
|
|
1651
|
+
case "so:s":
|
|
1652
|
+
await this.signoutSilentCallback(e);
|
|
1653
|
+
break;
|
|
1654
|
+
default: throw Error("invalid request_type in state");
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
async querySessionStatus(e = {}) {
|
|
1658
|
+
let t = this._logger.create("querySessionStatus"), { silentRequestTimeoutInSeconds: n, ...r } = e, i = this.settings.silent_redirect_uri;
|
|
1659
|
+
i || t.throw(/* @__PURE__ */ Error("No silent_redirect_uri configured"));
|
|
1660
|
+
let a = await this._loadUser(), o = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: n }), s = await this._signinStart({
|
|
1661
|
+
request_type: "si:s",
|
|
1662
|
+
redirect_uri: i,
|
|
1663
|
+
prompt: "none",
|
|
1664
|
+
id_token_hint: this.settings.includeIdTokenInSilentRenew ? a?.id_token : void 0,
|
|
1665
|
+
response_type: this.settings.query_status_response_type,
|
|
1666
|
+
scope: "openid",
|
|
1667
|
+
skipUserInfo: !0,
|
|
1668
|
+
...r
|
|
1669
|
+
}, o);
|
|
1670
|
+
try {
|
|
1671
|
+
let e = await this._client.processSigninResponse(s.url, {});
|
|
1672
|
+
return t.debug("got signin response"), e.session_state && e.profile.sub ? (t.info("success for subject", e.profile.sub), {
|
|
1673
|
+
session_state: e.session_state,
|
|
1674
|
+
sub: e.profile.sub
|
|
1675
|
+
}) : (t.info("success, user not authenticated"), null);
|
|
1676
|
+
} catch (e) {
|
|
1677
|
+
if (this.settings.monitorAnonymousSession && e instanceof y) switch (e.error) {
|
|
1678
|
+
case "login_required":
|
|
1679
|
+
case "consent_required":
|
|
1680
|
+
case "interaction_required":
|
|
1681
|
+
case "account_selection_required": return t.info("success for anonymous user"), { session_state: e.session_state };
|
|
1682
|
+
}
|
|
1683
|
+
throw e;
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
async _signin(e, t, n) {
|
|
1687
|
+
let r = await this._signinStart(e, t);
|
|
1688
|
+
return await this._signinEnd(r.url, n);
|
|
1689
|
+
}
|
|
1690
|
+
async _signinStart(e, t) {
|
|
1691
|
+
let n = this._logger.create("_signinStart");
|
|
1692
|
+
try {
|
|
1693
|
+
let r = await this._client.createSigninRequest(e);
|
|
1694
|
+
return n.debug("got signin request"), await t.navigate({
|
|
1695
|
+
url: r.url,
|
|
1696
|
+
state: r.state.id,
|
|
1697
|
+
response_mode: r.state.response_mode,
|
|
1698
|
+
scriptOrigin: this.settings.iframeScriptOrigin
|
|
1699
|
+
});
|
|
1700
|
+
} catch (e) {
|
|
1701
|
+
throw n.debug("error after preparing navigator, closing navigator window"), t.close(), e;
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
async _signinEnd(e, t) {
|
|
1705
|
+
let n = this._logger.create("_signinEnd"), r = await this._client.processSigninResponse(e, {});
|
|
1706
|
+
return n.debug("got signin response"), await this._buildUser(r, t);
|
|
1707
|
+
}
|
|
1708
|
+
async _buildUser(e, t) {
|
|
1709
|
+
let n = this._logger.create("_buildUser"), r = new G(e);
|
|
1710
|
+
if (t) {
|
|
1711
|
+
if (t !== r.profile.sub) throw n.debug("current user does not match user returned from signin. sub from signin:", r.profile.sub), new y({
|
|
1712
|
+
...e,
|
|
1713
|
+
error: "login_required"
|
|
1714
|
+
});
|
|
1715
|
+
n.debug("current user matches user returned from signin");
|
|
1716
|
+
}
|
|
1717
|
+
return await this.storeUser(r), n.debug("user stored"), await this._events.load(r), r;
|
|
1718
|
+
}
|
|
1719
|
+
async signoutRedirect(e = {}) {
|
|
1720
|
+
let t = this._logger.create("signoutRedirect"), { redirectMethod: n, ...r } = e, i = await this._redirectNavigator.prepare({ redirectMethod: n });
|
|
1721
|
+
await this._signoutStart({
|
|
1722
|
+
request_type: "so:r",
|
|
1723
|
+
post_logout_redirect_uri: this.settings.post_logout_redirect_uri,
|
|
1724
|
+
...r
|
|
1725
|
+
}, i), t.info("success");
|
|
1726
|
+
}
|
|
1727
|
+
async signoutRedirectCallback(e = window.location.href) {
|
|
1728
|
+
let t = this._logger.create("signoutRedirectCallback"), n = await this._signoutEnd(e);
|
|
1729
|
+
return t.info("success"), n;
|
|
1730
|
+
}
|
|
1731
|
+
async signoutPopup(e = {}) {
|
|
1732
|
+
let t = this._logger.create("signoutPopup"), { popupWindowFeatures: n, popupWindowTarget: r, popupSignal: i, ...a } = e, o = this.settings.popup_post_logout_redirect_uri, s = await this._popupNavigator.prepare({
|
|
1733
|
+
popupWindowFeatures: n,
|
|
1734
|
+
popupWindowTarget: r,
|
|
1735
|
+
popupSignal: i
|
|
1736
|
+
});
|
|
1737
|
+
await this._signout({
|
|
1738
|
+
request_type: "so:p",
|
|
1739
|
+
post_logout_redirect_uri: o,
|
|
1740
|
+
state: o == null ? void 0 : {},
|
|
1741
|
+
...a
|
|
1742
|
+
}, s), t.info("success");
|
|
1743
|
+
}
|
|
1744
|
+
async signoutPopupCallback(e = window.location.href, t = !1) {
|
|
1745
|
+
let n = this._logger.create("signoutPopupCallback");
|
|
1746
|
+
await this._popupNavigator.callback(e, { keepOpen: t }), n.info("success");
|
|
1747
|
+
}
|
|
1748
|
+
async _signout(e, t) {
|
|
1749
|
+
let n = await this._signoutStart(e, t);
|
|
1750
|
+
return await this._signoutEnd(n.url);
|
|
1751
|
+
}
|
|
1752
|
+
async _signoutStart(e = {}, t) {
|
|
1753
|
+
let n = this._logger.create("_signoutStart");
|
|
1754
|
+
try {
|
|
1755
|
+
let r = await this._loadUser();
|
|
1756
|
+
n.debug("loaded current user from storage"), this.settings.revokeTokensOnSignout && await this._revokeInternal(r);
|
|
1757
|
+
let i = e.id_token_hint || r && r.id_token;
|
|
1758
|
+
i && (n.debug("setting id_token_hint in signout request"), e.id_token_hint = i), await this.removeUser(), n.debug("user removed, creating signout request");
|
|
1759
|
+
let a = await this._client.createSignoutRequest(e);
|
|
1760
|
+
return n.debug("got signout request"), await t.navigate({
|
|
1761
|
+
url: a.url,
|
|
1762
|
+
state: a.state?.id,
|
|
1763
|
+
scriptOrigin: this.settings.iframeScriptOrigin
|
|
1764
|
+
});
|
|
1765
|
+
} catch (e) {
|
|
1766
|
+
throw n.debug("error after preparing navigator, closing navigator window"), t.close(), e;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
async _signoutEnd(e) {
|
|
1770
|
+
let t = this._logger.create("_signoutEnd"), n = await this._client.processSignoutResponse(e);
|
|
1771
|
+
return t.debug("got signout response"), n;
|
|
1772
|
+
}
|
|
1773
|
+
async signoutSilent(e = {}) {
|
|
1774
|
+
let t = this._logger.create("signoutSilent"), { silentRequestTimeoutInSeconds: n, ...r } = e, i = this.settings.includeIdTokenInSilentSignout ? (await this._loadUser())?.id_token : void 0, a = this.settings.popup_post_logout_redirect_uri, o = await this._iframeNavigator.prepare({ silentRequestTimeoutInSeconds: n });
|
|
1775
|
+
await this._signout({
|
|
1776
|
+
request_type: "so:s",
|
|
1777
|
+
post_logout_redirect_uri: a,
|
|
1778
|
+
id_token_hint: i,
|
|
1779
|
+
...r
|
|
1780
|
+
}, o), t.info("success");
|
|
1781
|
+
}
|
|
1782
|
+
async signoutSilentCallback(e = window.location.href) {
|
|
1783
|
+
let t = this._logger.create("signoutSilentCallback");
|
|
1784
|
+
await this._iframeNavigator.callback(e), t.info("success");
|
|
1785
|
+
}
|
|
1786
|
+
async revokeTokens(e) {
|
|
1787
|
+
let t = await this._loadUser();
|
|
1788
|
+
await this._revokeInternal(t, e);
|
|
1789
|
+
}
|
|
1790
|
+
async _revokeInternal(e, t = this.settings.revokeTokenTypes) {
|
|
1791
|
+
let n = this._logger.create("_revokeInternal");
|
|
1792
|
+
if (!e) return;
|
|
1793
|
+
let r = t.filter((t) => typeof e[t] == "string");
|
|
1794
|
+
if (!r.length) {
|
|
1795
|
+
n.debug("no need to revoke due to no token(s)");
|
|
1796
|
+
return;
|
|
1797
|
+
}
|
|
1798
|
+
for (let t of r) await this._client.revokeToken(e[t], t), n.info(`${t} revoked successfully`), t !== "access_token" && (e[t] = null);
|
|
1799
|
+
await this.storeUser(e), n.debug("user stored"), await this._events.load(e);
|
|
1800
|
+
}
|
|
1801
|
+
startSilentRenew() {
|
|
1802
|
+
this._logger.create("startSilentRenew"), this._silentRenewService.start();
|
|
1803
|
+
}
|
|
1804
|
+
stopSilentRenew() {
|
|
1805
|
+
this._silentRenewService.stop();
|
|
1806
|
+
}
|
|
1807
|
+
get _userStoreKey() {
|
|
1808
|
+
return `user:${this.settings.authority}:${this.settings.client_id}`;
|
|
1809
|
+
}
|
|
1810
|
+
async _loadUser() {
|
|
1811
|
+
let e = this._logger.create("_loadUser"), t = await this.settings.userStore.get(this._userStoreKey);
|
|
1812
|
+
return t ? (e.debug("user storageString loaded"), G.fromStorageString(t)) : (e.debug("no user storageString"), null);
|
|
1813
|
+
}
|
|
1814
|
+
async storeUser(e) {
|
|
1815
|
+
let t = this._logger.create("storeUser");
|
|
1816
|
+
if (e) {
|
|
1817
|
+
t.debug("storing user");
|
|
1818
|
+
let n = e.toStorageString();
|
|
1819
|
+
await this.settings.userStore.set(this._userStoreKey, n);
|
|
1820
|
+
} else this._logger.debug("removing user"), await this.settings.userStore.remove(this._userStoreKey), this.settings.dpop && await this.settings.dpop.store.remove(this.settings.client_id);
|
|
1821
|
+
}
|
|
1822
|
+
async clearStaleState() {
|
|
1823
|
+
await this._client.clearStaleState();
|
|
1824
|
+
}
|
|
1825
|
+
async dpopProof(e, t, n, r) {
|
|
1826
|
+
let i = await (this.settings.dpop?.store)?.get(this.settings.client_id);
|
|
1827
|
+
if (i) return await p.generateDPoPProof({
|
|
1828
|
+
url: e,
|
|
1829
|
+
accessToken: t?.access_token,
|
|
1830
|
+
httpMethod: n,
|
|
1831
|
+
keyPair: i.keys,
|
|
1832
|
+
nonce: r
|
|
1833
|
+
});
|
|
1834
|
+
}
|
|
1835
|
+
async generateDPoPJkt(e) {
|
|
1836
|
+
let t = await e.store.get(this.settings.client_id);
|
|
1837
|
+
return t || (t = new U(await p.generateDPoPKeys()), await e.store.set(this.settings.client_id, t)), await p.generateDPoPJkt(t.keys);
|
|
1838
|
+
}
|
|
1839
|
+
};
|
|
1840
|
+
//#endregion
|
|
1841
|
+
export { D as n, he as t };
|
|
1842
|
+
|
|
1843
|
+
//# sourceMappingURL=oidc-client-ts.js.map
|