@jmruthers/pace-core 0.5.134 → 0.5.136
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DataTable-C7GaRZye.d.ts → DataTable-CWAZZcXC.d.ts} +1 -1
- package/dist/{DataTable-A36PJG6N.js → DataTable-CYOHOX3O.js} +25 -13
- package/dist/{PublicLoadingSpinner-CUAnTvcg.d.ts → EventLogo-801uofbR.d.ts} +51 -135
- package/dist/UnifiedAuthProvider-5E5TUNMS.js +17 -0
- package/dist/{UnifiedAuthProvider-BVKmQd9u.d.ts → UnifiedAuthProvider-DJxGTftH.d.ts} +1 -1
- package/dist/{api-TNIBJWLM.js → api-45XYYO2A.js} +4 -3
- package/dist/{audit-T36HM7IM.js → audit-64X3VJXB.js} +3 -2
- package/dist/{chunk-CTJRBUX2.js → chunk-2TWNJ46Y.js} +2 -2
- package/dist/{chunk-UJI6WSMD.js → chunk-444EZN6N.js} +3 -3
- package/dist/chunk-444EZN6N.js.map +1 -0
- package/dist/{chunk-3CG5L6RN.js → chunk-4MT5BGGL.js} +90 -73
- package/dist/chunk-4MT5BGGL.js.map +1 -0
- package/dist/{chunk-PYUXFQJ3.js → chunk-56XJ3TU6.js} +2 -2
- package/dist/chunk-56XJ3TU6.js.map +1 -0
- package/dist/chunk-5DPZ5EAT.js +60 -0
- package/dist/chunk-5DPZ5EAT.js.map +1 -0
- package/dist/{chunk-66C4BSAY.js → chunk-ANBQRTPX.js} +9 -2
- package/dist/chunk-ANBQRTPX.js.map +1 -0
- package/dist/chunk-APIBCTL2.js +670 -0
- package/dist/chunk-APIBCTL2.js.map +1 -0
- package/dist/{chunk-GKHF54DI.js → chunk-BESYRHQM.js} +10 -4
- package/dist/chunk-BESYRHQM.js.map +1 -0
- package/dist/{chunk-WP5I5GLN.js → chunk-BVYWGZVV.js} +112 -97
- package/dist/chunk-BVYWGZVV.js.map +1 -0
- package/dist/{chunk-GEVIB2UB.js → chunk-ERISIBYU.js} +14 -5
- package/dist/chunk-ERISIBYU.js.map +1 -0
- package/dist/{chunk-CQZU6TFE.js → chunk-FHWWBIHA.js} +100 -62
- package/dist/chunk-FHWWBIHA.js.map +1 -0
- package/dist/{chunk-O3NWNXDY.js → chunk-FMUCXFII.js} +2 -2
- package/dist/chunk-FMUCXFII.js.map +1 -0
- package/dist/{chunk-GVDR7WNV.js → chunk-HJGGOMQ6.js} +194 -518
- package/dist/chunk-HJGGOMQ6.js.map +1 -0
- package/dist/{chunk-BDZUMRBD.js → chunk-K2WWTH7O.js} +13 -6
- package/dist/chunk-K2WWTH7O.js.map +1 -0
- package/dist/{chunk-BYXRHAIF.js → chunk-L6PGMCMD.js} +23 -14
- package/dist/chunk-L6PGMCMD.js.map +1 -0
- package/dist/chunk-LMC26NLJ.js +84 -0
- package/dist/chunk-LMC26NLJ.js.map +1 -0
- package/dist/{chunk-M6DDYFUD.js → chunk-LS353YLY.js} +19 -16
- package/dist/chunk-LS353YLY.js.map +1 -0
- package/dist/{chunk-ZYZCRSBD.js → chunk-LTV3XIJJ.js} +16 -11
- package/dist/chunk-LTV3XIJJ.js.map +1 -0
- package/dist/{chunk-HMNOSGVA.js → chunk-NOHEVYVX.js} +377 -666
- package/dist/chunk-NOHEVYVX.js.map +1 -0
- package/dist/{chunk-JCQZ6LA7.js → chunk-Q5QRDWKI.js} +9 -3
- package/dist/chunk-Q5QRDWKI.js.map +1 -0
- package/dist/chunk-S5OFRT4M.js +94 -0
- package/dist/chunk-S5OFRT4M.js.map +1 -0
- package/dist/{chunk-3DBFLLLU.js → chunk-SBVILCCA.js} +14 -9
- package/dist/chunk-SBVILCCA.js.map +1 -0
- package/dist/{chunk-TGIY2AR2.js → chunk-SL2YQDR6.js} +4 -3
- package/dist/{chunk-TGIY2AR2.js.map → chunk-SL2YQDR6.js.map} +1 -1
- package/dist/{chunk-VZ5OR6HD.js → chunk-TVYPTYOY.js} +55 -179
- package/dist/chunk-TVYPTYOY.js.map +1 -0
- package/dist/{chunk-ZV77RZMU.js → chunk-XARJS7CD.js} +2 -2
- package/dist/chunk-XDNLUEXI.js +138 -0
- package/dist/chunk-XDNLUEXI.js.map +1 -0
- package/dist/{chunk-F64FFPOZ.js → chunk-YLKIDTUK.js} +26 -20
- package/dist/chunk-YLKIDTUK.js.map +1 -0
- package/dist/{chunk-5F3NDPJV.js → chunk-ZZ2SS7NI.js} +10 -5
- package/dist/chunk-ZZ2SS7NI.js.map +1 -0
- package/dist/components.d.ts +7 -287
- package/dist/components.js +26 -157
- package/dist/components.js.map +1 -1
- package/dist/{file-reference-C9isKNPn.d.ts → file-reference-C6Gkn77H.d.ts} +1 -1
- package/dist/{formatting-DFcCxUEk.d.ts → formatting-CvUXy2mF.d.ts} +1 -1
- package/dist/hooks.d.ts +3 -3
- package/dist/hooks.js +22 -16
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +219 -9
- package/dist/index.js +49 -31
- package/dist/index.js.map +1 -1
- package/dist/providers.d.ts +1 -1
- package/dist/providers.js +5 -4
- package/dist/rbac/index.js +13 -12
- package/dist/styles/index.js +2 -1
- package/dist/theming/runtime.d.ts +2 -19
- package/dist/theming/runtime.js +2 -1
- package/dist/{types-D5rqZQXk.d.ts → types-Dfz9dmVH.d.ts} +12 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.js +1 -1
- package/dist/{useInactivityTracker-MRUU55XI.js → useInactivityTracker-TO6ZOF35.js} +3 -2
- package/dist/{usePublicRouteParams-Dyt1tzI9.d.ts → usePublicRouteParams-B7PabvuH.d.ts} +1 -1
- package/dist/utils.d.ts +195 -232
- package/dist/utils.js +173 -331
- package/dist/utils.js.map +1 -1
- package/dist/{validation-DnhrNMju.d.ts → validation-8npbysjg.d.ts} +26 -8
- package/dist/validation.d.ts +261 -10
- package/dist/validation.js +82 -440
- package/dist/validation.js.map +1 -1
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +6 -6
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +6 -6
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +7 -7
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +4 -4
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +29 -4
- package/docs/api/interfaces/DataAccessRecord.md +9 -9
- package/docs/api/interfaces/DataRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +18 -18
- package/docs/api/interfaces/DataTableColumn.md +61 -1
- package/docs/api/interfaces/DataTableProps.md +3 -3
- package/docs/api/interfaces/DataTableToolbarButton.md +7 -7
- package/docs/api/interfaces/EmptyStateConfig.md +5 -5
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +14 -14
- package/docs/api/interfaces/EventAppRoleData.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +152 -0
- package/docs/api/interfaces/ExportColumn.md +90 -0
- package/docs/api/interfaces/ExportOptions.md +126 -0
- package/docs/api/interfaces/FileDisplayProps.md +15 -15
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/GrantEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +10 -10
- package/docs/api/interfaces/NavigationContextType.md +9 -9
- package/docs/api/interfaces/NavigationGuardProps.md +10 -10
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +7 -7
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +27 -27
- package/docs/api/interfaces/PaceLoginPageProps.md +4 -4
- package/docs/api/interfaces/PageAccessRecord.md +8 -8
- package/docs/api/interfaces/PagePermissionContextType.md +8 -8
- package/docs/api/interfaces/PagePermissionGuardProps.md +11 -11
- package/docs/api/interfaces/PagePermissionProviderProps.md +7 -7
- package/docs/api/interfaces/PaletteData.md +4 -4
- package/docs/api/interfaces/PermissionEnforcerProps.md +11 -11
- package/docs/api/interfaces/ProtectedRouteProps.md +6 -6
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RevokeEventAppRoleParams.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +8 -8
- package/docs/api/interfaces/RoleBasedRouterProps.md +10 -10
- package/docs/api/interfaces/RoleManagementResult.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +10 -10
- package/docs/api/interfaces/RouteConfig.md +10 -10
- package/docs/api/interfaces/SecureDataContextType.md +9 -9
- package/docs/api/interfaces/SecureDataProviderProps.md +8 -8
- package/docs/api/interfaces/SessionRestorationLoaderProps.md +21 -0
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +53 -53
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +13 -13
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +9 -9
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +8 -8
- package/docs/api/interfaces/UsePublicEventOptions.md +3 -3
- package/docs/api/interfaces/UsePublicEventReturn.md +5 -5
- package/docs/api/interfaces/UsePublicFileDisplayOptions.md +4 -4
- package/docs/api/interfaces/UsePublicFileDisplayReturn.md +9 -9
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +4 -4
- package/docs/api/interfaces/UseResolvedScopeReturn.md +4 -4
- package/docs/api/interfaces/UserEventAccess.md +11 -11
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +648 -212
- package/docs/api-reference/components.md +106 -26
- package/docs/architecture/README.md +0 -2
- package/docs/implementation-guides/data-tables.md +277 -13
- package/docs/implementation-guides/forms.md +1 -16
- package/docs/implementation-guides/permission-enforcement.md +8 -2
- package/examples/README.md +30 -14
- package/examples/STRUCTURE.md +125 -0
- package/examples/components/DataTable/HierarchicalActionsExample.tsx +421 -0
- package/examples/components/DataTable/HierarchicalExample.tsx +475 -0
- package/examples/components/DataTable/InitialPageSizeExample.tsx +177 -0
- package/examples/components/DataTable/PerformanceExample.tsx +506 -0
- package/examples/components/DataTable/index.ts +13 -0
- package/examples/components/Dialog/BasicHtmlTest.tsx +55 -0
- package/examples/components/Dialog/DebugHtmlExample.tsx +68 -0
- package/examples/components/Dialog/HtmlDialogExample.tsx +202 -0
- package/examples/components/Dialog/ScrollableDialogExample.tsx +290 -0
- package/examples/components/Dialog/SimpleHtmlTest.tsx +61 -0
- package/examples/components/Dialog/SmartDialogExample.tsx +322 -0
- package/examples/components/Dialog/index.ts +15 -0
- package/examples/components/index.ts +11 -0
- package/examples/features/index.ts +12 -0
- package/examples/{public-pages → features/public-pages}/CorrectPublicPageImplementation.tsx +1 -1
- package/examples/{public-pages → features/public-pages}/PublicEventPage.tsx +1 -1
- package/examples/{public-pages → features/public-pages}/PublicPageApp.tsx +1 -1
- package/examples/{public-pages → features/public-pages}/PublicPageUsageExample.tsx +1 -1
- package/examples/index.ts +11 -3
- package/package.json +30 -10
- package/src/components/Alert/Alert.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Card/Card.tsx +1 -1
- package/src/components/Checkbox/Checkbox.tsx +1 -1
- package/src/components/DataTable/DataTable.test.tsx +1 -1
- package/src/components/DataTable/DataTable.tsx +1 -30
- package/src/components/DataTable/__tests__/DataTable.grouping-aggregation.test.tsx +562 -0
- package/src/components/DataTable/__tests__/styles.test.ts +2 -2
- package/src/components/DataTable/components/ActionButtons.tsx +0 -15
- package/src/components/DataTable/components/DataTableCore.tsx +4 -185
- package/src/components/DataTable/components/DataTableErrorBoundary.tsx +1 -1
- package/src/components/DataTable/components/DataTableModals.tsx +1 -27
- package/src/components/DataTable/components/EditableRow.tsx +1 -1
- package/src/components/DataTable/components/ImportModal.tsx +2 -14
- package/src/components/DataTable/components/PaginationControls.tsx +1 -1
- package/src/components/DataTable/components/UnifiedTableBody.tsx +109 -82
- package/src/components/DataTable/components/__tests__/ActionButtons.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/DataTableErrorBoundary.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/DataTableModals.test.tsx +1 -1
- package/src/components/DataTable/components/__tests__/ImportModal.test.tsx +1 -1
- package/src/components/DataTable/examples/GroupingAggregationExample.tsx +273 -0
- package/src/components/DataTable/examples/HierarchicalActionsExample.tsx +1 -1
- package/src/components/DataTable/examples/__tests__/HierarchicalActionsExample.test.tsx +1 -1
- package/src/components/DataTable/hooks/useColumnOrderPersistence.ts +1 -1
- package/src/components/DataTable/hooks/useColumnVisibilityPersistence.ts +1 -1
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +2 -23
- package/src/components/DataTable/index.ts +4 -0
- package/src/components/DataTable/styles.ts +1 -1
- package/src/components/DataTable/types.ts +13 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +1 -1
- package/src/components/DataTable/utils/aggregationUtils.ts +161 -0
- package/src/components/DataTable/utils/exportUtils.ts +1 -1
- package/src/components/DataTable/utils/flexibleImport.ts +1 -11
- package/src/components/DataTable/utils/index.ts +1 -0
- package/src/components/DataTable/utils/paginationUtils.ts +1 -1
- package/src/components/Dialog/Dialog.tsx +2 -2
- package/src/components/ErrorBoundary/ErrorBoundary.test.tsx +35 -7
- package/src/components/ErrorBoundary/ErrorBoundary.tsx +5 -4
- package/src/components/EventSelector/EventSelector.tsx +3 -2
- package/src/components/FileDisplay/FileDisplay.tsx +2 -36
- package/src/components/FileUpload/FileUpload.test.tsx +2 -2
- package/src/components/FileUpload/FileUpload.tsx +2 -2
- package/src/components/Footer/Footer.tsx +1 -1
- package/src/components/Form/Form.test.tsx +4 -509
- package/src/components/Form/Form.tsx +1 -1
- package/src/components/Form/FormField.tsx +1 -1
- package/src/components/Form/index.ts +0 -12
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Input/Input.tsx +1 -1
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/LoginForm/LoginForm.tsx +1 -1
- package/src/components/NavigationMenu/NavigationMenu.test.tsx +19 -3
- package/src/components/NavigationMenu/NavigationMenu.tsx +9 -8
- package/src/components/OrganisationSelector/OrganisationSelector.tsx +4 -3
- package/src/components/PaceAppLayout/PaceAppLayout.tsx +14 -12
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.integration.test.tsx +0 -16
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.security.test.tsx +0 -1
- package/src/components/PaceAppLayout/__tests__/PaceAppLayout.unit.test.tsx +0 -9
- package/src/components/PaceLoginPage/PaceLoginPage.test.tsx +35 -3
- package/src/components/PaceLoginPage/PaceLoginPage.tsx +13 -12
- package/src/components/PasswordReset/PasswordChangeForm.tsx +1 -1
- package/src/components/PasswordReset/index.ts +0 -2
- package/src/components/Progress/Progress.tsx +1 -1
- package/src/components/ProtectedRoute/ProtectedRoute.test.tsx +35 -8
- package/src/components/ProtectedRoute/ProtectedRoute.tsx +3 -2
- package/src/components/PublicLayout/PublicErrorBoundary.tsx +1 -1
- package/src/components/PublicLayout/PublicLoadingSpinner.tsx +1 -1
- package/src/components/PublicLayout/PublicPageContextChecker.tsx +44 -43
- package/src/components/PublicLayout/PublicPageFooter.tsx +1 -1
- package/src/components/PublicLayout/PublicPageHeader.tsx +1 -15
- package/src/components/PublicLayout/PublicPageProvider.tsx +3 -2
- package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +2 -0
- package/src/components/PublicLayout/index.ts +4 -2
- package/src/components/Select/Select.tsx +1 -1
- package/src/components/{SessionRestorationLoader.tsx → SessionRestorationLoader/SessionRestorationLoader.tsx} +3 -2
- package/src/components/SessionRestorationLoader/index.ts +3 -0
- package/src/components/Switch/Switch.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Toast/Toast.tsx +1 -1
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/components/index.ts +4 -10
- package/src/hooks/__tests__/hooks.integration.test.tsx +37 -22
- package/src/hooks/__tests__/useComponentPerformance.unit.test.tsx +33 -17
- package/src/hooks/__tests__/useDataTablePerformance.unit.test.ts +28 -3
- package/src/hooks/__tests__/useFileDisplay.unit.test.ts +36 -9
- package/src/hooks/__tests__/useInactivityTracker.unit.test.ts +26 -2
- package/src/hooks/__tests__/usePerformanceMonitor.unit.test.ts +19 -6
- package/src/hooks/__tests__/usePermissionCache.simple.test.ts +17 -4
- package/src/hooks/__tests__/usePermissionCache.unit.test.ts +17 -4
- package/src/hooks/__tests__/usePublicEvent.simple.test.ts +26 -6
- package/src/hooks/__tests__/usePublicFileDisplay.test.ts +16 -6
- package/src/hooks/__tests__/useSecureDataAccess.unit.test.tsx +3 -3
- package/src/hooks/__tests__/useSessionRestoration.unit.test.tsx +17 -3
- package/src/hooks/public/usePublicEvent.ts +7 -6
- package/src/hooks/public/usePublicEventLogo.ts +7 -4
- package/src/hooks/public/usePublicFileDisplay.ts +6 -150
- package/src/hooks/useComponentPerformance.ts +4 -1
- package/src/hooks/useDataTablePerformance.ts +4 -3
- package/src/hooks/useEventTheme.test.ts +18 -5
- package/src/hooks/useEventTheme.ts +4 -1
- package/src/hooks/useEvents.ts +2 -0
- package/src/hooks/useFileDisplay.ts +9 -8
- package/src/hooks/useFileReference.ts +4 -1
- package/src/hooks/useFileUrl.ts +4 -1
- package/src/hooks/useInactivityTracker.ts +5 -4
- package/src/hooks/useOrganisationSecurity.test.ts +33 -12
- package/src/hooks/useOrganisationSecurity.ts +8 -7
- package/src/hooks/usePerformanceMonitor.ts +6 -3
- package/src/hooks/usePermissionCache.ts +13 -6
- package/src/hooks/useSecureDataAccess.test.ts +2 -2
- package/src/hooks/useSecureDataAccess.ts +9 -8
- package/src/hooks/useSessionRestoration.ts +4 -1
- package/src/hooks/useStorage.ts +4 -1
- package/src/index.ts +25 -8
- package/src/providers/services/AuthServiceProvider.tsx +3 -2
- package/src/providers/services/EventServiceProvider.tsx +2 -1
- package/src/providers/services/InactivityServiceProvider.tsx +2 -1
- package/src/providers/services/OrganisationServiceProvider.tsx +2 -1
- package/src/providers/services/UnifiedAuthProvider.tsx +4 -3
- package/src/providers/services/__tests__/AuthServiceProvider.integration.test.tsx +22 -2
- package/src/providers/services/__tests__/UnifiedAuthProvider.integration.test.tsx +24 -2
- package/src/rbac/__tests__/cache-invalidation.test.ts +20 -6
- package/src/rbac/api.ts +5 -2
- package/src/rbac/audit-enhanced.ts +6 -6
- package/src/rbac/audit.test.ts +60 -38
- package/src/rbac/audit.ts +8 -8
- package/src/rbac/cache-invalidation.ts +7 -4
- package/src/rbac/components/EnhancedNavigationMenu.tsx +11 -5
- package/src/rbac/components/NavigationGuard.tsx +7 -3
- package/src/rbac/components/NavigationProvider.tsx +6 -3
- package/src/rbac/components/PagePermissionGuard.tsx +28 -16
- package/src/rbac/components/PagePermissionProvider.tsx +4 -1
- package/src/rbac/components/PermissionEnforcer.tsx +9 -3
- package/src/rbac/components/RoleBasedRouter.tsx +3 -1
- package/src/rbac/components/SecureDataProvider.tsx +7 -3
- package/src/rbac/components/__tests__/EnhancedNavigationMenu.test.tsx +87 -61
- package/src/rbac/components/__tests__/NavigationGuard.test.tsx +83 -33
- package/src/rbac/components/__tests__/NavigationProvider.test.tsx +36 -13
- package/src/rbac/components/__tests__/PagePermissionGuard.test.tsx +2 -2
- package/src/rbac/components/__tests__/PagePermissionProvider.test.tsx +22 -8
- package/src/rbac/components/__tests__/PermissionEnforcer.test.tsx +19 -6
- package/src/rbac/components/__tests__/SecureDataProvider.fixed.test.tsx +43 -17
- package/src/rbac/components/__tests__/SecureDataProvider.test.tsx +42 -17
- package/src/rbac/engine.ts +15 -7
- package/src/rbac/hooks/usePermissions.ts +7 -3
- package/src/rbac/hooks/useResolvedScope.test.ts +2 -2
- package/src/rbac/hooks/useResolvedScope.ts +10 -7
- package/src/rbac/permissions.ts +5 -2
- package/src/rbac/security.test.ts +27 -16
- package/src/rbac/security.ts +5 -4
- package/src/services/AuthService.ts +22 -21
- package/src/services/EventService.ts +12 -12
- package/src/services/InactivityService.ts +5 -4
- package/src/services/OrganisationService.ts +26 -25
- package/src/services/__tests__/AuthService.test.ts +51 -19
- package/src/services/__tests__/EventService.test.ts +37 -5
- package/src/services/__tests__/InactivityService.test.ts +38 -4
- package/src/services/__tests__/OrganisationService.test.ts +3 -8
- package/src/services/base/BaseService.ts +3 -1
- package/src/theming/__tests__/runtime.test.ts +21 -12
- package/src/theming/parseEventColours.ts +5 -19
- package/src/theming/runtime.ts +8 -4
- package/src/types/validation.ts +2 -29
- package/src/utils/__tests__/appConfig.unit.test.ts +1 -1
- package/src/utils/__tests__/audit.unit.test.ts +1 -1
- package/src/utils/__tests__/auth-utils.unit.test.ts +1 -1
- package/src/utils/__tests__/bundleAnalysis.unit.test.ts +19 -19
- package/src/utils/__tests__/cn.unit.test.ts +1 -1
- package/src/utils/__tests__/debugLogger.test.ts +1 -1
- package/src/utils/__tests__/deviceFingerprint.unit.test.ts +1 -1
- package/src/utils/__tests__/dynamicUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/formatting.unit.test.ts +1 -1
- package/src/utils/__tests__/lazyLoad.unit.test.tsx +1 -1
- package/src/utils/__tests__/logger.unit.test.ts +1 -1
- package/src/utils/__tests__/organisationContext.unit.test.ts +1 -1
- package/src/utils/__tests__/performanceBenchmark.test.ts +1 -1
- package/src/utils/__tests__/performanceBudgets.unit.test.ts +1 -1
- package/src/utils/__tests__/permissionTypes.unit.test.ts +1 -1
- package/src/utils/__tests__/permissionUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/sanitization.unit.test.ts +1 -1
- package/src/utils/__tests__/schemaUtils.unit.test.ts +1 -1
- package/src/utils/__tests__/secureDataAccess.unit.test.ts +1 -1
- package/src/utils/__tests__/secureErrors.unit.test.ts +33 -15
- package/src/utils/__tests__/secureStorage.unit.test.ts +1 -1
- package/src/utils/__tests__/security.unit.test.ts +40 -18
- package/src/utils/__tests__/securityMonitor.unit.test.ts +1 -1
- package/src/utils/__tests__/sessionTracking.unit.test.ts +40 -29
- package/src/utils/__tests__/validationUtils.unit.test.ts +19 -6
- package/src/utils/{appIdResolver.test.ts → app/appIdResolver.test.ts} +28 -30
- package/src/utils/{appIdResolver.ts → app/appIdResolver.ts} +8 -5
- package/src/utils/{appNameResolver.test.ts → app/appNameResolver.test.ts} +1 -1
- package/src/utils/{appNameResolver.ts → app/appNameResolver.ts} +5 -1
- package/src/utils/{organisationContext.ts → context/organisationContext.ts} +6 -3
- package/src/utils/{sessionTracking.ts → context/sessionTracking.ts} +11 -12
- package/src/utils/{logger.ts → core/logger.ts} +4 -2
- package/src/utils/{deviceFingerprint.ts → device/deviceFingerprint.ts} +1 -1
- package/src/utils/{lazyLoad.tsx → dynamic/lazyLoad.tsx} +2 -2
- package/src/utils/{file-reference.test.ts → file-reference/__tests__/file-reference.test.ts} +5 -5
- package/src/utils/{file-reference.ts → file-reference/index.ts} +20 -38
- package/src/utils/index.ts +32 -54
- package/src/utils/{secureErrors.ts → security/secureErrors.ts} +6 -3
- package/src/utils/{security.ts → security/security.ts} +5 -2
- package/src/utils/storage/__tests__/helpers.unit.test.ts +1 -4
- package/src/utils/storage/helpers.ts +15 -8
- package/src/{components/Dialog/utils/__tests__/safeHtml.unit.test.ts → utils/validation/__tests__/htmlSanitization.unit.test.ts} +9 -15
- package/src/{validation → utils/validation}/csrf.ts +1 -1
- package/src/{components/Dialog/utils/safeHtml.ts → utils/validation/htmlSanitization.ts} +9 -10
- package/src/utils/validation/index.ts +79 -0
- package/src/utils/{sanitization.ts → validation/sanitization.ts} +71 -2
- package/src/{validation/schemaUtils.ts → utils/validation/schema.ts} +11 -6
- package/src/{validation → utils/validation}/sqlInjectionProtection.ts +2 -0
- package/src/utils/{validationUtils.ts → validation/validationUtils.ts} +4 -1
- package/src/validation/index.ts +3 -34
- package/dist/UnifiedAuthProvider-CQDZRJIS.js +0 -16
- package/dist/chunk-24MKLB7U.js +0 -81
- package/dist/chunk-24MKLB7U.js.map +0 -1
- package/dist/chunk-3CG5L6RN.js.map +0 -1
- package/dist/chunk-3DBFLLLU.js.map +0 -1
- package/dist/chunk-5F3NDPJV.js.map +0 -1
- package/dist/chunk-66C4BSAY.js.map +0 -1
- package/dist/chunk-BDZUMRBD.js.map +0 -1
- package/dist/chunk-BYXRHAIF.js.map +0 -1
- package/dist/chunk-CDQ3PX7L.js +0 -18
- package/dist/chunk-CDQ3PX7L.js.map +0 -1
- package/dist/chunk-CQZU6TFE.js.map +0 -1
- package/dist/chunk-F64FFPOZ.js.map +0 -1
- package/dist/chunk-GEVIB2UB.js.map +0 -1
- package/dist/chunk-GKHF54DI.js.map +0 -1
- package/dist/chunk-GVDR7WNV.js.map +0 -1
- package/dist/chunk-HMNOSGVA.js.map +0 -1
- package/dist/chunk-JCQZ6LA7.js.map +0 -1
- package/dist/chunk-M6DDYFUD.js.map +0 -1
- package/dist/chunk-O3NWNXDY.js.map +0 -1
- package/dist/chunk-PYUXFQJ3.js.map +0 -1
- package/dist/chunk-UJI6WSMD.js.map +0 -1
- package/dist/chunk-VZ5OR6HD.js.map +0 -1
- package/dist/chunk-WP5I5GLN.js.map +0 -1
- package/dist/chunk-ZYZCRSBD.js.map +0 -1
- package/src/components/Dialog/README.md +0 -804
- package/src/components/Form/FormErrorSummary.tsx +0 -113
- package/src/components/Form/FormFieldset.tsx +0 -127
- package/src/components/Form/FormLiveRegion.tsx +0 -198
- package/src/components/PasswordReset/PasswordResetForm.test.tsx +0 -597
- package/src/components/PasswordReset/PasswordResetForm.tsx +0 -201
- package/src/components/PublicLayout/PublicPageDebugger.tsx +0 -104
- package/src/components/PublicLayout/PublicPageDiagnostic.tsx +0 -162
- package/src/components/PublicLayout/__tests__/PublicPageDebugger.test.tsx +0 -185
- package/src/examples/CorrectPublicPageImplementation.tsx +0 -304
- package/src/examples/PublicEventPage.tsx +0 -287
- package/src/examples/PublicPageApp.tsx +0 -321
- package/src/examples/PublicPageUsageExample.tsx +0 -218
- package/src/utils/schemaUtils.ts +0 -37
- package/src/validation/__tests__/common.unit.test.ts +0 -101
- package/src/validation/__tests__/csrf.unit.test.ts +0 -365
- package/src/validation/__tests__/passwordSchema.unit.test.ts +0 -203
- package/src/validation/__tests__/sanitization.unit.test.ts +0 -250
- package/src/validation/__tests__/schemaUtils.unit.test.ts +0 -451
- package/src/validation/__tests__/sqlInjectionProtection.unit.test.ts +0 -462
- package/src/validation/__tests__/user.unit.test.ts +0 -440
- package/src/validation/sanitization.ts +0 -96
- /package/dist/{DataTable-A36PJG6N.js.map → DataTable-CYOHOX3O.js.map} +0 -0
- /package/dist/{UnifiedAuthProvider-CQDZRJIS.js.map → UnifiedAuthProvider-5E5TUNMS.js.map} +0 -0
- /package/dist/{api-TNIBJWLM.js.map → api-45XYYO2A.js.map} +0 -0
- /package/dist/{audit-T36HM7IM.js.map → audit-64X3VJXB.js.map} +0 -0
- /package/dist/{chunk-CTJRBUX2.js.map → chunk-2TWNJ46Y.js.map} +0 -0
- /package/dist/{chunk-ZV77RZMU.js.map → chunk-XARJS7CD.js.map} +0 -0
- /package/dist/{useInactivityTracker-MRUU55XI.js.map → useInactivityTracker-TO6ZOF35.js.map} +0 -0
- /package/examples/{public-pages → features/public-pages}/index.ts +0 -0
- /package/examples/{RBAC → features/rbac}/CompleteRBACExample.tsx +0 -0
- /package/examples/{RBAC → features/rbac}/EventBasedApp.tsx +0 -0
- /package/examples/{RBAC → features/rbac}/PermissionExample.tsx +0 -0
- /package/examples/{RBAC → features/rbac}/index.ts +0 -0
- /package/src/utils/{appConfig.ts → app/appConfig.ts} +0 -0
- /package/src/utils/{appNameResolver.simple.test.ts → app/appNameResolver.simple.test.ts} +0 -0
- /package/src/utils/{audit.ts → audit/audit.ts} +0 -0
- /package/src/utils/{organisationContext.test.ts → context/organisationContext.test.ts} +0 -0
- /package/src/utils/{cn.ts → core/cn.ts} +0 -0
- /package/src/utils/{debugLogger.ts → core/debugLogger.ts} +0 -0
- /package/src/utils/{dynamicUtils.ts → dynamic/dynamicUtils.ts} +0 -0
- /package/src/utils/{formatDate.test.ts → formatting/formatDate.test.ts} +0 -0
- /package/src/utils/{formatting.ts → formatting/formatting.ts} +0 -0
- /package/src/utils/{bundleAnalysis.ts → performance/bundleAnalysis.ts} +0 -0
- /package/src/utils/{performanceBenchmark.ts → performance/performanceBenchmark.ts} +0 -0
- /package/src/utils/{performanceBudgets.ts → performance/performanceBudgets.ts} +0 -0
- /package/src/utils/{permissionTypes.ts → permissions/permissionTypes.ts} +0 -0
- /package/src/utils/{permissionUtils.test.ts → permissions/permissionUtils.test.ts} +0 -0
- /package/src/utils/{permissionUtils.ts → permissions/permissionUtils.ts} +0 -0
- /package/src/utils/{auth-utils.ts → security/auth-utils.ts} +0 -0
- /package/src/utils/{secureDataAccess.test.ts → security/secureDataAccess.test.ts} +0 -0
- /package/src/utils/{secureDataAccess.ts → security/secureDataAccess.ts} +0 -0
- /package/src/utils/{secureStorage.ts → security/secureStorage.ts} +0 -0
- /package/src/utils/{securityMonitor.ts → security/securityMonitor.ts} +0 -0
- /package/src/{validation → utils/validation}/common.ts +0 -0
- /package/src/{validation → utils/validation}/passwordSchema.ts +0 -0
- /package/src/{validation → utils/validation}/user.ts +0 -0
- /package/src/utils/{validation.ts → validation/validation.ts} +0 -0
|
@@ -3,25 +3,30 @@ import {
|
|
|
3
3
|
useAccessLevel,
|
|
4
4
|
useCan,
|
|
5
5
|
useMultiplePermissions
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L6PGMCMD.js";
|
|
7
7
|
import {
|
|
8
8
|
OrganisationContextRequiredError,
|
|
9
9
|
RBACCache,
|
|
10
10
|
getRBACLogger,
|
|
11
11
|
rbacCache
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BVYWGZVV.js";
|
|
13
13
|
import {
|
|
14
14
|
useSecureDataAccess
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LTV3XIJJ.js";
|
|
16
16
|
import {
|
|
17
17
|
init_UnifiedAuthProvider
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-2TWNJ46Y.js";
|
|
19
19
|
import {
|
|
20
20
|
useUnifiedAuth
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-4MT5BGGL.js";
|
|
22
22
|
import {
|
|
23
23
|
getCurrentAppName
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Q5QRDWKI.js";
|
|
25
|
+
import {
|
|
26
|
+
createLogger,
|
|
27
|
+
init_logger,
|
|
28
|
+
logger
|
|
29
|
+
} from "./chunk-XDNLUEXI.js";
|
|
25
30
|
|
|
26
31
|
// src/rbac/secureClient.ts
|
|
27
32
|
import { createClient } from "@supabase/supabase-js";
|
|
@@ -152,8 +157,10 @@ function fromSupabaseClient(client, organisationId, eventId, appId) {
|
|
|
152
157
|
|
|
153
158
|
// src/rbac/components/PagePermissionProvider.tsx
|
|
154
159
|
init_UnifiedAuthProvider();
|
|
160
|
+
init_logger();
|
|
155
161
|
import { createContext, useContext, useState, useCallback, useMemo, useEffect } from "react";
|
|
156
162
|
import { jsx } from "react/jsx-runtime";
|
|
163
|
+
var log = createLogger("PagePermissionProvider");
|
|
157
164
|
var PagePermissionContext = createContext(null);
|
|
158
165
|
function PagePermissionProvider({
|
|
159
166
|
children,
|
|
@@ -233,7 +240,7 @@ function PagePermissionProvider({
|
|
|
233
240
|
]);
|
|
234
241
|
useEffect(() => {
|
|
235
242
|
if (strictMode && auditLog) {
|
|
236
|
-
|
|
243
|
+
log.debug("Strict mode enabled - all page access attempts will be logged and enforced");
|
|
237
244
|
}
|
|
238
245
|
}, [strictMode, auditLog]);
|
|
239
246
|
return /* @__PURE__ */ jsx(PagePermissionContext.Provider, { value: contextValue, children });
|
|
@@ -306,7 +313,8 @@ var PagePermissionGuardComponent = ({
|
|
|
306
313
|
return;
|
|
307
314
|
}
|
|
308
315
|
if (error2) {
|
|
309
|
-
|
|
316
|
+
const logger3 = getRBACLogger();
|
|
317
|
+
logger3.error("Database error resolving app ID:", error2);
|
|
310
318
|
if (signal.aborted) {
|
|
311
319
|
return;
|
|
312
320
|
}
|
|
@@ -315,23 +323,26 @@ var PagePermissionGuardComponent = ({
|
|
|
315
323
|
return;
|
|
316
324
|
}
|
|
317
325
|
if (inactiveApp) {
|
|
318
|
-
|
|
326
|
+
logger3.error(`App "${appName}" exists but is inactive (is_active: ${inactiveApp.is_active})`);
|
|
319
327
|
} else {
|
|
320
|
-
|
|
328
|
+
logger3.error(`App "${appName}" not found in rbac_apps table`);
|
|
321
329
|
}
|
|
322
330
|
} else if (app) {
|
|
323
331
|
appId = app.id;
|
|
324
332
|
} else {
|
|
325
|
-
|
|
333
|
+
const logger3 = getRBACLogger();
|
|
334
|
+
logger3.error("No app data returned for:", appName);
|
|
326
335
|
}
|
|
327
336
|
} catch (error2) {
|
|
328
337
|
if (signal.aborted) {
|
|
329
338
|
return;
|
|
330
339
|
}
|
|
331
|
-
|
|
340
|
+
const logger3 = getRBACLogger();
|
|
341
|
+
logger3.error("Unexpected error resolving app ID:", error2);
|
|
332
342
|
}
|
|
333
343
|
} else {
|
|
334
|
-
|
|
344
|
+
const logger3 = getRBACLogger();
|
|
345
|
+
logger3.error("No app name found. Make sure to call setRBACAppName() in your app setup.");
|
|
335
346
|
}
|
|
336
347
|
}
|
|
337
348
|
if (signal.aborted) {
|
|
@@ -339,10 +350,11 @@ var PagePermissionGuardComponent = ({
|
|
|
339
350
|
}
|
|
340
351
|
if (selectedOrganisation && selectedEvent) {
|
|
341
352
|
if (!appId) {
|
|
353
|
+
const logger3 = getRBACLogger();
|
|
342
354
|
if (import.meta.env.MODE === "test") {
|
|
343
|
-
|
|
355
|
+
logger3.warn("App ID not resolved in test environment, proceeding without it");
|
|
344
356
|
} else {
|
|
345
|
-
|
|
357
|
+
logger3.error("CRITICAL: App ID not resolved. Check console for details.");
|
|
346
358
|
safeSetCheckError(new Error("App ID not resolved. Check console for database errors."));
|
|
347
359
|
safeSetResolvedScope(null);
|
|
348
360
|
return;
|
|
@@ -351,7 +363,8 @@ var PagePermissionGuardComponent = ({
|
|
|
351
363
|
if (import.meta.env.MODE === "production" && appId) {
|
|
352
364
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
353
365
|
if (!uuidRegex.test(appId)) {
|
|
354
|
-
|
|
366
|
+
const logger3 = getRBACLogger();
|
|
367
|
+
logger3.error("CRITICAL: App ID is not a valid UUID:", appId);
|
|
355
368
|
safeSetCheckError(new Error(`Invalid app ID format: ${appId}. Expected UUID.`));
|
|
356
369
|
safeSetResolvedScope(null);
|
|
357
370
|
return;
|
|
@@ -371,10 +384,11 @@ var PagePermissionGuardComponent = ({
|
|
|
371
384
|
}
|
|
372
385
|
if (selectedOrganisation) {
|
|
373
386
|
if (!appId) {
|
|
387
|
+
const logger3 = getRBACLogger();
|
|
374
388
|
if (import.meta.env.MODE === "test") {
|
|
375
|
-
|
|
389
|
+
logger3.warn("App ID not resolved in test environment, proceeding without it");
|
|
376
390
|
} else {
|
|
377
|
-
|
|
391
|
+
logger3.error("CRITICAL: App ID not resolved. Check console for details.");
|
|
378
392
|
safeSetCheckError(new Error("App ID not resolved. Check console for database errors."));
|
|
379
393
|
safeSetResolvedScope(null);
|
|
380
394
|
return;
|
|
@@ -383,7 +397,8 @@ var PagePermissionGuardComponent = ({
|
|
|
383
397
|
if (import.meta.env.MODE === "production" && appId) {
|
|
384
398
|
const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
385
399
|
if (!uuidRegex.test(appId)) {
|
|
386
|
-
|
|
400
|
+
const logger3 = getRBACLogger();
|
|
401
|
+
logger3.error("CRITICAL: App ID is not a valid UUID:", appId);
|
|
387
402
|
safeSetCheckError(new Error(`Invalid app ID format: ${appId}. Expected UUID.`));
|
|
388
403
|
safeSetResolvedScope(null);
|
|
389
404
|
return;
|
|
@@ -430,7 +445,8 @@ var PagePermissionGuardComponent = ({
|
|
|
430
445
|
return;
|
|
431
446
|
}
|
|
432
447
|
const errorMessage = !selectedOrganisation && !selectedEvent ? "Either organisation context or event context is required for page permission checking" : "Insufficient context for permission checking. Please ensure you are properly authenticated and have selected an organisation or event.";
|
|
433
|
-
|
|
448
|
+
const logger2 = getRBACLogger();
|
|
449
|
+
logger2.error("Context resolution failed:", {
|
|
434
450
|
selectedOrganisation: selectedOrganisation ? selectedOrganisation.id : null,
|
|
435
451
|
selectedEvent: selectedEvent ? selectedEvent.event_id : null,
|
|
436
452
|
appId,
|
|
@@ -487,7 +503,8 @@ var PagePermissionGuardComponent = ({
|
|
|
487
503
|
}, [can, isLoading, error, pageName, operation, onDenied]);
|
|
488
504
|
useEffect2(() => {
|
|
489
505
|
if (auditLog && hasChecked && !isLoading) {
|
|
490
|
-
|
|
506
|
+
const rbacLogger = getRBACLogger();
|
|
507
|
+
rbacLogger.debug("Page access attempt:", {
|
|
491
508
|
pageName,
|
|
492
509
|
operation,
|
|
493
510
|
userId: user?.id,
|
|
@@ -499,7 +516,8 @@ var PagePermissionGuardComponent = ({
|
|
|
499
516
|
}, [auditLog, hasChecked, isLoading, pageName, operation, user?.id, resolvedScope, can]);
|
|
500
517
|
useEffect2(() => {
|
|
501
518
|
if (strictMode && hasChecked && !isLoading && !can) {
|
|
502
|
-
|
|
519
|
+
const logger2 = getRBACLogger();
|
|
520
|
+
logger2.error(`STRICT MODE VIOLATION: User attempted to access protected page without permission`, {
|
|
503
521
|
pageName,
|
|
504
522
|
operation,
|
|
505
523
|
permission: `${operation}:page.${pageName}`,
|
|
@@ -609,7 +627,8 @@ function SecureDataProvider({
|
|
|
609
627
|
try {
|
|
610
628
|
validateContext();
|
|
611
629
|
} catch (error) {
|
|
612
|
-
|
|
630
|
+
const logger2 = getRBACLogger();
|
|
631
|
+
logger2.error("Organisation context validation failed:", error);
|
|
613
632
|
return false;
|
|
614
633
|
}
|
|
615
634
|
return isDataAccessAllowed(table, operation, effectiveScope);
|
|
@@ -658,12 +677,14 @@ function SecureDataProvider({
|
|
|
658
677
|
]);
|
|
659
678
|
useEffect3(() => {
|
|
660
679
|
if (strictMode && auditLog) {
|
|
661
|
-
|
|
680
|
+
const logger2 = getRBACLogger();
|
|
681
|
+
logger2.debug("Strict mode enabled - all data access attempts will be logged and enforced");
|
|
662
682
|
}
|
|
663
683
|
}, [strictMode, auditLog]);
|
|
664
684
|
useEffect3(() => {
|
|
665
685
|
if (enforceRLS && auditLog) {
|
|
666
|
-
|
|
686
|
+
const logger2 = getRBACLogger();
|
|
687
|
+
logger2.debug("RLS enforcement enabled - all queries will include organisation context");
|
|
667
688
|
}
|
|
668
689
|
}, [enforceRLS, auditLog]);
|
|
669
690
|
return /* @__PURE__ */ jsx3(SecureDataContext.Provider, { value: contextValue, children });
|
|
@@ -679,7 +700,9 @@ function useSecureData() {
|
|
|
679
700
|
// src/rbac/components/PermissionEnforcer.tsx
|
|
680
701
|
import { useMemo as useMemo4, useEffect as useEffect4, useState as useState4 } from "react";
|
|
681
702
|
init_UnifiedAuthProvider();
|
|
703
|
+
init_logger();
|
|
682
704
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
705
|
+
var log2 = createLogger("PermissionEnforcer");
|
|
683
706
|
function PermissionEnforcer({
|
|
684
707
|
permissions,
|
|
685
708
|
operation,
|
|
@@ -767,7 +790,7 @@ function PermissionEnforcer({
|
|
|
767
790
|
}, [hasRequiredPermissions, isLoading, error, permissions, operation, onDenied]);
|
|
768
791
|
useEffect4(() => {
|
|
769
792
|
if (auditLog && hasChecked && !isLoading) {
|
|
770
|
-
|
|
793
|
+
log2.debug("Permission check attempt:", {
|
|
771
794
|
permissions,
|
|
772
795
|
operation,
|
|
773
796
|
userId: user?.id,
|
|
@@ -780,7 +803,8 @@ function PermissionEnforcer({
|
|
|
780
803
|
}, [auditLog, hasChecked, isLoading, permissions, operation, user?.id, resolvedScope, hasRequiredPermissions, requireAll]);
|
|
781
804
|
useEffect4(() => {
|
|
782
805
|
if (strictMode && hasChecked && !isLoading && !hasRequiredPermissions) {
|
|
783
|
-
|
|
806
|
+
const logger2 = getRBACLogger();
|
|
807
|
+
logger2.error(`STRICT MODE VIOLATION: User attempted to perform operation without permission`, {
|
|
784
808
|
permissions,
|
|
785
809
|
operation,
|
|
786
810
|
userId: user?.id,
|
|
@@ -794,7 +818,8 @@ function PermissionEnforcer({
|
|
|
794
818
|
return /* @__PURE__ */ jsx4(Fragment2, { children: loading });
|
|
795
819
|
}
|
|
796
820
|
if (checkError) {
|
|
797
|
-
|
|
821
|
+
const logger2 = getRBACLogger();
|
|
822
|
+
logger2.error(`Permission check failed for operation ${operation}:`, checkError);
|
|
798
823
|
return /* @__PURE__ */ jsx4(Fragment2, { children: fallback });
|
|
799
824
|
}
|
|
800
825
|
if (!hasRequiredPermissions) {
|
|
@@ -916,7 +941,8 @@ function RoleBasedRouter({
|
|
|
916
941
|
setCurrentRoute(currentPath);
|
|
917
942
|
if (!currentRouteConfig) {
|
|
918
943
|
if (strictMode) {
|
|
919
|
-
|
|
944
|
+
const logger2 = getRBACLogger();
|
|
945
|
+
logger2.error(`STRICT MODE VIOLATION: Route not found in configuration`, {
|
|
920
946
|
route: currentPath,
|
|
921
947
|
userId: user?.id,
|
|
922
948
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -1010,6 +1036,7 @@ function DefaultUnauthorizedComponent({ route, reason }) {
|
|
|
1010
1036
|
// src/rbac/components/NavigationProvider.tsx
|
|
1011
1037
|
init_UnifiedAuthProvider();
|
|
1012
1038
|
import { createContext as createContext4, useContext as useContext4, useState as useState6, useCallback as useCallback6, useMemo as useMemo6, useEffect as useEffect6 } from "react";
|
|
1039
|
+
init_logger();
|
|
1013
1040
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
1014
1041
|
var NavigationContext = createContext4(null);
|
|
1015
1042
|
function NavigationProvider({
|
|
@@ -1036,7 +1063,7 @@ function NavigationProvider({
|
|
|
1036
1063
|
if (!user?.id) return false;
|
|
1037
1064
|
if (!currentScope) return false;
|
|
1038
1065
|
if (!item.permissions || item.permissions.length === 0) {
|
|
1039
|
-
|
|
1066
|
+
logger.warn("NavigationProvider", `Navigation item "${item.id}" has no permissions defined - denying access`);
|
|
1040
1067
|
return false;
|
|
1041
1068
|
}
|
|
1042
1069
|
const permission = item.permissions[0];
|
|
@@ -1049,7 +1076,7 @@ function NavigationProvider({
|
|
|
1049
1076
|
// useCache
|
|
1050
1077
|
);
|
|
1051
1078
|
if (error) {
|
|
1052
|
-
|
|
1079
|
+
logger.warn("NavigationProvider", `Permission check error for "${item.id}": ${error.message} - allowing access for graceful degradation`);
|
|
1053
1080
|
return true;
|
|
1054
1081
|
}
|
|
1055
1082
|
return can;
|
|
@@ -1113,7 +1140,8 @@ function NavigationProvider({
|
|
|
1113
1140
|
]);
|
|
1114
1141
|
useEffect6(() => {
|
|
1115
1142
|
if (strictMode && auditLog) {
|
|
1116
|
-
|
|
1143
|
+
const logger2 = getRBACLogger();
|
|
1144
|
+
logger2.debug("Strict mode enabled - all navigation access attempts will be logged and enforced");
|
|
1117
1145
|
}
|
|
1118
1146
|
}, [strictMode, auditLog]);
|
|
1119
1147
|
return /* @__PURE__ */ jsx6(NavigationContext.Provider, { value: contextValue, children });
|
|
@@ -1213,7 +1241,8 @@ function NavigationGuard({
|
|
|
1213
1241
|
}, [hasRequiredPermissions, isLoading, error, navigationItem, onDenied]);
|
|
1214
1242
|
useEffect7(() => {
|
|
1215
1243
|
if (auditLog && hasChecked && !isLoading) {
|
|
1216
|
-
|
|
1244
|
+
const logger2 = getRBACLogger();
|
|
1245
|
+
logger2.debug("Navigation access attempt:", {
|
|
1217
1246
|
navigationItem: navigationItem.id,
|
|
1218
1247
|
permissions: navigationItem.permissions,
|
|
1219
1248
|
userId: user?.id,
|
|
@@ -1226,7 +1255,8 @@ function NavigationGuard({
|
|
|
1226
1255
|
}, [auditLog, hasChecked, isLoading, navigationItem, user?.id, resolvedScope, hasRequiredPermissions, requireAll]);
|
|
1227
1256
|
useEffect7(() => {
|
|
1228
1257
|
if (strictMode && hasChecked && !isLoading && !hasRequiredPermissions) {
|
|
1229
|
-
|
|
1258
|
+
const logger2 = getRBACLogger();
|
|
1259
|
+
logger2.error(`STRICT MODE VIOLATION: User attempted to access protected navigation item without permission`, {
|
|
1230
1260
|
navigationItem: navigationItem.id,
|
|
1231
1261
|
permissions: navigationItem.permissions,
|
|
1232
1262
|
userId: user?.id,
|
|
@@ -1240,7 +1270,8 @@ function NavigationGuard({
|
|
|
1240
1270
|
return /* @__PURE__ */ jsx7(Fragment3, { children: loading });
|
|
1241
1271
|
}
|
|
1242
1272
|
if (checkError) {
|
|
1243
|
-
|
|
1273
|
+
const logger2 = getRBACLogger();
|
|
1274
|
+
logger2.error(`Permission check failed for navigation item ${navigationItem.id}:`, checkError);
|
|
1244
1275
|
return /* @__PURE__ */ jsx7(Fragment3, { children: fallback });
|
|
1245
1276
|
}
|
|
1246
1277
|
if (!hasRequiredPermissions) {
|
|
@@ -1297,7 +1328,8 @@ function EnhancedNavigationMenu({
|
|
|
1297
1328
|
onNavigationAccess(item, allowed);
|
|
1298
1329
|
}
|
|
1299
1330
|
if (auditLog) {
|
|
1300
|
-
|
|
1331
|
+
const logger2 = getRBACLogger();
|
|
1332
|
+
logger2.debug("Navigation access attempt:", {
|
|
1301
1333
|
item: item.id,
|
|
1302
1334
|
allowed,
|
|
1303
1335
|
strictMode,
|
|
@@ -1310,7 +1342,8 @@ function EnhancedNavigationMenu({
|
|
|
1310
1342
|
onStrictModeViolation(item);
|
|
1311
1343
|
}
|
|
1312
1344
|
if (strictMode) {
|
|
1313
|
-
|
|
1345
|
+
const logger2 = getRBACLogger();
|
|
1346
|
+
logger2.error(`STRICT MODE VIOLATION: User attempted to access protected navigation item without permission`, {
|
|
1314
1347
|
item: item.id,
|
|
1315
1348
|
path: item.path,
|
|
1316
1349
|
permissions: item.permissions,
|
|
@@ -1325,7 +1358,8 @@ function EnhancedNavigationMenu({
|
|
|
1325
1358
|
onItemClick(item);
|
|
1326
1359
|
}
|
|
1327
1360
|
if (auditLog) {
|
|
1328
|
-
|
|
1361
|
+
const logger2 = getRBACLogger();
|
|
1362
|
+
logger2.debug("Navigation item clicked:", {
|
|
1329
1363
|
item: item.id,
|
|
1330
1364
|
path: item.path,
|
|
1331
1365
|
permissions: item.permissions,
|
|
@@ -1381,12 +1415,14 @@ function EnhancedNavigationMenu({
|
|
|
1381
1415
|
]);
|
|
1382
1416
|
useEffect8(() => {
|
|
1383
1417
|
if (strictMode && auditLog) {
|
|
1384
|
-
|
|
1418
|
+
const logger2 = getRBACLogger();
|
|
1419
|
+
logger2.debug("Strict mode enabled - all navigation access attempts will be logged and enforced");
|
|
1385
1420
|
}
|
|
1386
1421
|
}, [strictMode, auditLog]);
|
|
1387
1422
|
useEffect8(() => {
|
|
1388
1423
|
if (auditLog) {
|
|
1389
|
-
|
|
1424
|
+
const logger2 = getRBACLogger();
|
|
1425
|
+
logger2.debug("Navigation menu initialized:", {
|
|
1390
1426
|
totalItems: items.length,
|
|
1391
1427
|
filteredItems: filteredItems.length,
|
|
1392
1428
|
strictMode,
|
|
@@ -1420,7 +1456,7 @@ function PermissionGuard({
|
|
|
1420
1456
|
auditLog = true,
|
|
1421
1457
|
enforceAudit = true
|
|
1422
1458
|
}) {
|
|
1423
|
-
const
|
|
1459
|
+
const logger2 = getRBACLogger();
|
|
1424
1460
|
let authContext = null;
|
|
1425
1461
|
try {
|
|
1426
1462
|
authContext = useUnifiedAuth();
|
|
@@ -1434,16 +1470,16 @@ function PermissionGuard({
|
|
|
1434
1470
|
const effectiveUserId = userId ?? authContext?.user?.id ?? null;
|
|
1435
1471
|
const { can, isLoading, error } = useCan(effectiveUserId || "", scope, permission, pageId);
|
|
1436
1472
|
if (!effectiveUserId) {
|
|
1437
|
-
|
|
1473
|
+
logger2.error("PermissionGuard: No userId provided and could not infer from context");
|
|
1438
1474
|
return fallback ?? null;
|
|
1439
1475
|
}
|
|
1440
1476
|
if (isLoading) {
|
|
1441
1477
|
return loading || /* @__PURE__ */ jsx9("div", { className: "rbac-loading", role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Checking permissions..." }) });
|
|
1442
1478
|
}
|
|
1443
1479
|
if (error) {
|
|
1444
|
-
|
|
1480
|
+
logger2.error("Permission check failed:", error);
|
|
1445
1481
|
if (auditLog) {
|
|
1446
|
-
|
|
1482
|
+
logger2.info(`[PermissionGuard] Permission check failed:`, {
|
|
1447
1483
|
userId: effectiveUserId,
|
|
1448
1484
|
scope,
|
|
1449
1485
|
permission,
|
|
@@ -1456,7 +1492,7 @@ function PermissionGuard({
|
|
|
1456
1492
|
}
|
|
1457
1493
|
if (!can) {
|
|
1458
1494
|
if (auditLog) {
|
|
1459
|
-
|
|
1495
|
+
logger2.info(`[PermissionGuard] Permission denied:`, {
|
|
1460
1496
|
userId: effectiveUserId,
|
|
1461
1497
|
scope,
|
|
1462
1498
|
permission,
|
|
@@ -1465,7 +1501,7 @@ function PermissionGuard({
|
|
|
1465
1501
|
});
|
|
1466
1502
|
}
|
|
1467
1503
|
if (strictMode) {
|
|
1468
|
-
|
|
1504
|
+
logger2.error(`[PermissionGuard] STRICT MODE VIOLATION: User attempted to access protected resource without permission`, {
|
|
1469
1505
|
userId: effectiveUserId,
|
|
1470
1506
|
scope,
|
|
1471
1507
|
permission,
|
|
@@ -1479,7 +1515,7 @@ function PermissionGuard({
|
|
|
1479
1515
|
return /* @__PURE__ */ jsx9(Fragment4, { children: fallback });
|
|
1480
1516
|
}
|
|
1481
1517
|
if (auditLog) {
|
|
1482
|
-
|
|
1518
|
+
logger2.info(`[PermissionGuard] Permission granted:`, {
|
|
1483
1519
|
userId: effectiveUserId,
|
|
1484
1520
|
scope,
|
|
1485
1521
|
permission,
|
|
@@ -1497,7 +1533,7 @@ function AccessLevelGuard({
|
|
|
1497
1533
|
fallback = null,
|
|
1498
1534
|
loading = null
|
|
1499
1535
|
}) {
|
|
1500
|
-
const
|
|
1536
|
+
const logger2 = getRBACLogger();
|
|
1501
1537
|
let authContext = null;
|
|
1502
1538
|
try {
|
|
1503
1539
|
authContext = useUnifiedAuth();
|
|
@@ -1511,14 +1547,14 @@ function AccessLevelGuard({
|
|
|
1511
1547
|
const effectiveUserId = userId ?? authContext?.user?.id ?? null;
|
|
1512
1548
|
const { accessLevel, isLoading, error } = useAccessLevel(effectiveUserId || "", scope);
|
|
1513
1549
|
if (!effectiveUserId) {
|
|
1514
|
-
|
|
1550
|
+
logger2.error("AccessLevelGuard: No userId provided and could not infer from context");
|
|
1515
1551
|
return fallback ?? null;
|
|
1516
1552
|
}
|
|
1517
1553
|
if (isLoading) {
|
|
1518
1554
|
return loading || /* @__PURE__ */ jsx9("div", { className: "rbac-loading", role: "status", "aria-live": "polite", children: /* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Checking access level..." }) });
|
|
1519
1555
|
}
|
|
1520
1556
|
if (error) {
|
|
1521
|
-
|
|
1557
|
+
logger2.error("Access level check failed:", error);
|
|
1522
1558
|
return fallback;
|
|
1523
1559
|
}
|
|
1524
1560
|
const levelHierarchy = ["viewer", "participant", "planner", "admin", "super"];
|
|
@@ -1539,7 +1575,7 @@ function withPermissionGuard(config, handler) {
|
|
|
1539
1575
|
if (!userId || !organisationId) {
|
|
1540
1576
|
throw new Error("User context required for permission check");
|
|
1541
1577
|
}
|
|
1542
|
-
const { isPermitted: isPermitted2 } = await import("./api-
|
|
1578
|
+
const { isPermitted: isPermitted2 } = await import("./api-45XYYO2A.js");
|
|
1543
1579
|
const hasPermission2 = await isPermitted2({
|
|
1544
1580
|
userId,
|
|
1545
1581
|
scope: { organisationId, eventId, appId },
|
|
@@ -1562,7 +1598,7 @@ function withAccessLevelGuard(minLevel, handler) {
|
|
|
1562
1598
|
if (!userId || !organisationId) {
|
|
1563
1599
|
throw new Error("User context required for access level check");
|
|
1564
1600
|
}
|
|
1565
|
-
const { getAccessLevel: getAccessLevel2 } = await import("./api-
|
|
1601
|
+
const { getAccessLevel: getAccessLevel2 } = await import("./api-45XYYO2A.js");
|
|
1566
1602
|
const accessLevel = await getAccessLevel2({
|
|
1567
1603
|
userId,
|
|
1568
1604
|
scope: { organisationId, eventId, appId }
|
|
@@ -1587,11 +1623,11 @@ function withRoleGuard(config, handler) {
|
|
|
1587
1623
|
throw new Error("User context required for role check");
|
|
1588
1624
|
}
|
|
1589
1625
|
if (config.globalRoles && config.globalRoles.length > 0) {
|
|
1590
|
-
const { isSuperAdmin } = await import("./api-
|
|
1626
|
+
const { isSuperAdmin } = await import("./api-45XYYO2A.js");
|
|
1591
1627
|
const isSuper = await isSuperAdmin(userId);
|
|
1592
1628
|
if (isSuper) {
|
|
1593
1629
|
if (organisationId) {
|
|
1594
|
-
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-
|
|
1630
|
+
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-64X3VJXB.js");
|
|
1595
1631
|
await emitAuditEvent2({
|
|
1596
1632
|
type: "permission_check",
|
|
1597
1633
|
userId,
|
|
@@ -1613,21 +1649,21 @@ function withRoleGuard(config, handler) {
|
|
|
1613
1649
|
}
|
|
1614
1650
|
}
|
|
1615
1651
|
if (config.organisationRoles && config.organisationRoles.length > 0) {
|
|
1616
|
-
const { isOrganisationAdmin } = await import("./api-
|
|
1652
|
+
const { isOrganisationAdmin } = await import("./api-45XYYO2A.js");
|
|
1617
1653
|
const isOrgAdmin = await isOrganisationAdmin(userId, organisationId);
|
|
1618
1654
|
if (!isOrgAdmin && config.requireAll !== false) {
|
|
1619
1655
|
throw new Error(`Organisation admin role required`);
|
|
1620
1656
|
}
|
|
1621
1657
|
}
|
|
1622
1658
|
if (config.eventAppRoles && config.eventAppRoles.length > 0 && eventId && appId) {
|
|
1623
|
-
const { isEventAdmin } = await import("./api-
|
|
1659
|
+
const { isEventAdmin } = await import("./api-45XYYO2A.js");
|
|
1624
1660
|
const isEventAdminUser = await isEventAdmin(userId, { organisationId, eventId, appId });
|
|
1625
1661
|
if (!isEventAdminUser && config.requireAll !== false) {
|
|
1626
1662
|
throw new Error(`Event admin role required`);
|
|
1627
1663
|
}
|
|
1628
1664
|
}
|
|
1629
1665
|
if (organisationId) {
|
|
1630
|
-
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-
|
|
1666
|
+
const { emitAuditEvent: emitAuditEvent2 } = await import("./audit-64X3VJXB.js");
|
|
1631
1667
|
await emitAuditEvent2({
|
|
1632
1668
|
type: "permission_check",
|
|
1633
1669
|
userId,
|
|
@@ -1660,7 +1696,7 @@ function createRBACMiddleware(config) {
|
|
|
1660
1696
|
);
|
|
1661
1697
|
if (protectedRoute) {
|
|
1662
1698
|
try {
|
|
1663
|
-
const { isPermitted: isPermitted2 } = await import("./api-
|
|
1699
|
+
const { isPermitted: isPermitted2 } = await import("./api-45XYYO2A.js");
|
|
1664
1700
|
const hasPermission2 = await isPermitted2({
|
|
1665
1701
|
userId,
|
|
1666
1702
|
scope: { organisationId },
|
|
@@ -1687,7 +1723,7 @@ function createRBACExpressMiddleware(config) {
|
|
|
1687
1723
|
return res.status(401).json({ error: "User context required" });
|
|
1688
1724
|
}
|
|
1689
1725
|
try {
|
|
1690
|
-
const { isPermitted: isPermitted2 } = await import("./api-
|
|
1726
|
+
const { isPermitted: isPermitted2 } = await import("./api-45XYYO2A.js");
|
|
1691
1727
|
const hasPermission2 = await isPermitted2({
|
|
1692
1728
|
userId,
|
|
1693
1729
|
scope: { organisationId, eventId, appId },
|
|
@@ -1719,6 +1755,8 @@ function hasAnyPermissionCached(userId, scope, permissions, pageId) {
|
|
|
1719
1755
|
}
|
|
1720
1756
|
|
|
1721
1757
|
// src/rbac/permissions.ts
|
|
1758
|
+
init_logger();
|
|
1759
|
+
var log3 = createLogger("RBACPermissions");
|
|
1722
1760
|
var GLOBAL_PERMISSIONS = {
|
|
1723
1761
|
READ_ALL: "read:*",
|
|
1724
1762
|
CREATE_ALL: "create:*",
|
|
@@ -1815,8 +1853,8 @@ function isValidPermission(permission) {
|
|
|
1815
1853
|
return pattern.test(permission);
|
|
1816
1854
|
}
|
|
1817
1855
|
function getPermissionsForRole(role) {
|
|
1818
|
-
|
|
1819
|
-
`
|
|
1856
|
+
log3.warn(
|
|
1857
|
+
`getPermissionsForRole() is deprecated. Permissions must be queried from rbac_page_permissions table. Called with role: ${role}`
|
|
1820
1858
|
);
|
|
1821
1859
|
return [];
|
|
1822
1860
|
}
|
|
@@ -1860,4 +1898,4 @@ export {
|
|
|
1860
1898
|
getPermissionsForRole,
|
|
1861
1899
|
ALL_PERMISSIONS
|
|
1862
1900
|
};
|
|
1863
|
-
//# sourceMappingURL=chunk-
|
|
1901
|
+
//# sourceMappingURL=chunk-FHWWBIHA.js.map
|