@oneuptime/common 12.0.8 → 12.0.9
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/MetricItemAggMV1mByK8sCluster.ts +1 -1
- package/Models/AnalyticsModels/MetricItemAggMV1mByService.ts +1 -1
- package/Models/DatabaseModels/AIConversation.ts +32 -0
- package/Models/DatabaseModels/AIConversationMessage.ts +41 -0
- package/Models/DatabaseModels/AlertEpisodeMember.ts +27 -0
- package/Models/DatabaseModels/IncidentEpisodeMember.ts +28 -0
- package/Models/DatabaseModels/Index.ts +12 -4
- package/Models/DatabaseModels/{TelemetryEntity.ts → InventoryItem.ts} +139 -9
- package/Models/DatabaseModels/InventoryItemCustomField.ts +434 -0
- package/Models/DatabaseModels/{TelemetryEntityRelationship.ts → InventoryItemRelationship.ts} +8 -8
- package/Models/DatabaseModels/NetworkDevice.ts +141 -0
- package/Models/DatabaseModels/NetworkDeviceLink.ts +699 -0
- package/Models/DatabaseModels/NetworkDeviceLinkRule.ts +467 -0
- package/Models/DatabaseModels/NetworkTopologySuppression.ts +429 -0
- package/Models/DatabaseModels/OnCallDutyPolicyFeed.ts +9 -0
- package/Models/DatabaseModels/Project.ts +78 -0
- package/Models/DatabaseModels/UserCall.ts +42 -0
- package/Models/DatabaseModels/UserEmail.ts +44 -0
- package/Models/DatabaseModels/UserNotificationRule.ts +425 -55
- package/Models/DatabaseModels/UserOnCallLogTimeline.ts +24 -2
- package/Models/DatabaseModels/UserPush.ts +49 -0
- package/Models/DatabaseModels/UserSMS.ts +43 -0
- package/Models/DatabaseModels/UserTelegram.ts +59 -0
- package/Models/DatabaseModels/UserWebhook.ts +52 -0
- package/Models/DatabaseModels/UserWhatsApp.ts +41 -0
- package/Models/DatabaseModels/WorkflowVariable.ts +12 -0
- package/Server/API/AIChatAPI.ts +315 -1
- package/Server/API/DashboardAPI.ts +217 -1
- package/Server/API/OnCallReadinessAPI.ts +841 -0
- package/Server/API/TeamComplianceAPI.ts +69 -17
- package/Server/API/TelemetryAPI.ts +220 -12
- package/Server/EnvironmentConfig.ts +52 -0
- package/Server/Infrastructure/Postgres/DataSourceOptions.ts +22 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.ts +4 -4
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786200000000-RestoreDroppedUniqueIndexes.ts +5 -5
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.ts +35 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.ts +82 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.ts +91 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.ts +47 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.ts +255 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.ts +107 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.ts +90 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.ts +39 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.ts +33 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.ts +59 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +20 -0
- package/Server/Infrastructure/Queue.ts +78 -13
- package/Server/Middleware/PublicDashboardRateLimit.ts +593 -0
- package/Server/Services/AIService.ts +7 -0
- package/Server/Services/AlertEpisodeStateTimelineService.ts +29 -0
- package/Server/Services/AlertSeverityService.ts +63 -0
- package/Server/Services/DashboardService.ts +9 -10
- package/Server/Services/DatabaseService.ts +32 -2
- package/Server/Services/IncidentEpisodeStateTimelineService.ts +29 -0
- package/Server/Services/IncidentSeverityService.ts +76 -0
- package/Server/Services/Index.ts +12 -4
- package/Server/Services/InventoryItemCustomFieldService.ts +9 -0
- package/Server/Services/{TelemetryEntityRelationshipService.ts → InventoryItemRelationshipService.ts} +4 -4
- package/Server/Services/{TelemetryEntityService.ts → InventoryItemService.ts} +89 -20
- package/Server/Services/LogAggregationService.ts +45 -8
- package/Server/Services/MetricAggregationService.ts +121 -0
- package/Server/Services/MetricService.ts +7 -7
- package/Server/Services/NetworkDeviceLinkRuleService.ts +10 -0
- package/Server/Services/NetworkDeviceLinkService.ts +84 -0
- package/Server/Services/NetworkDeviceService.ts +140 -0
- package/Server/Services/NetworkSiteService.ts +77 -25
- package/Server/Services/NetworkTopologySuppressionService.ts +84 -0
- package/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.ts +41 -29
- package/Server/Services/OnCallDutyPolicyExecutionLogService.ts +8 -0
- package/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.ts +62 -13
- package/Server/Services/OnCallDutyPolicyScheduleService.ts +61 -1
- package/Server/Services/OnCallNotificationAlertingService.ts +742 -0
- package/Server/Services/OnCallReadinessService.ts +2803 -0
- package/Server/Services/OnCallSetupReminderService.ts +955 -0
- package/Server/Services/ProfileAggregationService.ts +123 -0
- package/Server/Services/StatusPageService.ts +9 -10
- package/Server/Services/TeamComplianceService.ts +429 -252
- package/Server/Services/UserCallService.ts +26 -1
- package/Server/Services/UserEmailService.ts +26 -1
- package/Server/Services/UserNotificationRuleAdminService.ts +1183 -0
- package/Server/Services/UserNotificationRuleService.ts +3812 -333
- package/Server/Services/UserOnCallLogService.ts +561 -48
- package/Server/Services/UserPushService.ts +29 -0
- package/Server/Services/UserService.ts +11 -0
- package/Server/Services/UserSmsService.ts +26 -1
- package/Server/Services/UserTelegramService.ts +24 -1
- package/Server/Services/UserWebhookService.ts +28 -1
- package/Server/Services/UserWhatsAppService.ts +24 -1
- package/Server/Types/Database/Permissions/BasePermission.ts +19 -0
- package/Server/Types/Database/Permissions/CreatePermission.ts +164 -0
- package/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.ts +340 -0
- package/Server/Types/Database/Permissions/QueryPermission.ts +48 -0
- package/Server/Types/Database/Permissions/TenantPermission.ts +8 -1
- package/Server/Types/Workflow/Components/API/Delete.ts +1 -1
- package/Server/Types/Workflow/Components/API/Get.ts +1 -1
- package/Server/Types/Workflow/Components/API/Patch.ts +1 -1
- package/Server/Types/Workflow/Components/API/Post.ts +1 -1
- package/Server/Types/Workflow/Components/API/Put.ts +1 -1
- package/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.ts +29 -5
- package/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.ts +18 -10
- package/Server/Types/Workflow/Components/BaseModel/ModelArguments.ts +55 -0
- package/Server/Types/Workflow/Components/Conditions/IfElse.ts +3 -17
- package/Server/Types/Workflow/Components/Email.ts +25 -7
- package/Server/Types/Workflow/Components/JavaScript.ts +10 -3
- package/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.ts +1 -1
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +643 -48
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +32 -3
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +20 -6
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +7 -0
- package/Server/Utils/AI/Toolbox/AIActionTools.ts +2 -2
- package/Server/Utils/AI/Toolbox/AIMetaTools.ts +863 -0
- package/Server/Utils/AI/Toolbox/AlertTools.ts +177 -15
- package/Server/Utils/AI/Toolbox/IncidentTools.ts +191 -10
- package/Server/Utils/AI/Toolbox/Index.ts +48 -0
- package/Server/Utils/AI/Toolbox/MonitorTools.ts +298 -11
- package/Server/Utils/AI/Toolbox/NoteWriteTools.ts +295 -0
- package/Server/Utils/AI/Toolbox/OnCallTools.ts +1246 -0
- package/Server/Utils/AI/Toolbox/RunbookTools.ts +424 -0
- package/Server/Utils/AI/Toolbox/SloTools.ts +456 -0
- package/Server/Utils/AI/Toolbox/StatusPageTools.ts +559 -0
- package/Server/Utils/AI/Toolbox/TeamTools.ts +327 -0
- package/Server/Utils/AI/Toolbox/TimelineTools.ts +615 -0
- package/Server/Utils/AI/Toolbox/WorkflowProbeTools.ts +664 -0
- package/Server/Utils/ClientIp.ts +221 -0
- package/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.ts +47 -0
- package/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.ts +163 -0
- package/Server/Utils/Dashboard/PublicDashboardSloWidget.ts +147 -0
- package/Server/Utils/Express.ts +12 -17
- package/Server/Utils/LLM/LLMService.ts +85 -8
- package/Server/Utils/Monitor/MonitorCriteriaEvaluator.ts +204 -10
- package/Server/Utils/SSRFProtection.ts +98 -23
- package/Server/Utils/StartServer.ts +12 -3
- package/Server/Utils/Telemetry/EntityRegistry.ts +205 -18
- package/Server/Utils/Telemetry/InventoryEntityRegistry.ts +25 -25
- package/Server/Utils/Telemetry/TelemetryEntity.ts +160 -52
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +7 -3
- package/Tests/App/Dashboard/AdminNotificationRulesPage.test.tsx +2146 -0
- package/Tests/App/Dashboard/CreateWorkflowModal.test.tsx +561 -0
- package/Tests/App/Dashboard/EscalationRuleReadiness.test.tsx +2470 -0
- package/Tests/App/Dashboard/OnCallPreventionGuards.test.tsx +1897 -0
- package/Tests/App/Dashboard/OnCallReadinessSurfaces.test.tsx +3606 -0
- package/Tests/App/Dashboard/OnCallRulesDeleteGuard.test.tsx +784 -0
- package/Tests/App/Dashboard/OnCallRulesTable.test.tsx +1119 -0
- package/Tests/App/Dashboard/SloWidgetFetching.test.tsx +531 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistModel.test.ts +1312 -0
- package/Tests/App/Dashboard/UserSettingsSetupChecklistPage.test.tsx +1390 -0
- package/Tests/Models/InventoryItemModel.test.ts +174 -0
- package/Tests/Models/InventoryItemNaming.test.ts +302 -0
- package/Tests/Server/API/AIChatCancelAndFeedback.test.ts +437 -0
- package/Tests/Server/API/DashboardPublicRateLimit.test.ts +659 -0
- package/Tests/Server/API/DashboardPublicResourceListAPI.test.ts +18 -0
- package/Tests/Server/API/DashboardPublicSloAPI.test.ts +880 -0
- package/Tests/Server/API/Helpers.ts +24 -15
- package/Tests/Server/API/OnCallReadinessAPI.test.ts +2680 -0
- package/Tests/Server/API/OnCallSetupReminderAPI.test.ts +915 -0
- package/Tests/Server/Infrastructure/Postgres/EpisodeMemberNotifyIndexesMigration.test.ts +533 -0
- package/Tests/Server/Infrastructure/Postgres/InventoryItemArchiveMigration.test.ts +213 -0
- package/Tests/Server/Infrastructure/Postgres/RenameInventoryItemMigration.test.ts +432 -0
- package/Tests/Server/Infrastructure/Queue.test.ts +293 -0
- package/Tests/Server/Middleware/PublicDashboardRateLimit.test.ts +1645 -0
- package/Tests/Server/Services/AdminRuleEditGuards.test.ts +2848 -0
- package/Tests/Server/Services/DeliverNotificationForRuleExtraction.test.ts +1393 -0
- package/Tests/Server/Services/EpisodeRuleSeverityRepair.test.ts +1802 -0
- package/Tests/Server/Services/EpisodeStateTimelineNote.test.ts +304 -0
- package/Tests/Server/Services/InventoryItemDisplayName.test.ts +339 -0
- package/Tests/Server/Services/{TelemetryEntityManualCreate.test.ts → InventoryItemManualCreate.test.ts} +27 -27
- package/Tests/Server/Services/IpAllowlistSpoofing.test.ts +450 -0
- package/Tests/Server/Services/LogAggregationService.test.ts +235 -1
- package/Tests/Server/Services/MetricAggregationService.test.ts +231 -0
- package/Tests/Server/Services/MetricEntityMVKeyParity.test.ts +80 -29
- package/Tests/Server/Services/MetricServiceAggregate.test.ts +30 -30
- package/Tests/Server/Services/NetworkSiteService.test.ts +18 -3
- package/Tests/Server/Services/NotificationChannelEventCoverage.test.ts +1728 -0
- package/Tests/Server/Services/NotificationDeletionImpact.test.ts +2402 -0
- package/Tests/Server/Services/OnCallDutyPolicyExecutionLogTimelineGapFeed.test.ts +394 -0
- package/Tests/Server/Services/OnCallNotificationFallback.test.ts +1744 -0
- package/Tests/Server/Services/OnCallReadinessService.test.ts +4295 -0
- package/Tests/Server/Services/OnCallSetupReminder.test.ts +1272 -0
- package/Tests/Server/Services/OnCallWeeklyReadinessDigest.test.ts +1021 -0
- package/Tests/Server/Services/ProfileAggregationService.test.ts +296 -0
- package/Tests/Server/Services/SeverityCreationRuleBackfill.test.ts +1536 -0
- package/Tests/Server/Services/SeverityRuleBackfill.test.ts +1818 -0
- package/Tests/Server/Services/TeamComplianceServiceBehaviour.test.ts +1845 -0
- package/Tests/Server/Services/UserNotificationRuleAdminGuards.test.ts +1394 -0
- package/Tests/Server/Services/UserNotificationRuleDefaultCreation.test.ts +1166 -0
- package/Tests/Server/Services/UserNotificationRuleExecuteItem.test.ts +1468 -0
- package/Tests/Server/Services/UserOnCallLogNoNotificationRules.test.ts +1457 -0
- package/Tests/Server/Types/Database/Permissions/AdminNotificationRuleAccess.test.ts +1546 -0
- package/Tests/Server/Types/Database/Permissions/CreateOwnershipScoping.test.ts +529 -0
- package/Tests/Server/Types/Database/Permissions/OwnerOnlyColumns.test.ts +1219 -0
- package/Tests/Server/Types/Database/Permissions/UserNotificationRuleScoping.test.ts +1089 -0
- package/Tests/Server/Types/Workflow/Components/ApiComponentErrorPort.test.ts +2 -1
- package/Tests/Server/Types/Workflow/Components/BaseModelDatabaseComponents.test.ts +190 -0
- package/Tests/Server/Types/Workflow/Components/ChatWebhookComponents.test.ts +44 -14
- package/Tests/Server/Types/Workflow/Components/Email.test.ts +151 -0
- package/Tests/Server/Types/Workflow/Components/IfElse.test.ts +98 -0
- package/Tests/Server/Types/Workflow/Components/JavaScript.test.ts +51 -0
- package/Tests/Server/Utils/AI/AIMetaTools.test.ts +586 -0
- package/Tests/Server/Utils/AI/AlertMonitorFilters.test.ts +582 -0
- package/Tests/Server/Utils/AI/ChatAgentRunner.test.ts +726 -0
- package/Tests/Server/Utils/AI/IncidentToolsFilters.test.ts +315 -0
- package/Tests/Server/Utils/AI/LLMServiceStopReason.test.ts +314 -0
- package/Tests/Server/Utils/AI/LLMServiceToolCalling.test.ts +26 -3
- package/Tests/Server/Utils/AI/NoteWriteTools.test.ts +268 -0
- package/Tests/Server/Utils/AI/ObservabilityChatPrompt.test.ts +169 -0
- package/Tests/Server/Utils/AI/OnCallTools.test.ts +664 -0
- package/Tests/Server/Utils/AI/RunbookTools.test.ts +325 -0
- package/Tests/Server/Utils/AI/SloTools.test.ts +306 -0
- package/Tests/Server/Utils/AI/StatusPageTools.test.ts +391 -0
- package/Tests/Server/Utils/AI/TeamTools.test.ts +257 -0
- package/Tests/Server/Utils/AI/TimelineTools.test.ts +472 -0
- package/Tests/Server/Utils/AI/WorkflowProbeTools.test.ts +428 -0
- package/Tests/Server/Utils/ClientIp.test.ts +438 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.test.ts +171 -0
- package/Tests/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.test.ts +383 -0
- package/Tests/Server/Utils/EntityRegistryRowFence.test.ts +23 -25
- package/Tests/Server/Utils/MicrosoftTeamsWebhookUrlValidation.test.ts +6 -0
- package/Tests/Server/Utils/Monitor/Criteria/DnssecMonitorCriteria.test.ts +307 -0
- package/Tests/Server/Utils/Monitor/Criteria/SSLMonitorCriteria.test.ts +468 -0
- package/Tests/Server/Utils/Monitor/MonitorCriteriaEvaluatorTelemetryDeepLinks.test.ts +460 -0
- package/Tests/Server/Utils/ResponseRateLimitStatusCodes.test.ts +137 -0
- package/Tests/Server/Utils/SSRFProtectionBypasses.test.ts +40 -8
- package/Tests/Server/Utils/SSRFProtectionUserInfo.test.ts +351 -0
- package/Tests/Server/Utils/Telemetry/EntityRegistryRetirement.test.ts +531 -0
- package/Tests/Server/Utils/Telemetry/InventoryEntityRegistry.test.ts +15 -15
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +356 -39
- package/Tests/Types/IP/IP.test.ts +263 -0
- package/Tests/Types/IP/IPWhitelist.test.ts +197 -0
- package/Tests/Types/IP/IPv6.test.ts +12 -1
- package/Tests/Types/Monitor/SnmpOid.test.ts +64 -0
- package/Tests/Types/NetworkDevice/NetworkDeviceMonitoringMethod.test.ts +110 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeAudit.test.ts +106 -0
- package/Tests/Types/OnCallDutyPolicy/LayerUtilMergeDifferential.test.ts +511 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageEndToEnd.test.ts +489 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageGapTolerance.test.ts +479 -0
- package/Tests/Types/OnCallDutyPolicy/ScheduleCoverageState.test.ts +822 -0
- package/Tests/Types/Telemetry/EntityTypeGroups.test.ts +6 -6
- package/Tests/Types/Workflow/BaseModelComponents.test.ts +429 -0
- package/Tests/Types/Workflow/Components/BaseModel.test.ts +225 -0
- package/Tests/Types/Workflow/IntegrationCredentialMetadata.test.ts +100 -0
- package/Tests/Types/Workflow/TemplateSyntax.test.ts +112 -0
- package/Tests/Types/Workflow/Templates.test.ts +916 -101
- package/Tests/UI/Components/ActiveFilterChipsOpenRoute.test.tsx +82 -0
- package/Tests/UI/Components/ComponentsModal.test.tsx +564 -7
- package/Tests/UI/Components/KeyboardShortcut.test.tsx +95 -0
- package/Tests/UI/Components/LogDetailsPanelCrossSignal.test.tsx +448 -0
- package/Tests/UI/Components/LogsTableCrossLinks.test.tsx +263 -0
- package/Tests/UI/Components/PendingProjectInvitations.test.tsx +913 -0
- package/Tests/UI/Components/SimpleLogViewer.test.tsx +228 -0
- package/Tests/UI/Components/TableRowSelectability.test.tsx +312 -0
- package/Tests/UI/Components/Workflow/GraphLint.test.ts +72 -0
- package/Tests/UI/Components/Workflow/GraphLintSummary.test.ts +755 -0
- package/Tests/UI/Components/Workflow/ModelColumnEditor.test.ts +242 -7
- package/Tests/UI/Components/Workflow/ModelColumnEditorServerContract.test.ts +15 -7
- package/Tests/UI/Components/Workflow/ModelSchema.test.ts +242 -28
- package/Tests/UI/Components/Workflow/RunStatusWatcher.test.ts +59 -1
- package/Tests/UI/Components/Workflow/StepTraceViewer.test.tsx +256 -0
- package/Tests/UI/Components/Workflow/UseRunWatch.test.tsx +665 -0
- package/Tests/UI/Components/Workflow/WorkflowIssuesModal.test.tsx +485 -0
- package/Tests/UI/Components/Workflow/WorkflowLogModal.test.tsx +478 -0
- package/Tests/UI/Components/Workflow/WorkflowStatusBar.test.tsx +379 -0
- package/Tests/UI/EsbuildConfig.test.ts +607 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +5 -0
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +11 -4
- package/Tests/UI/Utils/ModelAPICreateMiscData.test.ts +94 -0
- package/Tests/UI/Utils/Platform.test.ts +147 -0
- package/Tests/UI/Utils/ProjectInvitationDisplay.test.ts +357 -0
- package/Tests/Utils/Monitor/NetworkDeviceLinkRuleUtil.test.ts +198 -0
- package/Tests/Utils/Monitor/NetworkTopologyUtil.test.ts +487 -0
- package/Tests/Utils/Telemetry/CrossSignalScope.test.ts +698 -0
- package/Tests/__mocks__/bullmq.js +55 -0
- package/Types/AI/AIChatMessageStatus.ts +8 -1
- package/Types/AI/AIChatTypes.ts +12 -0
- package/Types/Database/AccessControl/OwnerOnlyColumn.ts +88 -0
- package/Types/Exception/ExceptionCode.ts +2 -0
- package/Types/Exception/ServiceUnavailableException.ts +8 -0
- package/Types/Exception/TooManyRequestsException.ts +8 -0
- package/Types/IP/IP.ts +93 -47
- package/Types/Monitor/SnmpMonitor/NetworkTopology.ts +49 -3
- package/Types/NetworkDevice/NetworkDeviceMonitoringMethod.ts +55 -0
- package/Types/OnCallDutyPolicy/Layer.ts +203 -149
- package/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.ts +13 -0
- package/Types/OnCallDutyPolicy/ScheduleShiftUtil.ts +155 -10
- package/Types/Permission.ts +193 -0
- package/Types/Telemetry/EntityRelationshipType.ts +1 -1
- package/Types/Telemetry/EntitySource.ts +1 -1
- package/Types/Telemetry/EntityType.ts +1 -1
- package/Types/Telemetry/EntityTypeGroups.ts +1 -1
- package/Types/Workflow/Components/BaseModel.ts +75 -29
- package/Types/Workflow/Components/Discord.ts +1 -0
- package/Types/Workflow/Components/Email.ts +12 -3
- package/Types/Workflow/Components/JavaScript.ts +7 -0
- package/Types/Workflow/Components/MicrosoftTeams.ts +3 -2
- package/Types/Workflow/Components/Slack.ts +1 -0
- package/Types/Workflow/Components/Telegram.ts +1 -0
- package/Types/Workflow/TemplateSyntax.ts +44 -0
- package/Types/Workflow/Templates.ts +2097 -45
- package/UI/Components/Calendar/Calendar.css +43 -0
- package/UI/Components/Calendar/Calendar.tsx +8 -0
- package/UI/Components/Card/Card.tsx +2 -2
- package/UI/Components/Checkbox/Checkbox.tsx +16 -0
- package/UI/Components/Dictionary/Dictionary.tsx +48 -9
- package/UI/Components/FormModal/BasicFormModal.tsx +2 -1
- package/UI/Components/Header/HeaderIconDropdownButton.tsx +53 -3
- package/UI/Components/Input/Input.tsx +1 -0
- package/UI/Components/KeyboardShortcut/KeyboardKey.ts +185 -0
- package/UI/Components/KeyboardShortcut/KeyboardShortcut.tsx +87 -0
- package/UI/Components/LogsViewer/LogsViewer.tsx +28 -0
- package/UI/Components/LogsViewer/components/ActiveFilterChips.tsx +31 -0
- package/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.tsx +18 -18
- package/UI/Components/LogsViewer/components/LogDetailsPanel.tsx +363 -14
- package/UI/Components/LogsViewer/components/LogsAnalyticsView.tsx +11 -0
- package/UI/Components/LogsViewer/components/LogsTable.tsx +155 -12
- package/UI/Components/LogsViewer/components/LogsViewerToolbar.tsx +29 -0
- package/UI/Components/LogsViewer/types.ts +23 -0
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +9 -2
- package/UI/Components/Navbar/NavBarMenuModal.tsx +15 -30
- package/UI/Components/ProjectInvitations/PendingProjectInvitations.tsx +442 -0
- package/UI/Components/SimpleLogViewer/SimpleLogViewer.tsx +23 -1
- package/UI/Components/Table/Table.tsx +49 -16
- package/UI/Components/Table/TableBody.tsx +53 -28
- package/UI/Components/Table/TableHeader.tsx +13 -0
- package/UI/Components/Table/TableRow.tsx +58 -26
- package/UI/Components/Workflow/ArgumentsForm.tsx +155 -9
- package/UI/Components/Workflow/ComponentReturnValueViewer.tsx +26 -0
- package/UI/Components/Workflow/ComponentSettingsModal.tsx +10 -1
- package/UI/Components/Workflow/ComponentValuePickerModal.tsx +135 -7
- package/UI/Components/Workflow/ComponentsModal.tsx +116 -22
- package/UI/Components/Workflow/DocumentationViewer.tsx +59 -9
- package/UI/Components/Workflow/GraphLint.ts +42 -5
- package/UI/Components/Workflow/GraphLintSummary.ts +390 -0
- package/UI/Components/Workflow/ModelColumnEditor.tsx +154 -22
- package/UI/Components/Workflow/ModelSchema.ts +115 -33
- package/UI/Components/Workflow/RunStatusWatcher.ts +1 -1
- package/UI/Components/Workflow/StepTraceViewer.tsx +1 -1
- package/UI/Components/Workflow/UseRunWatch.ts +212 -0
- package/UI/Components/Workflow/VariableModal.tsx +6 -2
- package/UI/Components/Workflow/Workflow.tsx +49 -3
- package/UI/Components/Workflow/WorkflowIssuesModal.tsx +255 -0
- package/UI/Components/Workflow/WorkflowLogModal.tsx +128 -0
- package/UI/Components/Workflow/WorkflowStatusBar.tsx +224 -0
- package/UI/Utils/AIChatExport/ConversationMarkdown.ts +10 -0
- package/UI/Utils/ModelAPI/ModelAPI.ts +7 -1
- package/UI/Utils/Platform.ts +149 -0
- package/UI/Utils/ProjectInvitationDisplay.ts +118 -0
- package/UI/esbuild-config.js +22 -1
- package/Utils/Monitor/NetworkDeviceLinkRuleUtil.ts +187 -0
- package/Utils/Monitor/NetworkTopologyUtil.ts +888 -164
- package/Utils/Telemetry/CrossSignalScope.ts +502 -0
- package/Utils/Telemetry/EntityKey.ts +5 -5
- package/Utils/Telemetry/EntityRelationship.ts +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByK8sCluster.js +1 -1
- package/build/dist/Models/AnalyticsModels/MetricItemAggMV1mByService.js +1 -1
- package/build/dist/Models/DatabaseModels/AIConversation.js +32 -0
- package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js +42 -0
- package/build/dist/Models/DatabaseModels/AIConversationMessage.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js +28 -0
- package/build/dist/Models/DatabaseModels/AlertEpisodeMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js +29 -0
- package/build/dist/Models/DatabaseModels/IncidentEpisodeMember.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +12 -4
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/{TelemetryEntity.js → InventoryItem.js} +167 -31
- package/build/dist/Models/DatabaseModels/InventoryItem.js.map +1 -0
- package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js +454 -0
- package/build/dist/Models/DatabaseModels/InventoryItemCustomField.js.map +1 -0
- package/build/dist/Models/DatabaseModels/{TelemetryEntityRelationship.js → InventoryItemRelationship.js} +27 -27
- package/build/dist/Models/DatabaseModels/InventoryItemRelationship.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js +141 -0
- package/build/dist/Models/DatabaseModels/NetworkDevice.js.map +1 -1
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js +719 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLink.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js +475 -0
- package/build/dist/Models/DatabaseModels/NetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js +446 -0
- package/build/dist/Models/DatabaseModels/NetworkTopologySuppression.js.map +1 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js +9 -0
- package/build/dist/Models/DatabaseModels/OnCallDutyPolicyFeed.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +80 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserCall.js +46 -2
- package/build/dist/Models/DatabaseModels/UserCall.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserEmail.js +48 -2
- package/build/dist/Models/DatabaseModels/UserEmail.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js +424 -55
- package/build/dist/Models/DatabaseModels/UserNotificationRule.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js +24 -2
- package/build/dist/Models/DatabaseModels/UserOnCallLogTimeline.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserPush.js +51 -1
- package/build/dist/Models/DatabaseModels/UserPush.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserSMS.js +47 -2
- package/build/dist/Models/DatabaseModels/UserSMS.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserTelegram.js +65 -3
- package/build/dist/Models/DatabaseModels/UserTelegram.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWebhook.js +56 -2
- package/build/dist/Models/DatabaseModels/UserWebhook.js.map +1 -1
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js +45 -2
- package/build/dist/Models/DatabaseModels/UserWhatsApp.js.map +1 -1
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js +12 -0
- package/build/dist/Models/DatabaseModels/WorkflowVariable.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +237 -1
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/DashboardAPI.js +165 -13
- package/build/dist/Server/API/DashboardAPI.js.map +1 -1
- package/build/dist/Server/API/OnCallReadinessAPI.js +599 -0
- package/build/dist/Server/API/OnCallReadinessAPI.js.map +1 -0
- package/build/dist/Server/API/TeamComplianceAPI.js +68 -9
- package/build/dist/Server/API/TeamComplianceAPI.js.map +1 -1
- package/build/dist/Server/API/TelemetryAPI.js +129 -18
- package/build/dist/Server/API/TelemetryAPI.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +45 -0
- package/build/dist/Server/EnvironmentConfig.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/DataSourceOptions.js.map +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786100000000-RestoreServiceLowerNameIndex.js +4 -4
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js +18 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786625176831-AddMonitoringMethodToNetworkDevice.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js +39 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786634985763-AddNetworkDeviceLink.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js +38 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639512056-AddNetworkDeviceLinkRule.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js +22 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786639972982-AddNetworkTopologySuppression.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js +150 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786800000000-RenameTelemetryEntityToInventoryItem.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js +57 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1786900000000-AddInventoryItemArchiveAndCustomFields.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js +69 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787000000000-AddOnCallNotificationFallbackColumns.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js +32 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787100000000-AddAIConversationPageContext.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js +26 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787200000000-AddAIChatMessageFeedback.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js +48 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1787300000000-AddEpisodeMemberNotifyIndexes.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +20 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Queue.js +72 -13
- package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
- package/build/dist/Server/Middleware/PublicDashboardRateLimit.js +399 -0
- package/build/dist/Server/Middleware/PublicDashboardRateLimit.js.map +1 -0
- package/build/dist/Server/Services/AIService.js +1 -0
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js +24 -3
- package/build/dist/Server/Services/AlertEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/AlertSeverityService.js +54 -0
- package/build/dist/Server/Services/AlertSeverityService.js.map +1 -1
- package/build/dist/Server/Services/DashboardService.js +10 -9
- package/build/dist/Server/Services/DashboardService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseService.js +24 -2
- package/build/dist/Server/Services/DatabaseService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js +24 -3
- package/build/dist/Server/Services/IncidentEpisodeStateTimelineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentSeverityService.js +67 -0
- package/build/dist/Server/Services/IncidentSeverityService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +12 -4
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/InventoryItemCustomFieldService.js +9 -0
- package/build/dist/Server/Services/InventoryItemCustomFieldService.js.map +1 -0
- package/build/dist/Server/Services/{TelemetryEntityRelationshipService.js → InventoryItemRelationshipService.js} +6 -6
- package/build/dist/Server/Services/InventoryItemRelationshipService.js.map +1 -0
- package/build/dist/Server/Services/{TelemetryEntityService.js → InventoryItemService.js} +68 -23
- package/build/dist/Server/Services/InventoryItemService.js.map +1 -0
- package/build/dist/Server/Services/LogAggregationService.js +27 -8
- package/build/dist/Server/Services/LogAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricAggregationService.js +80 -0
- package/build/dist/Server/Services/MetricAggregationService.js.map +1 -1
- package/build/dist/Server/Services/MetricService.js +6 -6
- package/build/dist/Server/Services/MetricService.js.map +1 -1
- package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js +9 -0
- package/build/dist/Server/Services/NetworkDeviceLinkRuleService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceLinkService.js +71 -0
- package/build/dist/Server/Services/NetworkDeviceLinkService.js.map +1 -0
- package/build/dist/Server/Services/NetworkDeviceService.js +113 -0
- package/build/dist/Server/Services/NetworkDeviceService.js.map +1 -1
- package/build/dist/Server/Services/NetworkSiteService.js +53 -13
- package/build/dist/Server/Services/NetworkSiteService.js.map +1 -1
- package/build/dist/Server/Services/NetworkTopologySuppressionService.js +85 -0
- package/build/dist/Server/Services/NetworkTopologySuppressionService.js.map +1 -0
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js +48 -32
- package/build/dist/Server/Services/OnCallDutyPolicyEscalationRuleScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js +8 -0
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js +51 -12
- package/build/dist/Server/Services/OnCallDutyPolicyExecutionLogTimelineService.js.map +1 -1
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js +57 -13
- package/build/dist/Server/Services/OnCallDutyPolicyScheduleService.js.map +1 -1
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js +548 -0
- package/build/dist/Server/Services/OnCallNotificationAlertingService.js.map +1 -0
- package/build/dist/Server/Services/OnCallReadinessService.js +1961 -0
- package/build/dist/Server/Services/OnCallReadinessService.js.map +1 -0
- package/build/dist/Server/Services/OnCallSetupReminderService.js +738 -0
- package/build/dist/Server/Services/OnCallSetupReminderService.js.map +1 -0
- package/build/dist/Server/Services/ProfileAggregationService.js +68 -4
- package/build/dist/Server/Services/ProfileAggregationService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +11 -10
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamComplianceService.js +312 -160
- package/build/dist/Server/Services/TeamComplianceService.js.map +1 -1
- package/build/dist/Server/Services/UserCallService.js +24 -1
- package/build/dist/Server/Services/UserCallService.js.map +1 -1
- package/build/dist/Server/Services/UserEmailService.js +24 -1
- package/build/dist/Server/Services/UserEmailService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js +858 -0
- package/build/dist/Server/Services/UserNotificationRuleAdminService.js.map +1 -0
- package/build/dist/Server/Services/UserNotificationRuleService.js +2830 -175
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserOnCallLogService.js +488 -43
- package/build/dist/Server/Services/UserOnCallLogService.js.map +1 -1
- package/build/dist/Server/Services/UserPushService.js +26 -0
- package/build/dist/Server/Services/UserPushService.js.map +1 -1
- package/build/dist/Server/Services/UserService.js +10 -0
- package/build/dist/Server/Services/UserService.js.map +1 -1
- package/build/dist/Server/Services/UserSmsService.js +24 -1
- package/build/dist/Server/Services/UserSmsService.js.map +1 -1
- package/build/dist/Server/Services/UserTelegramService.js +22 -1
- package/build/dist/Server/Services/UserTelegramService.js.map +1 -1
- package/build/dist/Server/Services/UserWebhookService.js +25 -1
- package/build/dist/Server/Services/UserWebhookService.js.map +1 -1
- package/build/dist/Server/Services/UserWhatsAppService.js +22 -1
- package/build/dist/Server/Services/UserWhatsAppService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js +12 -1
- package/build/dist/Server/Types/Database/Permissions/BasePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +126 -0
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js +254 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerOnlyColumnPermission.js.map +1 -0
- package/build/dist/Server/Types/Database/Permissions/QueryPermission.js +47 -2
- package/build/dist/Server/Types/Database/Permissions/QueryPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js +7 -0
- package/build/dist/Server/Types/Database/Permissions/TenantPermission.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Delete.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Get.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Patch.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Post.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/API/Put.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js +21 -5
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateManyBaseModel.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js +14 -10
- package/build/dist/Server/Types/Workflow/Components/BaseModel/CreateOneBaseModel.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js +31 -0
- package/build/dist/Server/Types/Workflow/Components/BaseModel/ModelArguments.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js +3 -9
- package/build/dist/Server/Types/Workflow/Components/Conditions/IfElse.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/Email.js +15 -4
- package/build/dist/Server/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js +7 -2
- package/build/dist/Server/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js +1 -1
- package/build/dist/Server/Types/Workflow/Components/MicrosoftTeams/SendMessageToChannel.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +514 -56
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +20 -3
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +19 -6
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +7 -0
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js +2 -2
- package/build/dist/Server/Utils/AI/Toolbox/AIActionTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js +692 -0
- package/build/dist/Server/Utils/AI/Toolbox/AIMetaTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js +148 -12
- package/build/dist/Server/Utils/AI/Toolbox/AlertTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js +157 -10
- package/build/dist/Server/Utils/AI/Toolbox/IncidentTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/Index.js +37 -0
- package/build/dist/Server/Utils/AI/Toolbox/Index.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js +259 -14
- package/build/dist/Server/Utils/AI/Toolbox/MonitorTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js +235 -0
- package/build/dist/Server/Utils/AI/Toolbox/NoteWriteTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js +1000 -0
- package/build/dist/Server/Utils/AI/Toolbox/OnCallTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js +356 -0
- package/build/dist/Server/Utils/AI/Toolbox/RunbookTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js +394 -0
- package/build/dist/Server/Utils/AI/Toolbox/SloTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js +465 -0
- package/build/dist/Server/Utils/AI/Toolbox/StatusPageTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js +280 -0
- package/build/dist/Server/Utils/AI/Toolbox/TeamTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js +527 -0
- package/build/dist/Server/Utils/AI/Toolbox/TimelineTools.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js +548 -0
- package/build/dist/Server/Utils/AI/Toolbox/WorkflowProbeTools.js.map +1 -0
- package/build/dist/Server/Utils/ClientIp.js +137 -0
- package/build/dist/Server/Utils/ClientIp.js.map +1 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js +38 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardResourceListPolicy.js.map +1 -1
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js +89 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloHistoryPolicy.js.map +1 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js +77 -0
- package/build/dist/Server/Utils/Dashboard/PublicDashboardSloWidget.js.map +1 -0
- package/build/dist/Server/Utils/Express.js +12 -12
- package/build/dist/Server/Utils/Express.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +70 -7
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js +121 -11
- package/build/dist/Server/Utils/Monitor/MonitorCriteriaEvaluator.js.map +1 -1
- package/build/dist/Server/Utils/SSRFProtection.js +82 -21
- package/build/dist/Server/Utils/SSRFProtection.js.map +1 -1
- package/build/dist/Server/Utils/StartServer.js +12 -4
- package/build/dist/Server/Utils/StartServer.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +165 -18
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js +11 -11
- package/build/dist/Server/Utils/Telemetry/InventoryEntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js +122 -47
- package/build/dist/Server/Utils/Telemetry/TelemetryEntity.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +7 -3
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/AI/AIChatMessageStatus.js +8 -1
- package/build/dist/Types/AI/AIChatMessageStatus.js.map +1 -1
- package/build/dist/Types/AI/AIChatTypes.js +12 -0
- package/build/dist/Types/AI/AIChatTypes.js.map +1 -1
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js +60 -0
- package/build/dist/Types/Database/AccessControl/OwnerOnlyColumn.js.map +1 -0
- package/build/dist/Types/Exception/ExceptionCode.js +2 -0
- package/build/dist/Types/Exception/ExceptionCode.js.map +1 -1
- package/build/dist/Types/Exception/ServiceUnavailableException.js +8 -0
- package/build/dist/Types/Exception/ServiceUnavailableException.js.map +1 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js +8 -0
- package/build/dist/Types/Exception/TooManyRequestsException.js.map +1 -0
- package/build/dist/Types/IP/IP.js +87 -43
- package/build/dist/Types/IP/IP.js.map +1 -1
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js +50 -0
- package/build/dist/Types/NetworkDevice/NetworkDeviceMonitoringMethod.js.map +1 -0
- package/build/dist/Types/OnCallDutyPolicy/Layer.js +186 -123
- package/build/dist/Types/OnCallDutyPolicy/Layer.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js +13 -0
- package/build/dist/Types/OnCallDutyPolicy/OnCallDutyPolicyStatus.js.map +1 -1
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js +105 -11
- package/build/dist/Types/OnCallDutyPolicy/ScheduleShiftUtil.js.map +1 -1
- package/build/dist/Types/Permission.js +174 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/Telemetry/EntityRelationshipType.js +1 -1
- package/build/dist/Types/Telemetry/EntitySource.js +1 -1
- package/build/dist/Types/Telemetry/EntityType.js +1 -1
- package/build/dist/Types/Telemetry/EntityTypeGroups.js +1 -1
- package/build/dist/Types/Telemetry/EntityTypeGroups.js.map +1 -1
- package/build/dist/Types/Workflow/Components/BaseModel.js +66 -28
- package/build/dist/Types/Workflow/Components/BaseModel.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Discord.js +1 -0
- package/build/dist/Types/Workflow/Components/Discord.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Email.js +12 -3
- package/build/dist/Types/Workflow/Components/Email.js.map +1 -1
- package/build/dist/Types/Workflow/Components/JavaScript.js +7 -0
- package/build/dist/Types/Workflow/Components/JavaScript.js.map +1 -1
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js +3 -2
- package/build/dist/Types/Workflow/Components/MicrosoftTeams.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Slack.js +1 -0
- package/build/dist/Types/Workflow/Components/Slack.js.map +1 -1
- package/build/dist/Types/Workflow/Components/Telegram.js +1 -0
- package/build/dist/Types/Workflow/Components/Telegram.js.map +1 -1
- package/build/dist/Types/Workflow/TemplateSyntax.js +12 -0
- package/build/dist/Types/Workflow/TemplateSyntax.js.map +1 -1
- package/build/dist/Types/Workflow/Templates.js +1931 -38
- package/build/dist/Types/Workflow/Templates.js.map +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js +1 -1
- package/build/dist/UI/Components/Calendar/Calendar.js.map +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js +1 -1
- package/build/dist/UI/Components/Checkbox/Checkbox.js.map +1 -1
- package/build/dist/UI/Components/Dictionary/Dictionary.js +25 -11
- package/build/dist/UI/Components/Dictionary/Dictionary.js.map +1 -1
- package/build/dist/UI/Components/FormModal/BasicFormModal.js.map +1 -1
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js +27 -4
- package/build/dist/UI/Components/Header/HeaderIconDropdownButton.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +1 -0
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js +163 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardKey.js.map +1 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js +47 -0
- package/build/dist/UI/Components/KeyboardShortcut/KeyboardShortcut.js.map +1 -0
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +4 -4
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js +11 -1
- package/build/dist/UI/Components/LogsViewer/components/ActiveFilterChips.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js +10 -8
- package/build/dist/UI/Components/LogsViewer/components/KeyboardShortcutsHelp.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js +227 -14
- package/build/dist/UI/Components/LogsViewer/components/LogDetailsPanel.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js +5 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsAnalyticsView.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js +69 -5
- package/build/dist/UI/Components/LogsViewer/components/LogsTable.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js +8 -0
- package/build/dist/UI/Components/LogsViewer/components/LogsViewerToolbar.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/types.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js +9 -2
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js +8 -21
- package/build/dist/UI/Components/Navbar/NavBarMenuModal.js.map +1 -1
- package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js +251 -0
- package/build/dist/UI/Components/ProjectInvitations/PendingProjectInvitations.js.map +1 -0
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js +9 -2
- package/build/dist/UI/Components/SimpleLogViewer/SimpleLogViewer.js.map +1 -1
- package/build/dist/UI/Components/Table/Table.js +27 -15
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableBody.js +24 -18
- package/build/dist/UI/Components/Table/TableBody.js.map +1 -1
- package/build/dist/UI/Components/Table/TableHeader.js +9 -1
- package/build/dist/UI/Components/Table/TableHeader.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +29 -21
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js +130 -12
- package/build/dist/UI/Components/Workflow/ArgumentsForm.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js +10 -1
- package/build/dist/UI/Components/Workflow/ComponentReturnValueViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js +4 -4
- package/build/dist/UI/Components/Workflow/ComponentSettingsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js +57 -7
- package/build/dist/UI/Components/Workflow/ComponentValuePickerModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ComponentsModal.js +53 -18
- package/build/dist/UI/Components/Workflow/ComponentsModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js +19 -6
- package/build/dist/UI/Components/Workflow/DocumentationViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/GraphLint.js +33 -4
- package/build/dist/UI/Components/Workflow/GraphLint.js.map +1 -1
- package/build/dist/UI/Components/Workflow/GraphLintSummary.js +231 -0
- package/build/dist/UI/Components/Workflow/GraphLintSummary.js.map +1 -0
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js +116 -21
- package/build/dist/UI/Components/Workflow/ModelColumnEditor.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ModelSchema.js +72 -34
- package/build/dist/UI/Components/Workflow/ModelSchema.js.map +1 -1
- package/build/dist/UI/Components/Workflow/RunStatusWatcher.js +1 -1
- package/build/dist/UI/Components/Workflow/RunStatusWatcher.js.map +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js +1 -1
- package/build/dist/UI/Components/Workflow/StepTraceViewer.js.map +1 -1
- package/build/dist/UI/Components/Workflow/UseRunWatch.js +123 -0
- package/build/dist/UI/Components/Workflow/UseRunWatch.js.map +1 -0
- package/build/dist/UI/Components/Workflow/VariableModal.js +3 -2
- package/build/dist/UI/Components/Workflow/VariableModal.js.map +1 -1
- package/build/dist/UI/Components/Workflow/Workflow.js +41 -1
- package/build/dist/UI/Components/Workflow/Workflow.js.map +1 -1
- package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js +99 -0
- package/build/dist/UI/Components/Workflow/WorkflowIssuesModal.js.map +1 -0
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js +56 -0
- package/build/dist/UI/Components/Workflow/WorkflowLogModal.js.map +1 -0
- package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js +92 -0
- package/build/dist/UI/Components/Workflow/WorkflowStatusBar.js.map +1 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js +9 -0
- package/build/dist/UI/Utils/AIChatExport/ConversationMarkdown.js.map +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js +1 -1
- package/build/dist/UI/Utils/ModelAPI/ModelAPI.js.map +1 -1
- package/build/dist/UI/Utils/Platform.js +118 -0
- package/build/dist/UI/Utils/Platform.js.map +1 -0
- package/build/dist/UI/Utils/ProjectInvitationDisplay.js +106 -0
- package/build/dist/UI/Utils/ProjectInvitationDisplay.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js +108 -0
- package/build/dist/Utils/Monitor/NetworkDeviceLinkRuleUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js +642 -136
- package/build/dist/Utils/Monitor/NetworkTopologyUtil.js.map +1 -1
- package/build/dist/Utils/Telemetry/CrossSignalScope.js +328 -0
- package/build/dist/Utils/Telemetry/CrossSignalScope.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityKey.js +5 -5
- package/build/dist/Utils/Telemetry/EntityRelationship.js +1 -1
- package/jest.config.json +1 -0
- package/package.json +1 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntity.js.map +0 -1
- package/build/dist/Models/DatabaseModels/TelemetryEntityRelationship.js.map +0 -1
- package/build/dist/Server/Services/TelemetryEntityRelationshipService.js.map +0 -1
- package/build/dist/Server/Services/TelemetryEntityService.js.map +0 -1
|
@@ -11,6 +11,9 @@ var _a;
|
|
|
11
11
|
import DatabaseRequestType from "../../BaseDatabase/DatabaseRequestType";
|
|
12
12
|
import ColumnPermissions from "./ColumnPermission";
|
|
13
13
|
import TablePermission from "./TablePermission";
|
|
14
|
+
import TenantPermission from "./TenantPermission";
|
|
15
|
+
import NotAuthorizedException from "../../../../Types/Exception/NotAuthorizedException";
|
|
16
|
+
import ObjectID from "../../../../Types/ObjectID";
|
|
14
17
|
import CaptureSpan from "../../../Utils/Telemetry/CaptureSpan";
|
|
15
18
|
export default class CreatePermission {
|
|
16
19
|
static checkCreatePermissions(modelType, data, props) {
|
|
@@ -22,6 +25,129 @@ export default class CreatePermission {
|
|
|
22
25
|
this.checkCreateBlockPermissions(modelType, props);
|
|
23
26
|
TablePermission.checkTableLevelPermissions(modelType, props, DatabaseRequestType.Create);
|
|
24
27
|
ColumnPermissions.checkDataColumnPermissions(modelType, data, props, DatabaseRequestType.Create);
|
|
28
|
+
CreatePermission.checkCreateOwnership(modelType, data, props);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Constrain the VALUE of a user-scoped model's ownership column, not merely
|
|
32
|
+
* whether the caller is allowed to write that column at all.
|
|
33
|
+
*
|
|
34
|
+
* Read, update and delete all convert Permission.CurrentUser into a row
|
|
35
|
+
* predicate: TenantPermission.addCurrentUserScopeToQuery rewrites the query to
|
|
36
|
+
* `userId = me` and rejects any operation that named somebody else. Create had
|
|
37
|
+
* no equivalent. The three checks above answer "may this caller write to this
|
|
38
|
+
* table" and "may this caller write to these COLUMNS" — neither receives the
|
|
39
|
+
* ownership value, and TablePermission.checkTableLevelPermissions is not even
|
|
40
|
+
* handed the data object. So @CurrentUserCanAccessRecordBy was effectively
|
|
41
|
+
* dead metadata on this path, and the carve-out is explicit in the sibling
|
|
42
|
+
* code: TenantPermission's misconfiguration guard reads
|
|
43
|
+
* `isAccessGrantedOnlyByCurrentUser && type !== DatabaseRequestType.Create`.
|
|
44
|
+
*
|
|
45
|
+
* The consequence was that a caller could write a row owned by somebody else
|
|
46
|
+
* on any model whose create list is CurrentUser-only — fourteen of them, all
|
|
47
|
+
* "my own X" resources: notification rules and every notification method
|
|
48
|
+
* behind them, sessions, TOTP and WebAuthn credentials. On the notification
|
|
49
|
+
* models that is not a bookkeeping error. A row's ownership column decides
|
|
50
|
+
* whose on-call pages select it, while the delivery address is read from the
|
|
51
|
+
* method relation the row points at, so a mismatched pair sends one person's
|
|
52
|
+
* pages to another person's address. Some services also seed further rows from
|
|
53
|
+
* whatever ownership value they are handed, which propagates the mistake
|
|
54
|
+
* without any further request.
|
|
55
|
+
*
|
|
56
|
+
* The check is permission-AWARE rather than a blanket stamp, and that
|
|
57
|
+
* distinction is load-bearing. Stamping `data[userColumn] = props.userId`
|
|
58
|
+
* unconditionally would make legitimate on-behalf-of creation impossible for
|
|
59
|
+
* an administrator who genuinely holds a role permission in the model's create
|
|
60
|
+
* list — so instead this mirrors exactly the condition the query-side scope
|
|
61
|
+
* uses. When CurrentUser is the ONLY thing letting the caller through, they
|
|
62
|
+
* may create rows for themselves and nobody else. When they hold a real role
|
|
63
|
+
* permission, this returns and that permission's own rules apply.
|
|
64
|
+
*
|
|
65
|
+
* props.isRoot short-circuits before this runs, so internal seeding (default
|
|
66
|
+
* notification rules, invitation acceptance, migrations) is unaffected.
|
|
67
|
+
*/
|
|
68
|
+
static checkCreateOwnership(modelType, data, props) {
|
|
69
|
+
const model = new modelType();
|
|
70
|
+
const userColumn = model.getUserColumn();
|
|
71
|
+
if (!userColumn) {
|
|
72
|
+
// The model does not scope rows by user; there is no ownership to enforce.
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const isAccessGrantedOnlyByCurrentUser = TenantPermission.isAccessGrantedOnlyByCurrentUser(modelType, props, DatabaseRequestType.Create);
|
|
76
|
+
if (!isAccessGrantedOnlyByCurrentUser) {
|
|
77
|
+
/*
|
|
78
|
+
* The caller holds a role permission that appears in this model's create
|
|
79
|
+
* list, so they are not here purely as "some logged-in user". Whatever
|
|
80
|
+
* that permission is allowed to do is decided by the permission itself.
|
|
81
|
+
*/
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
/*
|
|
85
|
+
* CurrentUser is auto-granted to every authenticated caller, including API
|
|
86
|
+
* keys, which have no user identity. Such a grant can never be resolved to
|
|
87
|
+
* an owner, so reject it rather than writing an unowned row. This mirrors
|
|
88
|
+
* the equivalent guard on the query side.
|
|
89
|
+
*/
|
|
90
|
+
if (!props.userId) {
|
|
91
|
+
throw new NotAuthorizedException(`A user session is required to create ${model.singularName}.`);
|
|
92
|
+
}
|
|
93
|
+
/*
|
|
94
|
+
* The ownership column has TWO spellings and both write the same database
|
|
95
|
+
* column.
|
|
96
|
+
*
|
|
97
|
+
* A user-scoped model declares a scalar (`userId`) and a ManyToOne relation
|
|
98
|
+
* (`user`) whose @JoinColumn names that same scalar. Both are separately
|
|
99
|
+
* decorated, both are separately creatable, and TypeORM resolves either into
|
|
100
|
+
* the one join column. Checking only the scalar would therefore close
|
|
101
|
+
* nothing: a payload sending `user: { _id: <someone else> }` and no `userId`
|
|
102
|
+
* reaches this method with the scalar absent, gets the caller's own id
|
|
103
|
+
* stamped onto it, and then hands the persistence layer two disagreeing
|
|
104
|
+
* instructions about who owns the row.
|
|
105
|
+
*
|
|
106
|
+
* So the relation is validated identically and then CLEARED. Clearing rather
|
|
107
|
+
* than merely rejecting a mismatch removes the ambiguity entirely — after
|
|
108
|
+
* this method the scalar is the single source of ownership, and no
|
|
109
|
+
* TypeORM-version-dependent precedence rule between the two spellings can
|
|
110
|
+
* change who the row belongs to.
|
|
111
|
+
*
|
|
112
|
+
* The relation's property name is the scalar minus its `Id` suffix, which
|
|
113
|
+
* holds for every user-scoped model in the schema. A model that does not
|
|
114
|
+
* follow it simply has no relation to clear, and the scalar check below
|
|
115
|
+
* still applies.
|
|
116
|
+
*/
|
|
117
|
+
const relationColumn = userColumn.endsWith("Id")
|
|
118
|
+
? userColumn.slice(0, -2)
|
|
119
|
+
: "";
|
|
120
|
+
const suppliedOwnerRelation = relationColumn
|
|
121
|
+
? data.getColumnValue(relationColumn)
|
|
122
|
+
: undefined;
|
|
123
|
+
if (suppliedOwnerRelation !== undefined &&
|
|
124
|
+
suppliedOwnerRelation !== null &&
|
|
125
|
+
typeof suppliedOwnerRelation === "object") {
|
|
126
|
+
const relationOwnerId = suppliedOwnerRelation["_id"];
|
|
127
|
+
if (relationOwnerId !== undefined &&
|
|
128
|
+
relationOwnerId !== null &&
|
|
129
|
+
String(relationOwnerId) !== props.userId.toString()) {
|
|
130
|
+
throw new NotAuthorizedException(`You do not have permission to create another user's ${model.singularName}.`);
|
|
131
|
+
}
|
|
132
|
+
data.setColumnValue(relationColumn, undefined);
|
|
133
|
+
}
|
|
134
|
+
const suppliedOwner = data.getColumnValue(userColumn);
|
|
135
|
+
if (suppliedOwner === undefined || suppliedOwner === null) {
|
|
136
|
+
/*
|
|
137
|
+
* Omitting the column is the common case for a first-party client, which
|
|
138
|
+
* has no reason to send its own id back. Stamp it rather than leaving the
|
|
139
|
+
* row unowned — an unowned row is invisible to every scoped read, so it
|
|
140
|
+
* would be undeletable through the API that created it.
|
|
141
|
+
*/
|
|
142
|
+
data.setColumnValue(userColumn, props.userId);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const suppliedOwnerId = suppliedOwner instanceof ObjectID
|
|
146
|
+
? suppliedOwner.toString()
|
|
147
|
+
: String(suppliedOwner);
|
|
148
|
+
if (suppliedOwnerId !== props.userId.toString()) {
|
|
149
|
+
throw new NotAuthorizedException(`You do not have permission to create another user's ${model.singularName}.`);
|
|
150
|
+
}
|
|
25
151
|
}
|
|
26
152
|
static checkCreateBlockPermissions(modelType, props) {
|
|
27
153
|
// If system is making this query then let the query run!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreatePermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/CreatePermission.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AACzE,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,eAAe,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"CreatePermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/CreatePermission.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AACzE,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAChD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAGlD,OAAO,sBAAsB,MAAM,oDAAoD,CAAC;AACxF,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,WAAW,MAAM,sCAAsC,CAAC;AAE/D,MAAM,CAAC,OAAO,OAAO,gBAAgB;IAErB,AAAP,MAAM,CAAC,sBAAsB,CAClC,SAAiC,EACjC,IAAgB,EAChB,KAAqC;QAErC,yDAAyD;QACzD,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACxC,OAAO;QACT,CAAC;QAED,2FAA2F;QAC3F,IAAI,CAAC,2BAA2B,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAEnD,eAAe,CAAC,0BAA0B,CACxC,SAAS,EACT,KAAK,EACL,mBAAmB,CAAC,MAAM,CAC3B,CAAC;QAEF,iBAAiB,CAAC,0BAA0B,CAC1C,SAAS,EACT,IAAI,EACJ,KAAK,EACL,mBAAmB,CAAC,MAAM,CAC3B,CAAC;QAEF,gBAAgB,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IA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 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { getOwnerOnlyColumns, isOwnerOnlyColumn, } from "../../../../Types/Database/AccessControl/OwnerOnlyColumn";
|
|
11
|
+
import TableColumnType from "../../../../Types/Database/TableColumnType";
|
|
12
|
+
import NotAuthorizedException from "../../../../Types/Exception/NotAuthorizedException";
|
|
13
|
+
import ObjectID from "../../../../Types/ObjectID";
|
|
14
|
+
import CaptureSpan from "../../../Utils/Telemetry/CaptureSpan";
|
|
15
|
+
/*
|
|
16
|
+
* THE RULE, IN ONE SENTENCE.
|
|
17
|
+
*
|
|
18
|
+
* A column marked @OwnerOnlyColumn() may be read only when the query that
|
|
19
|
+
* reaches its row is pinned to the caller's own id. The owner reading their own
|
|
20
|
+
* settings passes. An administrator reading somebody else's does not - whether
|
|
21
|
+
* they come at the column directly, or sideways through a relation, or by
|
|
22
|
+
* ordering on it, or by probing it in a WHERE clause.
|
|
23
|
+
*
|
|
24
|
+
* WHY A COLUMN-PERMISSION LIST CANNOT EXPRESS THIS. Permission.CurrentUser is
|
|
25
|
+
* auto-granted to every authenticated caller, so it never means "only my own
|
|
26
|
+
* row" in a COLUMN list - row scoping comes from the TABLE list alone. This
|
|
27
|
+
* class therefore ignores permissions entirely and looks at the QUERY: not who
|
|
28
|
+
* is asking, but which rows the request is allowed to touch.
|
|
29
|
+
*
|
|
30
|
+
* THE FOUR ROUTES INTO A MARKED COLUMN. All four are closed here, because
|
|
31
|
+
* closing three of them is the same as closing none:
|
|
32
|
+
*
|
|
33
|
+
* 1. A top-level select - `select: { webhookUrl: true }` on UserWebhook.
|
|
34
|
+
* checkSelectPermission(), called from BasePermission.
|
|
35
|
+
*
|
|
36
|
+
* 2. A select nested through a relation - `select: { userWebhook: {
|
|
37
|
+
* webhookUrl: true } }` on UserNotificationRule. checkRelationSelect(),
|
|
38
|
+
* called from inside QueryPermission's relation traversal. This is the
|
|
39
|
+
* route an earlier attempt missed, and it is the one that matters most:
|
|
40
|
+
* widening a rule table's read to administrators does not widen the method
|
|
41
|
+
* tables' reads, so a nested select is how the credential escapes without
|
|
42
|
+
* anything appearing to have been widened at all.
|
|
43
|
+
*
|
|
44
|
+
* 3. A sort key - `sort: { webhookUrl: "ASC" }`. DatabaseService adds sorted
|
|
45
|
+
* columns to the select AFTER the permission layer has run, so the gate is
|
|
46
|
+
* simply not in the path; isOwnerOnlyColumnOnModel() lets that code refuse
|
|
47
|
+
* to add a marked column.
|
|
48
|
+
*
|
|
49
|
+
* 4. A WHERE predicate - `query: { webhookUrl: "https://..." }`. Equality on a
|
|
50
|
+
* secret is a value oracle: enough queries and the value is read out one
|
|
51
|
+
* guess at a time, with nothing ever selected. checkQueryPermission().
|
|
52
|
+
*
|
|
53
|
+
* FAIL CLOSED. No caller identity, no ownership column on the model, a query
|
|
54
|
+
* shape this code does not recognise, or an ownership predicate that names
|
|
55
|
+
* anything other than exactly one id - the caller's - all refuse. The cost of a
|
|
56
|
+
* false refusal is a visible error on a settings page. The cost of a false
|
|
57
|
+
* allowance is a colleague's phone number.
|
|
58
|
+
*/
|
|
59
|
+
export default class OwnerOnlyColumnPermission {
|
|
60
|
+
/**
|
|
61
|
+
* Route 1 - a marked column named directly in the select of the model that
|
|
62
|
+
* owns it.
|
|
63
|
+
*/
|
|
64
|
+
static checkSelectPermission(modelType, query, select, props) {
|
|
65
|
+
if (OwnerOnlyColumnPermission.isPrivilegedInternalRead(props)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const model = new modelType();
|
|
69
|
+
for (const columnName in select) {
|
|
70
|
+
if (!isOwnerOnlyColumn(model, columnName)) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (!OwnerOnlyColumnPermission.isQueryPinnedToCurrentUser(modelType, query, props)) {
|
|
74
|
+
throw OwnerOnlyColumnPermission.refusal(model, columnName);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Route 2 - a marked column named through a relation, where the OUTER query
|
|
80
|
+
* is the only thing that decides whether the related rows belong to the
|
|
81
|
+
* caller.
|
|
82
|
+
*
|
|
83
|
+
* The outer query is what gets checked, and it has to be. By the time the
|
|
84
|
+
* traversal reaches `userWebhook: { webhookUrl: true }` there is no separate
|
|
85
|
+
* permission pass over UserWebhook at all: the related rows are whichever
|
|
86
|
+
* rows the outer query's join drags in. So the question is not "may this
|
|
87
|
+
* caller read UserWebhook" - it is "is the outer query confined to rows this
|
|
88
|
+
* caller owns", and that is answered by the outer model's own ownership
|
|
89
|
+
* column.
|
|
90
|
+
*/
|
|
91
|
+
static checkRelationSelect(data) {
|
|
92
|
+
if (OwnerOnlyColumnPermission.isPrivilegedInternalRead(data.props)) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const relatedModel = new data.relatedModelType();
|
|
96
|
+
if (!isOwnerOnlyColumn(relatedModel, data.relatedColumnName)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (OwnerOnlyColumnPermission.isQueryPinnedToCurrentUser(data.modelType, data.query, data.props)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
const model = new data.modelType();
|
|
103
|
+
throw new NotAuthorizedException(`You do not have permissions to read ${data.relatedColumnName} of ${relatedModel.singularName} through ${data.relationColumnName} on ${model.singularName}. This column belongs to the user it was created for, so it can only be read by a query restricted to your own records.`);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Route 4 - a marked column used as a query predicate. Reading a value and
|
|
107
|
+
* guessing it are the same disclosure given enough attempts, so a WHERE on a
|
|
108
|
+
* marked column is held to the identical standard as a select on it. Nested
|
|
109
|
+
* relation filters are walked too, because `{ userWebhook: { webhookUrl: x } }`
|
|
110
|
+
* probes exactly the same value from one level out.
|
|
111
|
+
*/
|
|
112
|
+
static checkQueryPermission(modelType, query, props) {
|
|
113
|
+
if (OwnerOnlyColumnPermission.isPrivilegedInternalRead(props)) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
const model = new modelType();
|
|
117
|
+
for (const columnName in query) {
|
|
118
|
+
if (isOwnerOnlyColumn(model, columnName)) {
|
|
119
|
+
if (!OwnerOnlyColumnPermission.isQueryPinnedToCurrentUser(modelType, query, props)) {
|
|
120
|
+
throw OwnerOnlyColumnPermission.refusal(model, columnName);
|
|
121
|
+
}
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
const value = query[columnName];
|
|
125
|
+
if (!OwnerOnlyColumnPermission.isPlainObject(value)) {
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
const tableColumnMetadata = model.getTableColumnMetadata(columnName);
|
|
129
|
+
if (!tableColumnMetadata ||
|
|
130
|
+
!tableColumnMetadata.modelType ||
|
|
131
|
+
(tableColumnMetadata.type !== TableColumnType.Entity &&
|
|
132
|
+
tableColumnMetadata.type !== TableColumnType.EntityArray)) {
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
const relatedModel = new tableColumnMetadata.modelType();
|
|
136
|
+
for (const relatedColumnName in value) {
|
|
137
|
+
if (!isOwnerOnlyColumn(relatedModel, relatedColumnName)) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
if (!OwnerOnlyColumnPermission.isQueryPinnedToCurrentUser(modelType, query, props)) {
|
|
141
|
+
throw new NotAuthorizedException(`You do not have permissions to query on ${relatedColumnName} of ${relatedModel.singularName} through ${columnName} on ${model.singularName}. This column belongs to the user it was created for, so it can only be queried by a request restricted to your own records.`);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Route 3's building block. DatabaseService injects sorted columns into the
|
|
148
|
+
* select after the permission layer has already run, and it has no query it
|
|
149
|
+
* can trust by then (the query has been serialized into Raw operators), so it
|
|
150
|
+
* asks the only question it can answer safely: is this column marked. A
|
|
151
|
+
* marked column that the caller legitimately selected is already in the
|
|
152
|
+
* select and is never re-added, so refusing here costs a legitimate reader
|
|
153
|
+
* nothing.
|
|
154
|
+
*/
|
|
155
|
+
static isOwnerOnlyColumnOnModel(modelType, columnName) {
|
|
156
|
+
return isOwnerOnlyColumn(new modelType(), columnName);
|
|
157
|
+
}
|
|
158
|
+
static getOwnerOnlyColumnsOnModel(modelType) {
|
|
159
|
+
return getOwnerOnlyColumns(new modelType());
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* "Pinned to the caller" means the query constrains this model's
|
|
163
|
+
* @CurrentUserCanAccessRecordBy column to exactly one id, and that id is the
|
|
164
|
+
* caller's.
|
|
165
|
+
*
|
|
166
|
+
* Every part of that sentence is load bearing:
|
|
167
|
+
*
|
|
168
|
+
* - props.userId absent - an API key or a system caller can hold the
|
|
169
|
+
* auto-granted CurrentUser permission with no user identity at all. There
|
|
170
|
+
* is no id to pin to, so there is no pinning.
|
|
171
|
+
*
|
|
172
|
+
* - no ownership column - the model has no notion of an owner, so no query
|
|
173
|
+
* against it can be owner-scoped. A marked column on such a model is a
|
|
174
|
+
* modelling mistake; refuse rather than invent a scope.
|
|
175
|
+
*
|
|
176
|
+
* - exactly one id - operators are the trap. NotEqual, Includes, IsNull and
|
|
177
|
+
* friends all stringify to (or contain) the id they wrap, so comparing
|
|
178
|
+
* string values alone would let `userId != me` pass itself off as `userId
|
|
179
|
+
* = me` while selecting every OTHER row in the project. Compare the TYPE
|
|
180
|
+
* first: only a bare string or ObjectID is an exact predicate. This is the
|
|
181
|
+
* same test, and for the same reason, as TenantPermission.isExactUserScope.
|
|
182
|
+
*
|
|
183
|
+
* - an array of queries is refused outright. That shape is produced only by
|
|
184
|
+
* the multi-tenant fan-out in TenantPermission, which re-enters the whole
|
|
185
|
+
* permission stack once per project and so has already applied this check
|
|
186
|
+
* per project with a real single query. Recognising the array here would
|
|
187
|
+
* mean reasoning about a shape whose ownership predicate has already been
|
|
188
|
+
* rewritten into a Raw operator; refusing it is both safe and, in
|
|
189
|
+
* practice, unreachable.
|
|
190
|
+
*/
|
|
191
|
+
static isQueryPinnedToCurrentUser(modelType, query, props) {
|
|
192
|
+
if (!props.userId) {
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
if (!query || typeof query !== "object" || Array.isArray(query)) {
|
|
196
|
+
return false;
|
|
197
|
+
}
|
|
198
|
+
const model = new modelType();
|
|
199
|
+
const ownershipColumn = model.getUserColumn();
|
|
200
|
+
if (!ownershipColumn) {
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
const ownershipPredicate = query[ownershipColumn];
|
|
204
|
+
if (!OwnerOnlyColumnPermission.isExactUserScope(ownershipPredicate)) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
return ownershipPredicate.toString() === props.userId.toString();
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Root and master admin short-circuit before any of this. Notification
|
|
211
|
+
* delivery reads these exact columns as root in order to actually send the
|
|
212
|
+
* page - a phone number it cannot read is a phone that never rings - and the
|
|
213
|
+
* whole on-call system stops if that path is closed.
|
|
214
|
+
*/
|
|
215
|
+
static isPrivilegedInternalRead(props) {
|
|
216
|
+
return Boolean(props.isRoot) || Boolean(props.isMasterAdmin);
|
|
217
|
+
}
|
|
218
|
+
static isExactUserScope(value) {
|
|
219
|
+
return typeof value === "string" || value instanceof ObjectID;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* A plain `{}` literal, as opposed to a query operator instance such as
|
|
223
|
+
* Includes or NotEqual, which are also objects but carry their own class.
|
|
224
|
+
*/
|
|
225
|
+
static isPlainObject(value) {
|
|
226
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
const prototype = Object.getPrototypeOf(value);
|
|
230
|
+
return prototype === Object.prototype || prototype === null;
|
|
231
|
+
}
|
|
232
|
+
static refusal(model, columnName) {
|
|
233
|
+
return new NotAuthorizedException(`You do not have permissions to read ${columnName} on ${model.singularName}. This column belongs to the user it was created for, so it can only be read by a query restricted to your own records.`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
__decorate([
|
|
237
|
+
CaptureSpan(),
|
|
238
|
+
__metadata("design:type", Function),
|
|
239
|
+
__metadata("design:paramtypes", [Object, Object, Object, Object]),
|
|
240
|
+
__metadata("design:returntype", void 0)
|
|
241
|
+
], OwnerOnlyColumnPermission, "checkSelectPermission", null);
|
|
242
|
+
__decorate([
|
|
243
|
+
CaptureSpan(),
|
|
244
|
+
__metadata("design:type", Function),
|
|
245
|
+
__metadata("design:paramtypes", [Object]),
|
|
246
|
+
__metadata("design:returntype", void 0)
|
|
247
|
+
], OwnerOnlyColumnPermission, "checkRelationSelect", null);
|
|
248
|
+
__decorate([
|
|
249
|
+
CaptureSpan(),
|
|
250
|
+
__metadata("design:type", Function),
|
|
251
|
+
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
252
|
+
__metadata("design:returntype", void 0)
|
|
253
|
+
], OwnerOnlyColumnPermission, "checkQueryPermission", null);
|
|
254
|
+
//# sourceMappingURL=OwnerOnlyColumnPermission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OwnerOnlyColumnPermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/OwnerOnlyColumnPermission.ts"],"names":[],"mappings":";;;;;;;;;AAMA,OAAO,EACL,mBAAmB,EACnB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b,WAAW,EAAE;;;;2DAiEb"}
|
|
@@ -9,6 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
};
|
|
10
10
|
import DatabaseRequestType from "../../BaseDatabase/DatabaseRequestType";
|
|
11
11
|
import ColumnPermissions from "./ColumnPermission";
|
|
12
|
+
import OwnerOnlyColumnPermission from "./OwnerOnlyColumnPermission";
|
|
12
13
|
import DatabaseCommonInteractionPropsUtil, { PermissionType, } from "../../../../Types/BaseDatabase/DatabaseCommonInteractionPropsUtil";
|
|
13
14
|
import MultiSearch from "../../../../Types/BaseDatabase/MultiSearch";
|
|
14
15
|
import TableColumnType from "../../../../Types/Database/TableColumnType";
|
|
@@ -18,7 +19,19 @@ import CaptureSpan from "../../../Utils/Telemetry/CaptureSpan";
|
|
|
18
19
|
import { PermissionHelper, } from "../../../../Types/Permission";
|
|
19
20
|
import Typeof from "../../../../Types/Typeof";
|
|
20
21
|
export default class QueryPermission {
|
|
21
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Validates every column reached through a relation in the select.
|
|
24
|
+
*
|
|
25
|
+
* Takes the OUTER query as well as the select because two of the checks below
|
|
26
|
+
* cannot be answered from the select alone. Which COLUMNS a relation may
|
|
27
|
+
* expose is a property of the related model (canReadOnRelationQuery, the
|
|
28
|
+
* column's own read permissions); which ROWS the relation will expose is a
|
|
29
|
+
* property of the outer query, and nothing else - the related rows are
|
|
30
|
+
* whichever ones the join drags in. An owner-only column needs both answers,
|
|
31
|
+
* so the outer query is threaded down here rather than left behind in
|
|
32
|
+
* BasePermission.
|
|
33
|
+
*/
|
|
34
|
+
static checkRelationQueryPermission(modelType, query, select, props) {
|
|
22
35
|
const model = new modelType();
|
|
23
36
|
const userPermissions = DatabaseCommonInteractionPropsUtil.getUserPermissions(props, PermissionType.Allow).map((i) => {
|
|
24
37
|
return i.permission;
|
|
@@ -46,6 +59,28 @@ export default class QueryPermission {
|
|
|
46
59
|
if (!getRelatedTableColumnMetadata) {
|
|
47
60
|
throw new BadDataException(`Column ${innerKey} not found on ${relatedModel.singularName}`);
|
|
48
61
|
}
|
|
62
|
+
/*
|
|
63
|
+
* Owner-only columns are checked BEFORE the canReadOnRelationQuery
|
|
64
|
+
* short-circuit below, and that ordering is the whole point.
|
|
65
|
+
* canReadOnRelationQuery is a modelling flag meaning "this column is
|
|
66
|
+
* safe to surface as a label on a joined row"; it skips every
|
|
67
|
+
* permission check that follows it. The seven notification-method
|
|
68
|
+
* models set it on their identifier columns so that a user's own
|
|
69
|
+
* rule table can render "Email: jane@example.com" - which is
|
|
70
|
+
* correct, and which is also exactly how an administrator's widened
|
|
71
|
+
* read of the RULE table reaches into the METHOD table and lifts a
|
|
72
|
+
* phone number, an email address or a webhook URL belonging to
|
|
73
|
+
* somebody else. Nothing downstream of the `continue` can stop it,
|
|
74
|
+
* so the check has to happen here.
|
|
75
|
+
*/
|
|
76
|
+
OwnerOnlyColumnPermission.checkRelationSelect({
|
|
77
|
+
modelType: modelType,
|
|
78
|
+
relationColumnName: key,
|
|
79
|
+
relatedModelType: tableColumnMetadata.modelType,
|
|
80
|
+
relatedColumnName: innerKey,
|
|
81
|
+
query: query,
|
|
82
|
+
props: props,
|
|
83
|
+
});
|
|
49
84
|
if (!getRelatedTableColumnMetadata.canReadOnRelationQuery &&
|
|
50
85
|
!excludedColumnNames.includes(innerKey)) {
|
|
51
86
|
throw new BadDataException(`Column ${innerKey} on ${relatedModel.singularName} does not support read on relation query.`);
|
|
@@ -72,6 +107,16 @@ export default class QueryPermission {
|
|
|
72
107
|
}
|
|
73
108
|
static checkQueryPermission(modelType, query, props) {
|
|
74
109
|
const model = new modelType();
|
|
110
|
+
/*
|
|
111
|
+
* A WHERE clause reads a value just as surely as a SELECT does, one guess
|
|
112
|
+
* at a time. The name-intersection below authorises a predicate on any
|
|
113
|
+
* column the caller may READ, and Permission.CurrentUser being auto-granted
|
|
114
|
+
* means an owner-only column passes that intersection for everybody - so
|
|
115
|
+
* `{ webhookUrl: "https://hooks.slack.com/services/T.../B.../x" }` is a
|
|
116
|
+
* confirm/deny oracle over somebody else's credential that never appears in
|
|
117
|
+
* any result set. Hold a predicate to the same standard as a select.
|
|
118
|
+
*/
|
|
119
|
+
OwnerOnlyColumnPermission.checkQueryPermission(modelType, query, props);
|
|
75
120
|
const userPermissions = DatabaseCommonInteractionPropsUtil.getUserPermissions(props, PermissionType.Allow);
|
|
76
121
|
const canReadOnTheseColumns = ColumnPermissions.getModelColumnsByPermissions(modelType, userPermissions || [], DatabaseRequestType.Read);
|
|
77
122
|
const tableColumns = model.getTableColumns().columns;
|
|
@@ -119,7 +164,7 @@ export default class QueryPermission {
|
|
|
119
164
|
__decorate([
|
|
120
165
|
CaptureSpan(),
|
|
121
166
|
__metadata("design:type", Function),
|
|
122
|
-
__metadata("design:paramtypes", [Object, Object, Object]),
|
|
167
|
+
__metadata("design:paramtypes", [Object, Object, Object, Object]),
|
|
123
168
|
__metadata("design:returntype", void 0)
|
|
124
169
|
], QueryPermission, "checkRelationQueryPermission", null);
|
|
125
170
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryPermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/QueryPermission.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AAGzE,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"QueryPermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/QueryPermission.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AAGzE,OAAO,iBAAiB,MAAM,oBAAoB,CAAC;AACnD,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AAKpE,OAAO,kCAAkC,EAAE,EACzC,cAAc,GACf,MAAM,mEAAmE,CAAC;AAC3E,OAAO,WAAW,MAAM,4CAA4C,CAAC;AAGrE,OAAO,eAAe,MAAM,4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C,CAAC,CAAC,EAAE,CACP,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACf,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA3Ne;IADb,WAAW,EAAE;;;;yDA0Hb;AAGa;IADb,WAAW,EAAE;;;;iDA+Fb"}
|
|
@@ -173,6 +173,13 @@ export default class TenantPermission {
|
|
|
173
173
|
* True if the only permission letting this user through the table-level
|
|
174
174
|
* check for this op is Permission.CurrentUser. In that case the query must
|
|
175
175
|
* be restricted to rows the user owns (via the model's user column).
|
|
176
|
+
*
|
|
177
|
+
* Public because CreatePermission needs exactly this predicate. Create never
|
|
178
|
+
* reaches addTenantScopeToQuery (see the `type !== DatabaseRequestType.Create`
|
|
179
|
+
* carve-out above), so it enforces ownership on the DATA rather than on a
|
|
180
|
+
* query — but it must decide "is this caller here purely as some logged-in
|
|
181
|
+
* user, or do they hold a real role permission" identically, or the two paths
|
|
182
|
+
* would disagree about who may act on whose rows.
|
|
176
183
|
*/
|
|
177
184
|
static isAccessGrantedOnlyByCurrentUser(modelType, props, type) {
|
|
178
185
|
const modelPermissions = TablePermission.getTablePermission(modelType, type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TenantPermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/TenantPermission.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AAGzE,OAAO,cAAgD,MAAM,kBAAkB,CAAC;AAChF,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAE/D,OAAO,kCAAkC,EAAE,EACzC,cAAc,GACf,MAAM,mEAAmE,CAAC;AAC3E,OAAO,gBAAgB,MAAM,8CAA8C,CAAC;AAC5E,OAAO,sBAAsB,MAAM,oDAAoD,CAAC;AACxF,OAAO,QAAQ,MAAM,4BAA4B,CAAC;AAClD,OAAO,UAAU,MAAM,8BAA8B,CAA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YAAY,CAAC,QAAQ,EAAE,KAAM,KAAK,CAAC,MAAmB,CAAC,QAAQ,EAAE,EACjE,CAAC;gBACD,MAAM,IAAI,sBAAsB,CAC9B,8CAA8C,KAAK,CAAC,YAAY,GAAG,CACpE,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,0BAA0B,CACvC,KAAgB,EAChB,KAAwB,EACxB,MAAgB;QAEhB,MAAM,UAAU,GAAW,KAAK,CAAC,aAAa,EAAY,CAAC;QAC3D,MAAM,iBAAiB,GAAa,KAAa,CAAC,UAAU,CAAC,CAAC;QAE9D,IACE,iBAAiB,KAAK,SAAS;YAC/B,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;gBACpD,iBAAiB,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,QAAQ,EAAE,CAAC,EACrD,CAAC;YACD,MAAM,IAAI,sBAAsB,CAC9B,uDAAuD,KAAK,CAAC,YAAY,GAAG,CAC7E,CAAC;QACJ,CAAC;QAEA,KAAa,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC;IACtC,CAAC;IAED;;;;;OAKG;IACK,MAAM,CAAC,gBAAgB,CAAC,KAAc;QAC5C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,QAAQ,CAAC;IAChE,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"TenantPermission.js","sourceRoot":"","sources":["../../../../../../Server/Types/Database/Permissions/TenantPermission.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,mBAAmB,MAAM,wCAAwC,CAAC;AAGzE,OAAO,cAAgD,MAAM,kBAAkB,CAAC;AAChF,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAEhD,OAAO,QAAQ,MAAM,yCAAyC,CAAC;AAE/D,OAAO,kCAAkC,EAAE,EACzC,cAAc,GACf,MAAM,mEAAmE,CAAC;AAC3E,OAAO,g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Q,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YACvD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,eAAe,GACnB,kCAAkC,CAAC,kBAAkB,CACnD,KAAK,EACL,cAAc,CAAC,KAAK,CACrB,CAAC,GAAG,CAAC,CAAC,EAA8B,EAAE,EAAE;YACvC,OAAO,EAAE,CAAC,UAAU,CAAC;QACvB,CAAC,CAAC,CAAC;QAEL,MAAM,YAAY,GAAsB,eAAe,CAAC,MAAM,CAC5D,CAAC,CAAa,EAAE,EAAE;YAChB,OAAO,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC,CACF,CAAC;QAEF,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;YACnD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,UAAU,GAAsB,YAAY,CAAC,MAAM,CACvD,CAAC,CAAa,EAAE,EAAE;YAChB,OAAO,CAAC,+BAA+B,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QACtD,CAAC,CACF,CAAC;QAEF,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC;IACjC,CAAC;CACF;AA9QqB;IADnB,WAAW,EAAE;;;;mDAqLb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Delete.js","sourceRoot":"","sources":["../../../../../../../Server/Types/Workflow/Components/API/Delete.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,aAA4C,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAI3E,OAAO,gBAAgB,MAAM,iDAAiD,CAAC;AAK/E,OAAO,WAAW,MAAM,2CAA2C,CAAC;AACpE,OAAO,aAAa,MAAM,8CAA8C,CAAC;AACzE,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAC3C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W,EAAE,MAAM,CAAC,WAAW;aAChC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;gBACrC,OAAO,OAAO,CAAC,OAAO,CAAC;oBACrB,YAAY,EAAE,iBAAiB,CAAC,eAAe,CAAC,GAAG,CAAC;oBACpD,WAAW,EAAE,MAAM,CAAC,SAAS;iBAC9B,CAAC,CAAC;YACL,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,OAAO,CAAC,OAAO,CAAC;oBACrB,YAAY,EAAE,iBAAiB,CAAC,eAAe,CAAC,SAAS,CAAC;oBAC1D,WAAW,EAAE,MAAM,CAAC,SAAS;iBAC9B,CAAC,CAAC;YACL,CAAC;YAED,OAAO,OAAO,CAAC,OAAO,CAAC;gBACrB,YAAY,EAAE;oBACZ,
|
|
1
|
+
{"version":3,"file":"Delete.js","sourceRoot":"","sources":["../../../../../../../Server/Types/Workflow/Components/API/Delete.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,aAA4C,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,iBAAiB,MAAM,4CAA4C,CAAC;AAI3E,OAAO,gBAAgB,MAAM,iDAAiD,CAAC;AAK/E,OAAO,WAAW,MAAM,2CAA2C,CAAC;AACpE,OAAO,aAAa,MAAM,8CAA8C,CAAC;AACzE,OAAO,GAAG,MAAM,0BAA0B,CAAC;AAC3C,OAAO,WAAW,MAAM,yCAAyC,CAAC;AAElE,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,aAAa;IAClD;QACE,KAAK,EAAE,CAAC;QAER,MAAM,SAAS,GAAkC,aAAa,CAAC,IAAI,CACjE,CAAC,CAAoB,EAAE,EAAE;YACvB,OAAO,CAAC,CAAC,EAAE,KAAK,WAAW,CAAC,SAAS,CAAC;QACxC,CAAC,CACF,CAAC;QAEF,IAAI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