@oneuptime/common 13.0.8 → 14.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/AnalyticsModels/AuditLog.ts +23 -15
- package/Models/DatabaseModels/GlobalConfig.ts +24 -0
- package/Models/DatabaseModels/Index.ts +4 -0
- package/Models/DatabaseModels/Monitor.ts +3 -2
- package/Models/DatabaseModels/MonitorTemplate.ts +2 -1
- package/Models/DatabaseModels/ServiceLevelObjectiveFeed.ts +2 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveLabelRule.ts +522 -0
- package/Models/DatabaseModels/ServiceLevelObjectiveMonitorRule.ts +38 -4
- package/Models/DatabaseModels/ServiceLevelObjectiveOwnerRule.ts +603 -0
- package/Scripts/generate-service-worker.js +65 -4
- package/Server/API/BaseAPI.ts +26 -5
- package/Server/API/GlobalConfigAPI.ts +228 -462
- package/Server/API/ProjectOIDC.ts +25 -16
- package/Server/API/ProjectSSO.ts +24 -16
- package/Server/API/StatusPageAPI.ts +100 -42
- package/Server/API/TeamMemberAPI.ts +10 -1
- package/Server/Enterprise/EnterpriseEdition.ts +649 -0
- package/Server/Enterprise/EnterpriseFeature.ts +48 -0
- package/Server/Enterprise/EnterpriseLicenseSnapshot.ts +192 -0
- package/Server/Enterprise/EnterpriseServerModule.ts +233 -0
- package/Server/EnvironmentConfig.ts +147 -2
- package/Server/Infrastructure/Postgres/SchemaMigrations/1793900000000-AddEnterpriseEditionFirstSeenAt.ts +25 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794100000000-AddSloLabelAndOwnerRules.ts +248 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1794200000000-AddSloMonitorRuleMonitorType.ts +19 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +6 -0
- package/Server/Middleware/UserAuthorization.ts +38 -16
- package/Server/Services/AuditLogService.ts +84 -1079
- package/Server/Services/DatabaseService.ts +10 -0
- package/Server/Services/EnterpriseLicenseService.ts +38 -0
- package/Server/Services/GlobalConfigService.ts +80 -1
- package/Server/Services/Index.ts +4 -0
- package/Server/Services/MonitorProbeService.ts +116 -20
- package/Server/Services/MonitorService.ts +59 -6
- package/Server/Services/MonitorStatusTimelineService.ts +284 -0
- package/Server/Services/MonitorTemplateService.ts +26 -0
- package/Server/Services/ProjectService.ts +284 -0
- package/Server/Services/RumSessionPinService.ts +25 -6
- package/Server/Services/ServiceLevelObjectiveLabelRuleEngineService.ts +385 -0
- package/Server/Services/ServiceLevelObjectiveLabelRuleService.ts +51 -0
- package/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.ts +92 -16
- package/Server/Services/ServiceLevelObjectiveMonitorRuleService.ts +36 -1
- package/Server/Services/ServiceLevelObjectiveOwnerRuleEngineService.ts +521 -0
- package/Server/Services/ServiceLevelObjectiveOwnerRuleService.ts +51 -0
- package/Server/Services/ServiceLevelObjectiveService.ts +28 -0
- package/Server/Services/StatusPagePrivateUserService.ts +7 -3
- package/Server/Services/StatusPageService.ts +78 -1
- package/Server/Services/TeamMemberService.ts +11 -0
- package/Server/Services/TeamService.ts +10 -0
- package/Server/Services/UserService.ts +10 -17
- package/Server/Types/Database/Permissions/CreatePermission.ts +15 -0
- package/Server/Types/Database/Permissions/EditionPermission.ts +208 -18
- package/Server/Types/Database/Permissions/TablePermission.ts +10 -3
- package/Server/Types/Database/Permissions/UpdatePermission.ts +29 -0
- package/Server/Types/Markdown.ts +41 -0
- package/Server/Types/Workflow/Components/Telegram/SendMessageToChat.ts +27 -1
- package/Server/Utils/AI/Toolbox/SloTools.ts +1 -0
- package/Server/Utils/CommunityEditionSsoReport.ts +361 -0
- package/Server/Utils/EditionEnforcement.ts +233 -0
- package/Server/Utils/FrontendEnvironment.ts +41 -2
- package/Server/Utils/InstanceHealth/RedisHealth.ts +12 -277
- package/Server/Utils/Monitor/AffectedResourceList.ts +148 -0
- package/Server/Utils/Monitor/Criteria/CompareCriteria.ts +1 -1
- package/Server/Utils/Monitor/Criteria/EvaluateOverTime.ts +10 -1
- package/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.ts +1 -1
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +720 -465
- package/Server/Utils/Monitor/MonitoringIntervalValidator.ts +116 -0
- package/Server/Utils/Monitor/RootCauseList.ts +139 -0
- package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +28 -0
- package/Server/Utils/Slo/SloRulePatternValidator.ts +42 -0
- package/Server/Utils/Workspace/Slack/Slack.ts +423 -10
- package/Tests/App/Accounts/LoginPasskey.test.tsx +18 -0
- package/Tests/App/Accounts/LoginSsoEdition.test.tsx +616 -0
- package/Tests/App/AdminDashboard/AdminAuthenticationSsoEdition.test.tsx +217 -0
- package/Tests/App/AdminDashboard/AdminEnterprisePluginPage.test.tsx +357 -0
- package/Tests/App/AdminDashboard/EnterpriseLicensesShell.test.tsx +214 -0
- package/Tests/App/AdminDashboard/GlobalSSOEnterpriseShells.test.tsx +271 -0
- package/Tests/App/AdminDashboard/HealthShells.test.tsx +659 -0
- package/Tests/App/Dashboard/AuditLogsAndComplianceShells.test.tsx +572 -0
- package/Tests/App/Dashboard/EnterpriseFeatureUpgrade.test.tsx +547 -0
- package/Tests/App/Dashboard/EnterprisePluginPage.test.tsx +667 -0
- package/Tests/App/Dashboard/FeedFilterSortIntegration.test.tsx +1632 -0
- package/Tests/App/Dashboard/FeedOptionsLocales.test.ts +250 -0
- package/Tests/App/Dashboard/FeedOrdering.test.ts +279 -9
- package/Tests/App/Dashboard/IdentityEnterpriseShells.test.tsx +319 -0
- package/Tests/App/Dashboard/InvestigationFeedRefresh.test.tsx +60 -1
- package/Tests/App/Dashboard/InvestigationPanel.test.tsx +594 -3
- package/Tests/App/Dashboard/OnboardingSsoEmptyState.test.tsx +185 -0
- package/Tests/App/Dashboard/ProductOrientation.test.tsx +646 -0
- package/Tests/App/Dashboard/ResourceFeed.test.tsx +612 -2
- package/Tests/App/Dashboard/ResourceFeedPageWiring.test.ts +30 -0
- package/Tests/App/Dashboard/ResourceFeedPagesFilterSort.test.tsx +1202 -0
- package/Tests/App/Dashboard/ScheduledMaintenanceFeedRefresh.test.tsx +52 -1
- package/Tests/App/Dashboard/SecurityEventConnectionDiagnostics.test.tsx +45 -9
- package/Tests/App/Dashboard/SecurityEventDetailPanel.test.tsx +399 -0
- package/Tests/App/Dashboard/SecurityEventListRow.test.tsx +214 -0
- package/Tests/App/Dashboard/SecurityEventsEmptyState.test.tsx +1 -83
- package/Tests/App/Dashboard/SecurityEventsNavTabs.test.tsx +248 -0
- package/Tests/App/Dashboard/SecurityEventsViewer.test.tsx +1203 -0
- package/Tests/App/Dashboard/SloFeed.test.tsx +106 -1
- package/Tests/App/Dashboard/SloMonitorRuleCriteria.test.tsx +566 -0
- package/Tests/App/Dashboard/SloNavigationWiring.test.tsx +6 -4
- package/Tests/App/Dashboard/SloNoticeBanner.test.tsx +186 -0
- package/Tests/App/Dashboard/SloOverviewKpiStrip.test.tsx +388 -44
- package/Tests/App/Dashboard/SloOverviewLayout.test.tsx +613 -0
- package/Tests/App/Dashboard/UserEmailCallSites.test.tsx +11 -91
- package/Tests/App/StatusPage/StatusPageSsoEmptyState.test.tsx +319 -0
- package/Tests/Helpers/RefreshAwareApiScan.ts +757 -0
- package/Tests/Helpers/TenantScopedRequestScan.ts +515 -0
- package/Tests/Models/DatabaseModels/ResourceFeedModels.test.ts +0 -8
- package/Tests/Models/DatabaseModels/SloLabelAndOwnerRuleModels.test.ts +404 -0
- package/Tests/Models/DatabaseModels/SloOverhaulModels.test.ts +17 -1
- package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
- package/Tests/Scripts/GenerateServiceWorker.test.ts +931 -0
- package/Tests/Server/API/BaseAPICreateItemDoesNotMutateModel.test.ts +130 -0
- package/Tests/Server/API/GlobalConfigLicense.test.ts +742 -497
- package/Tests/Server/API/OnCallReadinessAPI.test.ts +35 -909
- package/Tests/Server/API/SsoProviderListingsEdition.test.ts +432 -0
- package/Tests/Server/API/TeamMemberLeaveScimLockEdition.test.ts +252 -0
- package/Tests/Server/Enterprise/EnterpriseEdition.test.ts +824 -0
- package/Tests/Server/Enterprise/EnterpriseFeatureActive.test.ts +643 -0
- package/Tests/Server/Enterprise/EnterpriseLicenseSnapshot.test.ts +294 -0
- package/Tests/Server/Enterprise/EnterpriseModelFeatureMap.test.ts +93 -0
- package/Tests/Server/Enterprise/EnterpriseOnlyModulesLiveInEe.test.ts +582 -0
- package/Tests/Server/Enterprise/EnterpriseServerModule.test.ts +247 -0
- package/Tests/Server/Enterprise/FakeEnterpriseModule.ts +502 -0
- package/Tests/Server/Enterprise/TestBillingFlag.ts +70 -0
- package/Tests/Server/EnvironmentConfigEnterpriseEdition.test.ts +314 -0
- package/Tests/Server/Infrastructure/ContainerBootConfiguration.test.ts +289 -0
- package/Tests/Server/Infrastructure/E2EClickHouseFixtureAccess.test.ts +5 -1
- package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
- package/Tests/Server/Infrastructure/Postgres/AddSloLabelAndOwnerRulesMigration.test.ts +407 -0
- package/Tests/Server/Infrastructure/Postgres/AddSloMonitorRuleMonitorTypeMigration.test.ts +171 -0
- package/Tests/Server/Infrastructure/Postgres/SloProductOverhaulMigration.test.ts +88 -4
- package/Tests/Server/Middleware/UserAuthorization.test.ts +37 -2
- package/Tests/Server/Middleware/UserAuthorizationEditionEnforcement.test.ts +516 -0
- package/Tests/Server/Services/AuditLogService.test.ts +460 -990
- package/Tests/Server/Services/CreateAndReadResponsesKeepIds.test.ts +263 -0
- package/Tests/Server/Services/DatabaseServiceRuleCriteriaValidation.test.ts +104 -0
- package/Tests/Server/Services/EnterpriseLicenseServiceKeyGeneration.test.ts +151 -0
- package/Tests/Server/Services/GlobalConfigServiceLicenseColumns.test.ts +357 -0
- package/Tests/Server/Services/MonitorDestinationInfoIPv6.test.ts +101 -0
- package/Tests/Server/Services/MonitorProbeServiceIntervalScheduling.test.ts +333 -0
- package/Tests/Server/Services/MonitorStatusTimelineDailyAggregates.test.ts +303 -0
- package/Tests/Server/Services/ProjectServiceAuditLogLicense.test.ts +701 -0
- package/Tests/Server/Services/ProjectServiceAuditLogSettingsCache.test.ts +31 -35
- package/Tests/Server/Services/RuleRun/LabelRuleEnginesGroupBRun.test.ts +48 -1
- package/Tests/Server/Services/RuleRun/OwnerRuleEnginesGroupBRun.test.ts +30 -0
- package/Tests/Server/Services/ScimPushGroupsTeamLocksEdition.test.ts +431 -0
- package/Tests/Server/Services/ServiceLevelObjectiveLabelAndOwnerRuleEngines.test.ts +1170 -0
- package/Tests/Server/Services/ServiceLevelObjectiveLabelAndOwnerRuleServices.test.ts +172 -0
- package/Tests/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.test.ts +323 -0
- package/Tests/Server/Services/ServiceLevelObjectiveMonitorRuleService.test.ts +115 -0
- package/Tests/Server/Services/ServiceLevelObjectiveMonitorRuleTriggers.test.ts +21 -2
- package/Tests/Server/Services/ServiceLevelObjectiveMonitorTypePostgres.test.ts +480 -0
- package/Tests/Server/Services/ServiceLevelObjectiveService.test.ts +162 -0
- package/Tests/Server/Services/SsoRequirementReadMasking.test.ts +419 -0
- package/Tests/Server/Services/SsoRequirementWriteGuard.test.ts +769 -0
- package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +45 -6
- package/Tests/Server/Services/StatusPagePrivateUserInvitationPolicy.test.ts +94 -0
- package/Tests/Server/Services/UserAuthenticationService.test.ts +35 -0
- package/Tests/Server/Services/UserServiceSeatLimit.test.ts +94 -56
- package/Tests/Server/Types/Database/FeedEventTypeFilterQuery.test.ts +745 -0
- package/Tests/Server/Types/Database/Permissions/EditionPermission.test.ts +1823 -0
- package/Tests/Server/Types/Markdown.test.ts +183 -1
- package/Tests/Server/Types/Workflow/Components/ApiComponentSsrf.test.ts +49 -0
- package/Tests/Server/Types/Workflow/Components/TelegramSendMessageToChat.test.ts +331 -0
- package/Tests/Server/Utils/AI/SloTools.test.ts +10 -0
- package/Tests/Server/Utils/CommunityEditionSsoReport.test.ts +565 -0
- package/Tests/Server/Utils/EditionEnforcement.test.ts +303 -0
- package/Tests/Server/Utils/FrontendEnvironment.test.ts +367 -0
- package/Tests/Server/Utils/InstanceHealth/RedisHealth.test.ts +38 -418
- package/Tests/Server/Utils/Monitor/AffectedResourceList.test.ts +518 -0
- package/Tests/Server/Utils/Monitor/Criteria/EvaluateOverTime.test.ts +24 -4
- package/Tests/Server/Utils/Monitor/Criteria/MetricMonitorCriteriaAnomalyUnits.test.ts +1 -1
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluator.test.ts +1339 -96
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorBreachingSamples.test.ts +1101 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorMetricUnits.test.ts +106 -80
- package/Tests/Server/Utils/Monitor/MonitoringIntervalValidator.test.ts +188 -0
- package/Tests/Server/Utils/Monitor/RootCauseList.test.ts +252 -0
- package/Tests/Server/Utils/Rules/RuleRun/RuleRunPermission.test.ts +154 -0
- package/Tests/Server/Utils/SSRFProtection.test.ts +111 -0
- package/Tests/Server/Utils/Slo/SloRulePatternValidator.test.ts +67 -0
- package/Tests/Server/Utils/VM/VMRunnerSsrf.test.ts +213 -0
- package/Tests/Server/Utils/Workspace/Slack/SlackMarkdownSectionSplit.test.ts +1209 -0
- package/Tests/Types/API/HostnameFromAuthority.test.ts +20 -10
- package/Tests/Types/API/HostnameIPv6.test.ts +149 -0
- package/Tests/Types/API/Route.test.ts +56 -0
- package/Tests/Types/API/URLSchemeLikePath.test.ts +304 -0
- package/Tests/Types/Database/CanonicalModelInstance.test.ts +190 -0
- package/Tests/UI/Components/EditionLabelLapseCopy.ts +104 -0
- package/Tests/UI/Components/EditionLabelLicenseManagerWiring.test.tsx +254 -0
- package/Tests/UI/Components/EditionLabelLicenseRefresh.test.tsx +84 -178
- package/Tests/UI/Components/EditionLabelLicenseStatus.test.tsx +1586 -0
- package/Tests/UI/Components/EditionLabelLicenseWritesGuard.test.tsx +157 -0
- package/Tests/UI/Components/FeedOptions.test.ts +1404 -0
- package/Tests/UI/Components/FeedOptionsButton.test.tsx +2603 -0
- package/Tests/UI/Components/Graphs/DayUptimeGraph.test.tsx +49 -2
- package/Tests/UI/Components/Icon.test.tsx +26 -0
- package/Tests/UI/Components/MarkdownConverters.test.ts +684 -0
- package/Tests/UI/Components/ModelListEmptyState.test.tsx +289 -0
- package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
- package/Tests/UI/Components/TelemetryViewer/TelemetryViewerEmptyContent.test.tsx +131 -0
- package/Tests/UI/Components/useFeedItemsViewKey.test.tsx +1017 -0
- package/Tests/UI/Components/useFeedOptions.test.tsx +1107 -0
- package/Tests/UI/EsbuildEnterpriseAlias.test.ts +1127 -0
- package/Tests/Utils/HostAddressUtil.test.ts +138 -0
- package/Tests/Utils/LabelRuleImportExport.test.ts +102 -0
- package/Tests/Utils/Monitor/MonitorDestinationUtil.test.ts +313 -0
- package/Tests/Utils/Monitor/MonitoringIntervalUtil.test.ts +304 -0
- package/Tests/Utils/Slo/SloDuration.test.ts +115 -24
- package/Tests/Utils/Slo/SloHealth.test.ts +93 -10
- package/Tests/Utils/Slo/SloMonitorRuleCriteria.test.ts +109 -0
- package/Tests/Utils/Slo/SloOverviewText.test.ts +64 -0
- package/Tests/Utils/StatusPage/UptimeDailyAggregateUtil.test.ts +248 -0
- package/Types/API/Hostname.ts +63 -16
- package/Types/API/Route.ts +19 -2
- package/Types/API/URL.ts +26 -2
- package/Types/Database/AccessControl/ColumnAccessControl.ts +19 -7
- package/Types/Database/AccessControl/ColumnBillingAccessControl.ts +19 -7
- package/Types/Database/AccessControl/OwnerOnlyColumn.ts +15 -6
- package/Types/Database/CanonicalModelInstance.ts +102 -0
- package/Types/Database/TableColumn.ts +20 -6
- package/Types/EnterpriseLicense/EnterpriseLicensePeriods.ts +29 -0
- package/Types/IP/IPv6.ts +6 -1
- package/Types/Monitor/MetricMonitor/MetricCriteriaContext.ts +6 -5
- package/Types/Monitor/MetricMonitor/MetricMonitorResponse.ts +9 -0
- package/Types/Monitor/MonitorStep.ts +6 -1
- package/Types/Monitor/ProxmoxAlertTemplates.ts +1 -1
- package/Types/Permission.ts +90 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.ts +11 -0
- package/Types/Rules/RuleRun.ts +4 -0
- package/Types/StatusPage/UptimeDailyAggregate.ts +110 -0
- package/UI/Components/EditionLabel/EditionLabel.tsx +796 -1195
- package/UI/Components/EditionLabel/LicenseManager.ts +119 -0
- package/UI/Components/Feed/FeedOptions.ts +427 -0
- package/UI/Components/Feed/FeedOptionsButton.tsx +692 -0
- package/UI/Components/Feed/useFeedItems.ts +28 -9
- package/UI/Components/Feed/useFeedOptions.ts +225 -0
- package/UI/Components/Graphs/DayUptimeGraph.tsx +123 -15
- package/UI/Components/Icon/Icon.tsx +1 -1
- package/UI/Components/Markdown.tsx/MarkdownConverters.ts +0 -0
- package/UI/Components/ModelList/ModelList.tsx +11 -1
- package/UI/Components/MonitorGraphs/Uptime.tsx +69 -0
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +28 -12
- package/UI/esbuild-enterprise.js +263 -0
- package/Utils/EnterpriseLicense/EnterpriseLicenseUsage.ts +7 -2
- package/Utils/HostAddressUtil.ts +94 -0
- package/Utils/LabelRuleImportExport.ts +27 -9
- package/Utils/Monitor/MetricValueFormatter.ts +2 -2
- package/Utils/Monitor/MonitorDestinationUtil.ts +157 -0
- package/Utils/Monitor/MonitoringIntervalUtil.ts +436 -0
- package/Utils/Rules/MonitorTypeRuleCriteria.ts +31 -0
- package/Utils/Slo/SloDuration.ts +22 -6
- package/Utils/Slo/SloHealth.ts +8 -7
- package/Utils/Slo/SloMonitorRuleCriteria.ts +33 -1
- package/Utils/Slo/SloOverviewText.ts +33 -0
- package/Utils/Slo/SloProjection.ts +4 -3
- package/Utils/StatusPage/UptimeDailyAggregateUtil.ts +192 -0
- package/build/dist/Models/AnalyticsModels/AuditLog.js +23 -15
- package/build/dist/Models/AnalyticsModels/AuditLog.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +25 -0
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +4 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Monitor.js +2 -2
- package/build/dist/Models/DatabaseModels/Monitor.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MonitorTemplate.js +2 -1
- package/build/dist/Models/DatabaseModels/MonitorTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveFeed.js +2 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveLabelRule.js +530 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveMonitorRule.js +39 -4
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveMonitorRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerRule.js +612 -0
- package/build/dist/Models/DatabaseModels/ServiceLevelObjectiveOwnerRule.js.map +1 -0
- package/build/dist/Server/API/BaseAPI.js +26 -5
- package/build/dist/Server/API/BaseAPI.js.map +1 -1
- package/build/dist/Server/API/GlobalConfigAPI.js +148 -344
- package/build/dist/Server/API/GlobalConfigAPI.js.map +1 -1
- package/build/dist/Server/API/ProjectOIDC.js +24 -16
- package/build/dist/Server/API/ProjectOIDC.js.map +1 -1
- package/build/dist/Server/API/ProjectSSO.js +24 -16
- package/build/dist/Server/API/ProjectSSO.js.map +1 -1
- package/build/dist/Server/API/StatusPageAPI.js +93 -43
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/API/TeamMemberAPI.js +8 -1
- package/build/dist/Server/API/TeamMemberAPI.js.map +1 -1
- package/build/dist/Server/Enterprise/EnterpriseEdition.js +466 -0
- package/build/dist/Server/Enterprise/EnterpriseEdition.js.map +1 -0
- package/build/dist/Server/Enterprise/EnterpriseFeature.js +39 -0
- package/build/dist/Server/Enterprise/EnterpriseFeature.js.map +1 -0
- package/build/dist/Server/Enterprise/EnterpriseLicenseSnapshot.js +70 -0
- package/build/dist/Server/Enterprise/EnterpriseLicenseSnapshot.js.map +1 -0
- package/build/dist/Server/Enterprise/EnterpriseServerModule.js +84 -0
- package/build/dist/Server/Enterprise/EnterpriseServerModule.js.map +1 -0
- package/build/dist/Server/EnvironmentConfig.js +84 -2
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793900000000-AddEnterpriseEditionFirstSeenAt.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1793900000000-AddEnterpriseEditionFirstSeenAt.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794100000000-AddSloLabelAndOwnerRules.js +93 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794100000000-AddSloLabelAndOwnerRules.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794200000000-AddSloMonitorRuleMonitorType.js +12 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1794200000000-AddSloMonitorRuleMonitorType.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +6 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +30 -11
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AuditLogService.js +71 -740
- package/build/dist/Server/Services/AuditLogService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +7 -0
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/EnterpriseLicenseService.js +34 -0
- package/build/dist/Server/Services/EnterpriseLicenseService.js.map +1 -1
- package/build/dist/Server/Services/GlobalConfigService.js +63 -0
- package/build/dist/Server/Services/GlobalConfigService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +4 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MonitorProbeService.js +90 -17
- package/build/dist/Server/Services/MonitorProbeService.js.map +1 -1
- package/build/dist/Server/Services/MonitorService.js +48 -6
- package/build/dist/Server/Services/MonitorService.js.map +1 -1
- package/build/dist/Server/Services/MonitorStatusTimelineService.js +242 -0
- package/build/dist/Server/Services/MonitorStatusTimelineService.js.map +1 -1
- package/build/dist/Server/Services/MonitorTemplateService.js +16 -0
- package/build/dist/Server/Services/MonitorTemplateService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +214 -0
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/RumSessionPinService.js +24 -6
- package/build/dist/Server/Services/RumSessionPinService.js.map +1 -1
- package/build/dist/Server/Services/ServiceLevelObjectiveLabelRuleEngineService.js +295 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveLabelRuleService.js +56 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.js +59 -14
- package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleService.js +22 -1
- package/build/dist/Server/Services/ServiceLevelObjectiveMonitorRuleService.js.map +1 -1
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerRuleEngineService.js +400 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerRuleService.js +56 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveService.js +21 -0
- package/build/dist/Server/Services/ServiceLevelObjectiveService.js.map +1 -1
- package/build/dist/Server/Services/StatusPagePrivateUserService.js +7 -3
- package/build/dist/Server/Services/StatusPagePrivateUserService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +71 -0
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamMemberService.js +10 -0
- package/build/dist/Server/Services/TeamMemberService.js.map +1 -1
- package/build/dist/Server/Services/TeamService.js +9 -0
- package/build/dist/Server/Services/TeamService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +10 -16
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +10 -0
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/EditionPermission.js +154 -14
- package/build/dist/Server/Types/Database/Permissions/EditionPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TablePermission.js +10 -3
- package/build/dist/Server/Types/Database/Permissions/TablePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js +17 -0
- package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js.map +1 -1
- package/build/dist/Server/Types/Markdown.js +31 -0
- package/build/dist/Server/Types/Markdown.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Telegram/SendMessageToChat.js +20 -1
- package/build/dist/Server/Types/Workflow/Components/Telegram/SendMessageToChat.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js.map +1 -1
- package/build/dist/Server/Utils/CommunityEditionSsoReport.js +223 -0
- package/build/dist/Server/Utils/CommunityEditionSsoReport.js.map +1 -0
- package/build/dist/Server/Utils/EditionEnforcement.js +187 -0
- package/build/dist/Server/Utils/EditionEnforcement.js.map +1 -0
- package/build/dist/Server/Utils/FrontendEnvironment.js +31 -2
- package/build/dist/Server/Utils/FrontendEnvironment.js.map +1 -1
- package/build/dist/Server/Utils/InstanceHealth/RedisHealth.js +6 -193
- package/build/dist/Server/Utils/InstanceHealth/RedisHealth.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/AffectedResourceList.js +67 -0
- package/build/dist/Server/Utils/Monitor/AffectedResourceList.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/Criteria/CompareCriteria.js +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js +8 -1
- package/build/dist/Server/Utils/Monitor/Criteria/EvaluateOverTime.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/Criteria/MetricMonitorCriteria.js +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +585 -367
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitoringIntervalValidator.js +88 -0
- package/build/dist/Server/Utils/Monitor/MonitoringIntervalValidator.js.map +1 -0
- package/build/dist/Server/Utils/Monitor/RootCauseList.js +101 -0
- package/build/dist/Server/Utils/Monitor/RootCauseList.js.map +1 -0
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +28 -0
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Slo/SloRulePatternValidator.js +28 -0
- package/build/dist/Server/Utils/Slo/SloRulePatternValidator.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js +331 -11
- package/build/dist/Server/Utils/Workspace/Slack/Slack.js.map +1 -1
- package/build/dist/Types/API/Hostname.js +59 -11
- package/build/dist/Types/API/Hostname.js.map +1 -1
- package/build/dist/Types/API/Route.js +18 -2
- package/build/dist/Types/API/Route.js.map +1 -1
- package/build/dist/Types/API/URL.js +23 -2
- package/build/dist/Types/API/URL.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js +19 -7
- package/build/dist/Types/Database/AccessControl/ColumnAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js +19 -7
- package/build/dist/Types/Database/AccessControl/ColumnBillingAccessControl.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js +13 -6
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js.map +1 -1
- package/build/dist/Types/Database/CanonicalModelInstance.js +88 -0
- package/build/dist/Types/Database/CanonicalModelInstance.js.map +1 -0
- package/build/dist/Types/Database/TableColumn.js +19 -6
- package/build/dist/Types/Database/TableColumn.js.map +1 -1
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicensePeriods.js +28 -0
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicensePeriods.js.map +1 -0
- package/build/dist/Types/IP/IPv6.js +6 -1
- package/build/dist/Types/IP/IPv6.js.map +1 -1
- package/build/dist/Types/Monitor/MonitorStep.js +5 -0
- package/build/dist/Types/Monitor/MonitorStep.js.map +1 -1
- package/build/dist/Types/Monitor/ProxmoxAlertTemplates.js +1 -1
- package/build/dist/Types/Permission.js +84 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +11 -0
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js.map +1 -1
- package/build/dist/Types/Rules/RuleRun.js +4 -0
- package/build/dist/Types/Rules/RuleRun.js.map +1 -1
- package/build/dist/Types/StatusPage/UptimeDailyAggregate.js +32 -0
- package/build/dist/Types/StatusPage/UptimeDailyAggregate.js.map +1 -0
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +414 -585
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/LicenseManager.js +2 -0
- package/build/dist/UI/Components/EditionLabel/LicenseManager.js.map +1 -0
- package/build/dist/UI/Components/Feed/FeedOptions.js +235 -0
- package/build/dist/UI/Components/Feed/FeedOptions.js.map +1 -0
- package/build/dist/UI/Components/Feed/FeedOptionsButton.js +346 -0
- package/build/dist/UI/Components/Feed/FeedOptionsButton.js.map +1 -0
- package/build/dist/UI/Components/Feed/useFeedItems.js +17 -7
- package/build/dist/UI/Components/Feed/useFeedItems.js.map +1 -1
- package/build/dist/UI/Components/Feed/useFeedOptions.js +130 -0
- package/build/dist/UI/Components/Feed/useFeedOptions.js.map +1 -0
- package/build/dist/UI/Components/Graphs/DayUptimeGraph.js +90 -17
- package/build/dist/UI/Components/Graphs/DayUptimeGraph.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +1 -1
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js +0 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownConverters.js.map +1 -1
- package/build/dist/UI/Components/ModelList/ModelList.js +4 -1
- package/build/dist/UI/Components/ModelList/ModelList.js.map +1 -1
- package/build/dist/UI/Components/MonitorGraphs/Uptime.js +42 -1
- package/build/dist/UI/Components/MonitorGraphs/Uptime.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +2 -2
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js +6 -2
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseUsage.js.map +1 -1
- package/build/dist/Utils/HostAddressUtil.js +80 -0
- package/build/dist/Utils/HostAddressUtil.js.map +1 -0
- package/build/dist/Utils/LabelRuleImportExport.js +22 -6
- package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
- package/build/dist/Utils/Monitor/MetricValueFormatter.js +2 -2
- package/build/dist/Utils/Monitor/MonitorDestinationUtil.js +127 -0
- package/build/dist/Utils/Monitor/MonitorDestinationUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitoringIntervalUtil.js +374 -0
- package/build/dist/Utils/Monitor/MonitoringIntervalUtil.js.map +1 -0
- package/build/dist/Utils/Rules/MonitorTypeRuleCriteria.js +18 -0
- package/build/dist/Utils/Rules/MonitorTypeRuleCriteria.js.map +1 -0
- package/build/dist/Utils/Slo/SloDuration.js +13 -5
- package/build/dist/Utils/Slo/SloDuration.js.map +1 -1
- package/build/dist/Utils/Slo/SloHealth.js +8 -7
- package/build/dist/Utils/Slo/SloHealth.js.map +1 -1
- package/build/dist/Utils/Slo/SloMonitorRuleCriteria.js +16 -1
- package/build/dist/Utils/Slo/SloMonitorRuleCriteria.js.map +1 -1
- package/build/dist/Utils/Slo/SloOverviewText.js +16 -0
- package/build/dist/Utils/Slo/SloOverviewText.js.map +1 -1
- package/build/dist/Utils/Slo/SloProjection.js.map +1 -1
- package/build/dist/Utils/StatusPage/UptimeDailyAggregateUtil.js +148 -0
- package/build/dist/Utils/StatusPage/UptimeDailyAggregateUtil.js.map +1 -0
- package/jest.config.json +3 -1
- package/package.json +1 -1
- package/test-setup.sh +103 -34
- package/tsconfig.json +13 -0
- package/Server/API/EnterpriseLicenseAPI.ts +0 -925
- package/Server/API/TeamComplianceAPI.ts +0 -158
- package/Server/Middleware/SCIMAuthorization.ts +0 -141
- package/Server/Services/TeamComplianceService.ts +0 -733
- package/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.ts +0 -186
- package/Server/Utils/InstanceHealth/PostgresHealth.ts +0 -286
- package/Tests/App/AdminDashboard/EnterpriseLicenseInstanceActivity.test.tsx +0 -451
- package/Tests/App/Dashboard/AuditLogsTable.test.tsx +0 -598
- package/Tests/App/Dashboard/SecurityEventsExplorer.test.tsx +0 -761
- package/Tests/App/Dashboard/SecurityEventsSideMenu.test.tsx +0 -247
- package/Tests/App/Dashboard/SecurityEventsTableColumns.test.tsx +0 -382
- package/Tests/App/Dashboard/SecurityEventsVolumeChart.test.tsx +0 -321
- package/Tests/Server/API/EnterpriseLicenseReportUserCount.test.ts +0 -1851
- package/Tests/Server/Middleware/SCIMAuthorization.test.ts +0 -525
- package/Tests/Server/Services/TeamComplianceServiceBehaviour.test.ts +0 -1845
- package/Tests/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.test.ts +0 -495
- package/Tests/Server/Utils/InstanceHealth/PostgresHealth.test.ts +0 -337
- package/Tests/Utils/EnterpriseLicenseSeats.test.ts +0 -576
- package/Tests/Utils/EnterpriseLicenseSync.test.ts +0 -568
- package/Utils/EnterpriseLicense/EnterpriseLicenseSeats.ts +0 -287
- package/Utils/EnterpriseLicense/EnterpriseLicenseSync.ts +0 -244
- package/build/dist/Server/API/EnterpriseLicenseAPI.js +0 -646
- package/build/dist/Server/API/EnterpriseLicenseAPI.js.map +0 -1
- package/build/dist/Server/API/TeamComplianceAPI.js +0 -111
- package/build/dist/Server/API/TeamComplianceAPI.js.map +0 -1
- package/build/dist/Server/Middleware/SCIMAuthorization.js +0 -124
- package/build/dist/Server/Middleware/SCIMAuthorization.js.map +0 -1
- package/build/dist/Server/Services/TeamComplianceService.js +0 -537
- package/build/dist/Server/Services/TeamComplianceService.js.map +0 -1
- package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js +0 -145
- package/build/dist/Server/Utils/EnterpriseLicense/EnterpriseLicenseSeatUtil.js.map +0 -1
- package/build/dist/Server/Utils/InstanceHealth/PostgresHealth.js +0 -194
- package/build/dist/Server/Utils/InstanceHealth/PostgresHealth.js.map +0 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js +0 -168
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSeats.js.map +0 -1
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSync.js +0 -174
- package/build/dist/Utils/EnterpriseLicense/EnterpriseLicenseSync.js.map +0 -1
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import EnterpriseEdition from "../Enterprise/EnterpriseEdition";
|
|
2
|
+
import EnterpriseFeature from "../Enterprise/EnterpriseFeature";
|
|
3
|
+
import { ENTERPRISE_LICENSE_GRACE_PERIOD_IN_DAYS, ENTERPRISE_LICENSE_TRIAL_PERIOD_IN_DAYS, } from "../Enterprise/EnterpriseLicenseSnapshot";
|
|
4
|
+
import logger from "./Logger";
|
|
5
|
+
import PaymentRequiredException from "../../Types/Exception/PaymentRequiredException";
|
|
6
|
+
/*
|
|
7
|
+
* Which enterprise identity controls are live in this process.
|
|
8
|
+
*
|
|
9
|
+
* Every answer here follows the RUNTIME state of the feature behind it
|
|
10
|
+
* (EnterpriseEdition.isFeatureActive): SSO for the SSO requirements, the
|
|
11
|
+
* SAML/OIDC sign-in routes and the provider listings, SCIM for the SCIM Push
|
|
12
|
+
* Groups team locks. A feature is active when the Enterprise Edition is loaded
|
|
13
|
+
* and, with billing off, its license covers the feature (valid, in the grace
|
|
14
|
+
* period after it expired, or - with no license - inside the trial).
|
|
15
|
+
*
|
|
16
|
+
* The controls are relaxed where they cannot work:
|
|
17
|
+
* - on the Community Edition, which has no SAML/OIDC sign-in routes and no
|
|
18
|
+
* SCIM endpoints;
|
|
19
|
+
* - on an Enterprise install whose license has lapsed, where those routes
|
|
20
|
+
* refuse (ee/Server/Identity).
|
|
21
|
+
* Enforcing a leftover "Require SSO for login" there would lock every user
|
|
22
|
+
* out, and a leftover SCIM Push Groups lock would leave teams nobody can
|
|
23
|
+
* manage. Users sign in with their password instead (users who only ever used
|
|
24
|
+
* SSO reset it). The configuration itself is kept untouched - reads made for
|
|
25
|
+
* a caller report the requirement as off, and a caller's write can neither
|
|
26
|
+
* switch it off nor set it meanwhile (guardSsoRequirementWrite) - so running
|
|
27
|
+
* the Enterprise Edition again (with a valid license, or during its trial or
|
|
28
|
+
* grace period), or renewing the license, restores enforcement without a
|
|
29
|
+
* restart.
|
|
30
|
+
*
|
|
31
|
+
* Failure direction: an error while deciding answers "enforce", and an
|
|
32
|
+
* unknown license state counts as active (see isFeatureActive), so a read
|
|
33
|
+
* error never switches a control off.
|
|
34
|
+
*/
|
|
35
|
+
class EditionEnforcement {
|
|
36
|
+
/*
|
|
37
|
+
* Whether configured SSO requirements - a project's requireSsoForLogin (and
|
|
38
|
+
* its required provider), the instance-wide requireSsoForLogin and a status
|
|
39
|
+
* page's requireSsoForLogin - are enforced.
|
|
40
|
+
*/
|
|
41
|
+
static isSsoEnforced() {
|
|
42
|
+
try {
|
|
43
|
+
return EnterpriseEdition.isFeatureActive(EnterpriseFeature.SSO);
|
|
44
|
+
}
|
|
45
|
+
catch (err) {
|
|
46
|
+
logger.error("EditionEnforcement: could not tell whether SSO is enforced; enforcing it.");
|
|
47
|
+
logger.error(err);
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// A configured SSO requirement that is also enforced in this process.
|
|
52
|
+
static isSsoRequired(configuredRequirement) {
|
|
53
|
+
if (!configuredRequirement) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return EditionEnforcement.isSsoEnforced();
|
|
57
|
+
}
|
|
58
|
+
/*
|
|
59
|
+
* Whether SCIM Push Groups owns team membership: while a project's SCIM
|
|
60
|
+
* configuration has Push Groups on, teams and team members can only be
|
|
61
|
+
* changed by the identity provider. Relaxed on the Community Edition, and
|
|
62
|
+
* while the license does not cover SCIM, because then no SCIM endpoint
|
|
63
|
+
* answers the identity provider and nobody else could manage those teams.
|
|
64
|
+
*/
|
|
65
|
+
static areScimTeamLocksEnforced() {
|
|
66
|
+
try {
|
|
67
|
+
return EnterpriseEdition.isFeatureActive(EnterpriseFeature.SCIM);
|
|
68
|
+
}
|
|
69
|
+
catch (err) {
|
|
70
|
+
logger.error("EditionEnforcement: could not tell whether SCIM team locks apply; applying them.");
|
|
71
|
+
logger.error(err);
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/*
|
|
76
|
+
* Whether the SAML/OIDC sign-in routes answer right now. Provider listings
|
|
77
|
+
* (the lists a sign-in page offers) are empty when they do not, so no client
|
|
78
|
+
* sends a user into a route that answers 404 (Community Edition) or refuses
|
|
79
|
+
* because the license lapsed (Enterprise Edition).
|
|
80
|
+
*/
|
|
81
|
+
static areSsoRoutesServed() {
|
|
82
|
+
try {
|
|
83
|
+
return EnterpriseEdition.isFeatureActive(EnterpriseFeature.SSO);
|
|
84
|
+
}
|
|
85
|
+
catch (err) {
|
|
86
|
+
logger.error("EditionEnforcement: could not tell whether the SSO routes are served; serving them.");
|
|
87
|
+
logger.error(err);
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/*
|
|
92
|
+
* Whether a read should report the EFFECTIVE SSO requirement (false)
|
|
93
|
+
* instead of the stored one. Clients - the mobile app in particular, whose
|
|
94
|
+
* store builds cannot be patched - decide from these columns whether to
|
|
95
|
+
* start an SSO flow, and while SSO is not active that flow does not exist
|
|
96
|
+
* (Community Edition) or refuses (lapsed license).
|
|
97
|
+
*
|
|
98
|
+
* Only reads made for a caller are masked. Internal (root) reads see the
|
|
99
|
+
* stored value, and a read never writes, so the configuration is intact
|
|
100
|
+
* when SSO is active again. The write half is guardSsoRequirementWrite.
|
|
101
|
+
*/
|
|
102
|
+
static shouldMaskSsoRequirementOnRead(props) {
|
|
103
|
+
if (!props || props.isRoot) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
return !EditionEnforcement.isSsoEnforced();
|
|
107
|
+
}
|
|
108
|
+
/*
|
|
109
|
+
* The write half of shouldMaskSsoRequirementOnRead, for the services'
|
|
110
|
+
* onBeforeUpdate. A caller whose reads are masked has only ever seen the
|
|
111
|
+
* requirement as off (no required provider), so what it writes to those
|
|
112
|
+
* columns cannot be taken at face value: a settings form, or an API client
|
|
113
|
+
* doing a read-modify-write, sends back the masked value it read. Saving it
|
|
114
|
+
* would switch a configured requirement off without anybody deciding to,
|
|
115
|
+
* and it would stay off once SSO is active again.
|
|
116
|
+
*
|
|
117
|
+
* So while this caller's reads are masked:
|
|
118
|
+
* - a write of the masked value (false, or no provider) is dropped from
|
|
119
|
+
* `data`, and the stored requirement is kept;
|
|
120
|
+
* - a write that would set a requirement (true, or a provider) is
|
|
121
|
+
* refused: it could neither be seen nor enforced until SSO is active;
|
|
122
|
+
* - a write that is left with nothing else to save is refused with the
|
|
123
|
+
* same explanation, rather than reporting a save that did not happen.
|
|
124
|
+
*
|
|
125
|
+
* Root writes, and every write while SSO is active, are left alone.
|
|
126
|
+
* Mutates `data`. Throws PaymentRequiredException.
|
|
127
|
+
*/
|
|
128
|
+
static guardSsoRequirementWrite(input) {
|
|
129
|
+
if (!EditionEnforcement.shouldMaskSsoRequirementOnRead(input.props)) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const writtenColumns = input.columns.filter((column) => {
|
|
133
|
+
return input.data[column] !== undefined;
|
|
134
|
+
});
|
|
135
|
+
if (writtenColumns.length === 0) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const setsRequirement = writtenColumns.some((column) => {
|
|
139
|
+
return !EditionEnforcement.isMaskedSsoRequirementValue(input.data[column]);
|
|
140
|
+
});
|
|
141
|
+
if (setsRequirement) {
|
|
142
|
+
throw EditionEnforcement.createSsoRequirementUnchangeableException();
|
|
143
|
+
}
|
|
144
|
+
for (const column of writtenColumns) {
|
|
145
|
+
delete input.data[column];
|
|
146
|
+
}
|
|
147
|
+
/*
|
|
148
|
+
* `data` is the plain update onBeforeUpdate receives (a model instance
|
|
149
|
+
* has already been reduced to its set columns by
|
|
150
|
+
* DatabaseService.sanitizeUpdateData); a key left undefined writes
|
|
151
|
+
* nothing, so it does not count.
|
|
152
|
+
*/
|
|
153
|
+
const hasOtherColumns = Object.keys(input.data).some((key) => {
|
|
154
|
+
return input.data[key] !== undefined;
|
|
155
|
+
});
|
|
156
|
+
if (!hasOtherColumns) {
|
|
157
|
+
throw EditionEnforcement.createSsoRequirementUnchangeableException();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// What a masked read reports for a requirement column: false or null.
|
|
161
|
+
static isMaskedSsoRequirementValue(value) {
|
|
162
|
+
return value === false || value === null;
|
|
163
|
+
}
|
|
164
|
+
static createSsoRequirementUnchangeableException() {
|
|
165
|
+
let isEnterpriseEditionLoaded = true;
|
|
166
|
+
try {
|
|
167
|
+
isEnterpriseEditionLoaded = EnterpriseEdition.isLoaded();
|
|
168
|
+
}
|
|
169
|
+
catch (err) {
|
|
170
|
+
logger.error(err);
|
|
171
|
+
}
|
|
172
|
+
return new PaymentRequiredException(isEnterpriseEditionLoaded
|
|
173
|
+
? EditionEnforcement.SSO_REQUIREMENT_UNCHANGEABLE_LICENSE_MESSAGE
|
|
174
|
+
: EditionEnforcement.SSO_REQUIREMENT_UNCHANGEABLE_COMMUNITY_MESSAGE);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Why guardSsoRequirementWrite refuses a write, on the Community Edition.
|
|
178
|
+
EditionEnforcement.SSO_REQUIREMENT_UNCHANGEABLE_COMMUNITY_MESSAGE = 'Single sign-on is part of the OneUptime Enterprise Edition and this server runs the Community Edition, so "Require SSO for login" shows as off, is not enforced and cannot be changed here. ' +
|
|
179
|
+
`A setting saved earlier is kept, and it is enforced again when this server runs the Enterprise Edition image with a valid license (or during its ${ENTERPRISE_LICENSE_TRIAL_PERIOD_IN_DAYS}-day trial, or the ${ENTERPRISE_LICENSE_GRACE_PERIOD_IN_DAYS}-day grace period after a license expires).`;
|
|
180
|
+
/*
|
|
181
|
+
* Why guardSsoRequirementWrite refuses a write, on an Enterprise install
|
|
182
|
+
* whose license does not cover SSO right now.
|
|
183
|
+
*/
|
|
184
|
+
EditionEnforcement.SSO_REQUIREMENT_UNCHANGEABLE_LICENSE_MESSAGE = 'Single sign-on has stopped because the OneUptime Enterprise license is missing, expired or does not include SSO, so "Require SSO for login" shows as off, is not enforced and cannot be changed. ' +
|
|
185
|
+
"The saved setting is kept, and it is enforced again as soon as a master admin activates or renews the license from the edition label in the Admin Dashboard header.";
|
|
186
|
+
export default EditionEnforcement;
|
|
187
|
+
//# sourceMappingURL=EditionEnforcement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditionEnforcement.js","sourceRoot":"","sources":["../../../../Server/Utils/EditionEnforcement.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,EACL,uCAAuC,EACvC,uCAAuC,GACxC,MAAM,yCAAyC,CAAC;AACjD,OAAO,MAAM,MAAM,UAAU,CAAC;AAE9B,OAAO,wBAAwB,MAAM,gDAAgD,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAqB,kBAAkB;IAcrC;;;;OAIG;IACI,MAAM,CAAC,aAAa;QACzB,IAAI,CAAC;YACH,OAAO,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CACV,2EAA2E,CAC5E,CAAC;YACF,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,sEAAsE;IAC/D,MAAM,CAAC,aAAa,CACzB,qBAAiD;QAEjD,IAAI,CAAC,qBAAqB,EAAE,CAAC;YAC3B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,kBAAkB,CAAC,aAAa,EAAE,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,wBAAwB;QACpC,IAAI,CAAC;YACH,OAAO,iBAAiB,CAAC,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACnE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,CAAC,KAAK,CACV,kFAAkF,CACnF,CAAC;YACF,MA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
|
@@ -1,6 +1,35 @@
|
|
|
1
|
-
import { getFrontendEnvVars } from "../EnvironmentConfig";
|
|
1
|
+
import { getFrontendEnvVars, isEnterpriseEditionRequested, } from "../EnvironmentConfig";
|
|
2
|
+
import EnterpriseEdition from "../Enterprise/EnterpriseEdition";
|
|
2
3
|
import Response from "./Response";
|
|
3
4
|
export const FRONTEND_ENVIRONMENT_CACHE_CONTROL = "private, no-store, no-cache, must-revalidate";
|
|
5
|
+
/*
|
|
6
|
+
* The edition the frontends are told about is the EFFECTIVE one: whether the
|
|
7
|
+
* enterprise module actually loaded in this process, not what the raw
|
|
8
|
+
* IS_ENTERPRISE_EDITION variable claims. A Community image with a leftover
|
|
9
|
+
* IS_ENTERPRISE_EDITION=true must not show enterprise pages whose server
|
|
10
|
+
* routes do not exist; ENTERPRISE_EDITION_REQUESTED_BUT_NOT_LOADED lets the
|
|
11
|
+
* admin UI explain that mismatch to a master admin instead.
|
|
12
|
+
*
|
|
13
|
+
* "Requested" is EnvironmentConfig's isEnterpriseEditionRequested, the same
|
|
14
|
+
* definition the App's boot guard uses: an explicit ONEUPTIME_EDITION=community
|
|
15
|
+
* withdraws the request, so the Enterprise image (which bakes
|
|
16
|
+
* IS_ENTERPRISE_EDITION=true) run as the Community Edition on purpose is not
|
|
17
|
+
* told to switch images. It is read on every call, like the rest of the
|
|
18
|
+
* environment served here.
|
|
19
|
+
*/
|
|
20
|
+
export const getFrontendEnvironmentVariables = () => {
|
|
21
|
+
const frontendEnv = getFrontendEnvVars();
|
|
22
|
+
const isEnterpriseEditionLoaded = EnterpriseEdition.isLoaded();
|
|
23
|
+
const isEnterpriseEditionExpected = isEnterpriseEditionRequested(process.env);
|
|
24
|
+
frontendEnv["IS_ENTERPRISE_EDITION"] = isEnterpriseEditionLoaded
|
|
25
|
+
? "true"
|
|
26
|
+
: "false";
|
|
27
|
+
frontendEnv["ENTERPRISE_EDITION_REQUESTED_BUT_NOT_LOADED"] =
|
|
28
|
+
isEnterpriseEditionExpected && !isEnterpriseEditionLoaded
|
|
29
|
+
? "true"
|
|
30
|
+
: "false";
|
|
31
|
+
return frontendEnv;
|
|
32
|
+
};
|
|
4
33
|
/*
|
|
5
34
|
* The combined App server and the five standalone frontend servers must emit
|
|
6
35
|
* exactly the same environment payload. Keeping the serializer here prevents
|
|
@@ -15,7 +44,7 @@ if(!window.process){
|
|
|
15
44
|
if(!window.process.env){
|
|
16
45
|
window.process.env = {}
|
|
17
46
|
}
|
|
18
|
-
window.process.env = ${JSON.stringify(
|
|
47
|
+
window.process.env = ${JSON.stringify(getFrontendEnvironmentVariables())};
|
|
19
48
|
`;
|
|
20
49
|
};
|
|
21
50
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrontendEnvironment.js","sourceRoot":"","sources":["../../../../Server/Utils/FrontendEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FrontendEnvironment.js","sourceRoot":"","sources":["../../../../Server/Utils/FrontendEnvironment.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,4BAA4B,GAC7B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAEhE,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,MAAM,CAAC,MAAM,kCAAkC,GAC7C,8CAA8C,CAAC;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,GAAe,EAAE;IACf,MAAM,WAAW,GAAe,kBAAkB,EAAE,CAAC;IACrD,MAAM,yBAAyB,GAAY,iBAAiB,CAAC,QAAQ,EAAE,CAAC;IACxE,MAAM,2BAA2B,GAAY,4BAA4B,CACvE,OAAO,CAAC,GAAG,CACZ,CAAC;IAEF,WAAW,CAAC,uBAAuB,CAAC,GAAG,yBAAyB;QAC9D,CAAC,CAAC,MAAM;QACR,CAAC,CAAC,OAAO,CAAC;IACZ,WAAW,CAAC,6CAA6C,CAAC;QACxD,2BAA2B,IAAI,CAAC,yBAAyB;YACvD,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,CAAC;IAEd,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEJ;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiB,GAAW,EAAE;IACrE,OAAO;;;;;;;;uBAQc,IAAI,CAAC,SAAS,CAAC,+BAA+B,EAAE,CAAC;CACvE,CAAC;AACF,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAGhC,CAAC,GAAmB,EAAE,GAAoB,EAAQ,EAAE;IAC9D,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAChC,GAAG,CAAC,SAAS,CAAC,eAAe,EAAE,kCAAkC,CAAC,CAAC;IACnE,QAAQ,CAAC,sBAAsB,CAAC,GAAG,EAAE,GAAG,EAAE,4BAA4B,EAAE,CAAC,CAAC;AAC5E,CAAC,CAAC"}
|
|
@@ -1,36 +1,4 @@
|
|
|
1
1
|
import Redis from "../../Infrastructure/Redis";
|
|
2
|
-
/*
|
|
3
|
-
* Where the previous counter sample is kept so a later run can turn Redis'
|
|
4
|
-
* monotonic counters into "did this happen since we last looked".
|
|
5
|
-
*
|
|
6
|
-
* Redis stores its own history here on purpose: the counters and the sample
|
|
7
|
-
* then share a lifetime, so a Redis restart clears both together and cannot
|
|
8
|
-
* leave a stale baseline that fabricates an enormous delta. The uptime guard
|
|
9
|
-
* below covers the case where the sample somehow outlives a restart anyway.
|
|
10
|
-
*
|
|
11
|
-
* Under memory pressure with an eviction policy this key can itself be evicted,
|
|
12
|
-
* which costs one interval of eviction detection: the next run finds no sample,
|
|
13
|
-
* re-seeds it, and reports deltas again from there.
|
|
14
|
-
*/
|
|
15
|
-
const COUNTER_SAMPLE_KEY = "oneuptime-instance-health-redis-sample";
|
|
16
|
-
const COUNTER_SAMPLE_TTL_IN_SECONDS = 60 * 60;
|
|
17
|
-
/*
|
|
18
|
-
* The minimum age of the baseline the counter deltas are measured against, so
|
|
19
|
-
* every evaluation answers "did this happen in at least the last half hour"
|
|
20
|
-
* rather than "did it happen in the last five minutes".
|
|
21
|
-
*
|
|
22
|
-
* That span is what keeps an edge-triggered signal from flapping. Evictions
|
|
23
|
-
* arriving in bursts would otherwise clear on the first quiet tick and fire
|
|
24
|
-
* again on the next, emailing every other cycle.
|
|
25
|
-
*
|
|
26
|
-
* Two samples are kept rather than one because a single rolling baseline is a
|
|
27
|
-
* TUMBLING window, not a sliding one: the tick immediately after a roll would
|
|
28
|
-
* compare against a five-minute-old sample and a lone quiet tick there would
|
|
29
|
-
* resolve the notification, re-notifying on the next burst of the same ongoing
|
|
30
|
-
* incident. Measuring against the OLDER of two samples makes the lookback
|
|
31
|
-
* always at least this long (and at most twice it).
|
|
32
|
-
*/
|
|
33
|
-
export const COUNTER_WINDOW_IN_SECONDS = 30 * 60;
|
|
34
2
|
/*
|
|
35
3
|
* INFO is a flat `field:value` document split into `# Section` blocks. Section
|
|
36
4
|
* headers and comment lines are dropped; field names are unique across sections
|
|
@@ -110,103 +78,11 @@ async function getMaxClients(client, info) {
|
|
|
110
78
|
}
|
|
111
79
|
return null;
|
|
112
80
|
}
|
|
113
|
-
function parseCounterSample(value) {
|
|
114
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
const sample = value;
|
|
118
|
-
const evictedKeys = Number(sample["evictedKeys"]);
|
|
119
|
-
const rejectedConnections = Number(sample["rejectedConnections"]);
|
|
120
|
-
const uptimeInSeconds = Number(sample["uptimeInSeconds"]);
|
|
121
|
-
if (!Number.isFinite(evictedKeys) ||
|
|
122
|
-
!Number.isFinite(rejectedConnections) ||
|
|
123
|
-
!Number.isFinite(uptimeInSeconds)) {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
return { evictedKeys, rejectedConnections, uptimeInSeconds };
|
|
127
|
-
}
|
|
128
|
-
async function readCounterSamples(client) {
|
|
129
|
-
try {
|
|
130
|
-
const raw = await client.get(COUNTER_SAMPLE_KEY);
|
|
131
|
-
if (!raw) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
const parsed = JSON.parse(raw);
|
|
135
|
-
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
|
|
136
|
-
return null;
|
|
137
|
-
}
|
|
138
|
-
const stored = parsed;
|
|
139
|
-
const older = parseCounterSample(stored["older"]);
|
|
140
|
-
const newer = parseCounterSample(stored["newer"]);
|
|
141
|
-
if (older && newer) {
|
|
142
|
-
return { older, newer };
|
|
143
|
-
}
|
|
144
|
-
/*
|
|
145
|
-
* A single-sample payload is what the previous release wrote. Treat it as
|
|
146
|
-
* both ends of the pair so an upgrade keeps its baseline instead of going
|
|
147
|
-
* blind for a window.
|
|
148
|
-
*/
|
|
149
|
-
const legacy = parseCounterSample(parsed);
|
|
150
|
-
return legacy ? { older: legacy, newer: legacy } : null;
|
|
151
|
-
}
|
|
152
|
-
catch (_a) {
|
|
153
|
-
// A missing or unreadable sample simply means no delta this run.
|
|
154
|
-
return null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
81
|
/*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
* kept alive by other means — see getRedisHealthSnapshot.
|
|
82
|
+
* One INFO read, plus the CONFIG fallback for maxclients. Exported so the
|
|
83
|
+
* Enterprise worker's snapshot reads Redis exactly the way this file does.
|
|
161
84
|
*/
|
|
162
|
-
async function
|
|
163
|
-
try {
|
|
164
|
-
await client.set(COUNTER_SAMPLE_KEY, JSON.stringify(samples), "EX", COUNTER_SAMPLE_TTL_IN_SECONDS);
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
catch (_a) {
|
|
168
|
-
/*
|
|
169
|
-
* Losing the baseline must never fail the health evaluation that produced
|
|
170
|
-
* this snapshot, so the error is swallowed and reported through the return.
|
|
171
|
-
*/
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
// Keep a baseline alive across the runs that do not rewrite it.
|
|
176
|
-
async function refreshCounterSampleTtl(client) {
|
|
177
|
-
try {
|
|
178
|
-
await client.expire(COUNTER_SAMPLE_KEY, COUNTER_SAMPLE_TTL_IN_SECONDS);
|
|
179
|
-
}
|
|
180
|
-
catch (_a) {
|
|
181
|
-
// Same reasoning as writeCounterSamples: never fail the evaluation over this.
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/*
|
|
185
|
-
* The pair rolls only once the NEWER sample has aged past the window, which
|
|
186
|
-
* promotes it to `older` and starts a fresh one. Deltas are always measured
|
|
187
|
-
* against `older`, so the lookback never drops below the window. Redis' own
|
|
188
|
-
* uptime measures that age, which avoids trusting either machine's clock.
|
|
189
|
-
*/
|
|
190
|
-
export function shouldRollCounterSamples(data) {
|
|
191
|
-
if (!data.previous || data.didRestart) {
|
|
192
|
-
return true;
|
|
193
|
-
}
|
|
194
|
-
return (data.currentUptimeInSeconds - data.previous.newer.uptimeInSeconds >=
|
|
195
|
-
COUNTER_WINDOW_IN_SECONDS);
|
|
196
|
-
}
|
|
197
|
-
/*
|
|
198
|
-
* Compare a monotonic counter against its previous value. A decrease, or a
|
|
199
|
-
* shorter uptime than the sample was taken at, means Redis restarted and the
|
|
200
|
-
* counter began again from zero — the difference is meaningless, so report no
|
|
201
|
-
* delta rather than a fabricated spike.
|
|
202
|
-
*/
|
|
203
|
-
export function getCounterDelta(data) {
|
|
204
|
-
if (data.didRestart || data.current < data.previous) {
|
|
205
|
-
return null;
|
|
206
|
-
}
|
|
207
|
-
return data.current - data.previous;
|
|
208
|
-
}
|
|
209
|
-
async function readInfoSnapshot(client) {
|
|
85
|
+
export async function readInfoSnapshot(client) {
|
|
210
86
|
const info = parseRedisInfo(await client.info());
|
|
211
87
|
return buildRedisInfoSnapshot({
|
|
212
88
|
info,
|
|
@@ -215,9 +91,9 @@ async function readInfoSnapshot(client) {
|
|
|
215
91
|
}
|
|
216
92
|
/*
|
|
217
93
|
* Read-only view for the admin health API. It deliberately does NOT touch the
|
|
218
|
-
*
|
|
219
|
-
* the worker needs, so a page refresh could hide
|
|
220
|
-
* notification that exists to catch it.
|
|
94
|
+
* counter sample the Enterprise health worker keeps: advancing that baseline
|
|
95
|
+
* here would consume the delta the worker needs, so a page refresh could hide
|
|
96
|
+
* an eviction burst from the notification that exists to catch it.
|
|
221
97
|
*/
|
|
222
98
|
export async function getRedisInfoSnapshot() {
|
|
223
99
|
const client = Redis.getClient();
|
|
@@ -226,67 +102,4 @@ export async function getRedisInfoSnapshot() {
|
|
|
226
102
|
}
|
|
227
103
|
return await readInfoSnapshot(client);
|
|
228
104
|
}
|
|
229
|
-
/*
|
|
230
|
-
* The evaluating worker's view: the same INFO read, plus the counter deltas
|
|
231
|
-
* that turn cumulative totals into "did this happen in roughly the last
|
|
232
|
-
* COUNTER_WINDOW_IN_SECONDS". Returns null when Redis is unreachable, which the
|
|
233
|
-
* caller treats as "cannot evaluate" rather than "healthy".
|
|
234
|
-
*/
|
|
235
|
-
export async function getRedisHealthSnapshot() {
|
|
236
|
-
const client = Redis.getClient();
|
|
237
|
-
if (!client || !Redis.isConnected()) {
|
|
238
|
-
return null;
|
|
239
|
-
}
|
|
240
|
-
const snapshot = await readInfoSnapshot(client);
|
|
241
|
-
const previousSamples = await readCounterSamples(client);
|
|
242
|
-
const didRestart = Boolean(previousSamples &&
|
|
243
|
-
previousSamples.older.uptimeInSeconds > snapshot.uptimeInSeconds);
|
|
244
|
-
// Deltas always measure against the older half, never the freshly rolled one.
|
|
245
|
-
const baseline = previousSamples
|
|
246
|
-
? previousSamples.older
|
|
247
|
-
: null;
|
|
248
|
-
const current = {
|
|
249
|
-
evictedKeys: snapshot.evictedKeys,
|
|
250
|
-
rejectedConnections: snapshot.rejectedConnections,
|
|
251
|
-
uptimeInSeconds: snapshot.uptimeInSeconds,
|
|
252
|
-
};
|
|
253
|
-
const wantsRoll = shouldRollCounterSamples({
|
|
254
|
-
previous: previousSamples,
|
|
255
|
-
currentUptimeInSeconds: snapshot.uptimeInSeconds,
|
|
256
|
-
didRestart,
|
|
257
|
-
});
|
|
258
|
-
const didRoll = wantsRoll
|
|
259
|
-
? await writeCounterSamples(client, {
|
|
260
|
-
older: previousSamples && !didRestart ? previousSamples.newer : current,
|
|
261
|
-
newer: current,
|
|
262
|
-
})
|
|
263
|
-
: false;
|
|
264
|
-
/*
|
|
265
|
-
* Keep the existing samples alive whenever they were not rolled — including
|
|
266
|
-
* when the roll FAILED, which is the case that matters most. Under the
|
|
267
|
-
* noeviction policy Redis rejects SET once it is out of memory but still
|
|
268
|
-
* serves EXPIRE, so letting a failed write skip the refresh would expire the
|
|
269
|
-
* baseline precisely when memory is full: eviction detection would then go
|
|
270
|
-
* permanently blind at the moment it is needed, because every later write
|
|
271
|
-
* fails the same way and the key never returns.
|
|
272
|
-
*/
|
|
273
|
-
if (!didRoll) {
|
|
274
|
-
await refreshCounterSampleTtl(client);
|
|
275
|
-
}
|
|
276
|
-
return Object.assign(Object.assign({}, snapshot), { counterWindowInSeconds: baseline
|
|
277
|
-
? snapshot.uptimeInSeconds - baseline.uptimeInSeconds
|
|
278
|
-
: null, evictedKeysDelta: baseline
|
|
279
|
-
? getCounterDelta({
|
|
280
|
-
current: snapshot.evictedKeys,
|
|
281
|
-
previous: baseline.evictedKeys,
|
|
282
|
-
didRestart,
|
|
283
|
-
})
|
|
284
|
-
: null, rejectedConnectionsDelta: baseline
|
|
285
|
-
? getCounterDelta({
|
|
286
|
-
current: snapshot.rejectedConnections,
|
|
287
|
-
previous: baseline.rejectedConnections,
|
|
288
|
-
didRestart,
|
|
289
|
-
})
|
|
290
|
-
: null });
|
|
291
|
-
}
|
|
292
105
|
//# sourceMappingURL=RedisHealth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RedisHealth.js","sourceRoot":"","sources":["../../../../../Server/Utils/InstanceHealth/RedisHealth.ts"],"names":[],"mappings":"AAA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CAAC;IAEpD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { escapeMarkdownInline } from "../../../Utils/Markdown/MarkdownEscape";
|
|
2
|
+
import RootCauseList from "./RootCauseList";
|
|
3
|
+
class AffectedResourceList {
|
|
4
|
+
static render(input) {
|
|
5
|
+
const items = input.entries.map((entry) => {
|
|
6
|
+
/*
|
|
7
|
+
* The kind is bold so each item's first line stands out from the
|
|
8
|
+
* detail bullets under it — the value at the end of the line is
|
|
9
|
+
* bold too, so the eye lands on what it is and how bad it is.
|
|
10
|
+
*/
|
|
11
|
+
const kind = escapeMarkdownInline(entry.kind).trim();
|
|
12
|
+
return {
|
|
13
|
+
title: [kind ? `**${kind}**` : "", entry.name.trim()]
|
|
14
|
+
.filter((part) => {
|
|
15
|
+
return part.length > 0;
|
|
16
|
+
})
|
|
17
|
+
.join(" "),
|
|
18
|
+
value: entry.value,
|
|
19
|
+
details: entry.details.map((detail) => {
|
|
20
|
+
return {
|
|
21
|
+
label: escapeMarkdownInline(detail.label),
|
|
22
|
+
value: detail.value,
|
|
23
|
+
};
|
|
24
|
+
}),
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
const lines = [RootCauseList.render(items)];
|
|
28
|
+
const hiddenCount = input.totalCount - input.entries.length;
|
|
29
|
+
if (hiddenCount > 0) {
|
|
30
|
+
/*
|
|
31
|
+
* The blank line matters: without it the summary is a lazy
|
|
32
|
+
* continuation of the last item's final bullet, not a paragraph of
|
|
33
|
+
* its own.
|
|
34
|
+
*/
|
|
35
|
+
lines.push("");
|
|
36
|
+
lines.push(`*... and ${hiddenCount} more ${escapeMarkdownInline(input.overflowNoun)}*`);
|
|
37
|
+
}
|
|
38
|
+
return `\n\n**${escapeMarkdownInline(input.heading)}** (${input.totalCount} total)\n\n${lines.join("\n")}`;
|
|
39
|
+
}
|
|
40
|
+
/*
|
|
41
|
+
* A resource identifier as an inline code span. The identifiers come from
|
|
42
|
+
* telemetry attributes, and a VMware VM or a Proxmox guest can be named
|
|
43
|
+
* anything — RootCauseList.code keeps a name with backticks or line breaks
|
|
44
|
+
* inside its span.
|
|
45
|
+
*/
|
|
46
|
+
static code(value) {
|
|
47
|
+
return RootCauseList.code(value);
|
|
48
|
+
}
|
|
49
|
+
/*
|
|
50
|
+
* A display name alongside the identifier it abbreviates — a Proxmox
|
|
51
|
+
* guest's name and its `qemu/100` id, a Ceph pool's name and number, a
|
|
52
|
+
* vSphere resource pool's name and inventory path. Either half may be
|
|
53
|
+
* missing; when both are the same only one is shown.
|
|
54
|
+
*/
|
|
55
|
+
static codeWithId(input) {
|
|
56
|
+
const name = AffectedResourceList.code(input.name);
|
|
57
|
+
const id = AffectedResourceList.code(input.id);
|
|
58
|
+
if (name && id && name !== id) {
|
|
59
|
+
return `${name} (${id})`;
|
|
60
|
+
}
|
|
61
|
+
return name || id;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// How many resources the list shows before it summarises the rest.
|
|
65
|
+
AffectedResourceList.MAX_ENTRIES = 10;
|
|
66
|
+
export default AffectedResourceList;
|
|
67
|
+
//# sourceMappingURL=AffectedResourceList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AffectedResourceList.js","sourceRoot":"","sources":["../../../../../Server/Utils/Monitor/AffectedResourceList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,aAGN,MAAM,iBAAiB,CAAC;AAqDzB,MAAqB,oBAAoB;IAIhC,MAAM,CAAC,MAAM,CAAC,KASpB;QACC,MAAM,KAAK,GAA6B,KAAK,CAAC,OAAO,CAAC,GAAG,CACvD,CAAC,KAAgC,EAAqB,EAAE;YACtD;;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,MAAM,CAAC,IAAI,CAAC,KAAgC;QACjD,OAAO,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,UAAU,CAAC,KAGxB;QACC,MAAM,IAAI,GAAW,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,EAAE,GAAW,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAEvD,IAAI,IAAI,IAAI,EAAE,IAAI,IAAI,KAAK,EAAE,EAAE,CAAC;YAC9B,OAAO,GAAG,IAAI,KAAK,EAAE,GAAG,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;;AAxFD,mEAAmE;AAC5C,gCAAW,GAAW,EAAE,CAAC;eAF7B,oBAAoB"}
|
|
@@ -725,7 +725,7 @@ export default class CompareCriteria {
|
|
|
725
725
|
* reads naturally ("is 42, 55, 60"). For larger arrays, summarize
|
|
726
726
|
* — dumping 30+ numbers on one line makes the root cause unreadable
|
|
727
727
|
* and the detailed breakdown is shown in the Breaching Samples
|
|
728
|
-
*
|
|
728
|
+
* list below.
|
|
729
729
|
*/
|
|
730
730
|
const MAX_INLINE = 5;
|
|
731
731
|
if (values.length <= MAX_INLINE) {
|
|
@@ -15,6 +15,7 @@ import MetricService from "../../../Services/MetricService";
|
|
|
15
15
|
import CaptureSpan from "../../Telemetry/CaptureSpan";
|
|
16
16
|
import InBetween from "../../../../Types/BaseDatabase/InBetween";
|
|
17
17
|
import CronTab from "../../CronTab";
|
|
18
|
+
import MonitoringIntervalUtil from "../../../../Utils/Monitor/MonitoringIntervalUtil";
|
|
18
19
|
import logger from "../../Logger";
|
|
19
20
|
/**
|
|
20
21
|
* Outcome of trying to turn an "evaluate over time" filter into a value the
|
|
@@ -362,7 +363,13 @@ class EvaluateOverTime {
|
|
|
362
363
|
* it is the safest estimate of the cadence.
|
|
363
364
|
*/
|
|
364
365
|
static getSamplingIntervalInSeconds(data) {
|
|
365
|
-
|
|
366
|
+
/*
|
|
367
|
+
* Through the normalizer first: a monitor storing "5m" has a perfectly
|
|
368
|
+
* well-defined cadence, and treating it as "cadence unknown" made
|
|
369
|
+
* over-time windows fall back to guessing from the data.
|
|
370
|
+
*/
|
|
371
|
+
const configuredIntervalInSeconds = CronTab.getIntervalInSeconds(MonitoringIntervalUtil.toCronOrNull(data.monitoringInterval) ||
|
|
372
|
+
data.monitoringInterval);
|
|
366
373
|
if (configuredIntervalInSeconds !== null) {
|
|
367
374
|
return configuredIntervalInSeconds;
|
|
368
375
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvaluateOverTime.js","sourceRoot":"","sources":["../../../../../../Server/Utils/Monitor/Criteria/EvaluateOverTime.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAEL,kBAAkB,EAElB,oBAAoB,EACpB,YAAY,GACb,MAAM,0CAA0C,CAAC;AAGlD,OAAO,qBAAqB,MAAM,6CAA6C,CAAC;AAEhF,OAAO,aAAa,MAAM,iCAAiC,CAAC;AAC5D,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,SAAS,MAAM,0CAA0C,CAAC;AACjE,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAN,IAAY,wBAmBX;AAnBD,WAAY,wBAAwB;IAClC,iEAAiE;IACjE,2DAA+B,CAAA;IAC/B;;;;OAIG;IACH,uDAA2B,CAAA;IAC3B;;;OAGG;IACH,mDAAuB,CAAA;IACvB;;;OAGG;IACH,iEAAqC,CAAA;AACvC,CAAC,EAnBW,wBAAwB,KAAxB,wBAAwB,QAmBnC;AA8BD,MAAqB,gBAAgB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YAAY,GAChB,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC,gCAAgC,CAAC;QAEnE,MAAM,YAAY,GAAW,cAAc,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;QAEzE;;;;;WAKG;QACH,MAAM,aAAa,GAAW,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC;QAExE,OAAO,YAAY,IAAI,YAAY,IAAI,aAAa,IAAI,YAAY,CAAC;IACvE,CAAC;IAED;;;;;;;OAOG;IACK,MAAM,CAAC,4BAA4B,CAAC,IAG3C;QACC,MAAM,2BAA2B,GAC/B,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"EvaluateOverTime.js","sourceRoot":"","sources":["../../../../../../Server/Utils/Monitor/Criteria/EvaluateOverTime.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,aAAa,MAAM,wBAAwB,CAAC;AAEnD,OAAO,EAEL,kBAAkB,EAElB,oBAAoB,EACpB,YAAY,GACb,MAAM,0CAA0C,CAAC;AAGlD,OAAO,qBAAqB,MAAM,6CAA6C,CAAC;AAEhF,OAAO,aAAa,MAAM,iCAAiC,CAAC;AAC5D,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,SAAS,MAAM,0CAA0C,CAAC;AACjE,OAAO,OAAO,MAAM,eAAe,CAAC;AACpC,OAAO,sBAAsB,MAAM,kDAAkD,CAAC;AACtF,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAN,IAAY,wBAmBX;AAnBD,WAAY,wBAAwB;IAClC,iEAAiE;IACjE,2DAA+B,CAAA;IAC/B;;;;OAIG;IACH,uDAA2B,CAAA;IAC3B;;;OAGG;IACH,mDAAuB,CAAA;IACvB;;;OAGG;IACH,iEAAqC,CAAA;AACvC,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