@oneuptime/common 14.0.9 → 14.0.11
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/DatabaseModels/AIConversation.ts +127 -1
- package/Models/DatabaseModels/AutoRemediationSuggestion.ts +60 -0
- package/Models/DatabaseModels/CephCluster.ts +225 -0
- package/Models/DatabaseModels/CloudResource.ts +12 -0
- package/Models/DatabaseModels/DatabaseServer.ts +225 -0
- package/Models/DatabaseModels/DockerHost.ts +225 -0
- package/Models/DatabaseModels/DockerSwarmCluster.ts +225 -0
- package/Models/DatabaseModels/GlobalConfig.ts +1 -1
- package/Models/DatabaseModels/GlobalOidc.ts +0 -4
- package/Models/DatabaseModels/GlobalOidcProject.ts +0 -4
- package/Models/DatabaseModels/GlobalSso.ts +0 -4
- package/Models/DatabaseModels/GlobalSsoProject.ts +0 -4
- package/Models/DatabaseModels/Host.ts +225 -0
- package/Models/DatabaseModels/IncidentForm.ts +594 -0
- package/Models/DatabaseModels/IncidentFormSubmission.ts +283 -0
- package/Models/DatabaseModels/IncidentTemplate.ts +59 -0
- package/Models/DatabaseModels/Index.ts +16 -0
- package/Models/DatabaseModels/IoTFleet.ts +12 -0
- package/Models/DatabaseModels/KubernetesCluster.ts +12 -0
- package/Models/DatabaseModels/MessageQueue.ts +1102 -0
- package/Models/DatabaseModels/MessageQueueLabelRule.ts +553 -0
- package/Models/DatabaseModels/MessageQueueOwnerRule.ts +633 -0
- package/Models/DatabaseModels/MessageQueueOwnerTeam.ts +491 -0
- package/Models/DatabaseModels/MessageQueueOwnerUser.ts +490 -0
- package/Models/DatabaseModels/PodmanHost.ts +225 -0
- package/Models/DatabaseModels/Project.ts +59 -0
- package/Models/DatabaseModels/ProjectOidc.ts +0 -4
- package/Models/DatabaseModels/ProjectSso.ts +0 -4
- package/Models/DatabaseModels/ProxmoxCluster.ts +225 -0
- package/Models/DatabaseModels/ResourceAiAgent.ts +419 -0
- package/Models/DatabaseModels/RumApplication.ts +12 -0
- package/Models/DatabaseModels/RunnerJob.ts +144 -0
- package/Models/DatabaseModels/ServerlessFunction.ts +12 -0
- package/Models/DatabaseModels/Service.ts +12 -0
- package/Models/DatabaseModels/StatusPageOidc.ts +0 -4
- package/Models/DatabaseModels/StatusPageSso.ts +0 -4
- package/Models/DatabaseModels/TeamComplianceSetting.ts +47 -2
- package/Models/DatabaseModels/VMwareVCenter.ts +225 -0
- package/Server/API/AIChatAPI.ts +13 -114
- package/Server/API/AIInvestigationAPI.ts +3 -3
- package/Server/API/AIInvestigationConversationAPI.ts +266 -0
- package/Server/API/AutoRemediationAPI.ts +392 -1
- package/Server/API/IncidentFormAPI.ts +376 -0
- package/Server/API/ProjectOIDC.ts +16 -25
- package/Server/API/ProjectSSO.ts +16 -24
- package/Server/API/ResourceAiAccessAPI.ts +1669 -0
- package/Server/API/StatusPageAPI.ts +42 -77
- package/Server/Enterprise/EnterpriseEdition.ts +93 -28
- package/Server/Enterprise/EnterpriseFeature.ts +25 -3
- package/Server/Enterprise/EnterpriseLicenseSnapshot.ts +1 -1
- package/Server/Enterprise/EnterpriseServerModule.ts +4 -1
- package/Server/EnvironmentConfig.ts +1 -1
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796300000000-AddResourceAiAgents.ts +423 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796400000000-AddIncidentForms.ts +129 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796500000000-AddTeamComplianceRuleNotificationChannels.ts +52 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796600000000-AddAIInvestigationConversationAndTimeLimits.ts +75 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/1796700000000-AddMessageQueueTables.ts +477 -0
- package/Server/Infrastructure/Postgres/SchemaMigrations/Index.ts +10 -0
- package/Server/Infrastructure/Semaphore.ts +22 -0
- package/Server/Middleware/IncidentFormRateLimit.ts +847 -0
- package/Server/Middleware/TelemetryIngest.ts +15 -5
- package/Server/Middleware/UserAuthorization.ts +16 -38
- package/Server/Services/AIService.ts +10 -13
- package/Server/Services/AnalyticsDatabaseService.ts +45 -1
- package/Server/Services/AutoRemediationRuleEngineService.ts +940 -112
- package/Server/Services/CephClusterService.ts +109 -1
- package/Server/Services/DatabaseServerService.ts +116 -1
- package/Server/Services/DockerHostService.ts +109 -1
- package/Server/Services/DockerSwarmClusterService.ts +113 -1
- package/Server/Services/HostService.ts +126 -4
- package/Server/Services/IncidentCustomFieldService.ts +112 -2
- package/Server/Services/IncidentEpisodeMemberService.ts +24 -4
- package/Server/Services/IncidentEpisodeService.ts +10 -1
- package/Server/Services/IncidentFormService.ts +1566 -0
- package/Server/Services/IncidentFormSubmissionService.ts +97 -0
- package/Server/Services/IncidentGroupingEngineService.ts +45 -8
- package/Server/Services/IncidentService.ts +123 -5
- package/Server/Services/IncidentTemplateService.ts +22 -0
- package/Server/Services/Index.ts +14 -0
- package/Server/Services/MessageQueueLabelRuleEngineService.ts +321 -0
- package/Server/Services/MessageQueueLabelRuleService.ts +14 -0
- package/Server/Services/MessageQueueOwnerRuleEngineService.ts +412 -0
- package/Server/Services/MessageQueueOwnerRuleService.ts +14 -0
- package/Server/Services/MessageQueueOwnerTeamService.ts +62 -0
- package/Server/Services/MessageQueueOwnerUserService.ts +62 -0
- package/Server/Services/MessageQueueService.ts +1463 -0
- package/Server/Services/MetricRecordingRuleService.ts +47 -0
- package/Server/Services/OpenTelemetryIngestService.ts +37 -4
- package/Server/Services/PodmanHostService.ts +109 -1
- package/Server/Services/ProjectService.ts +0 -59
- package/Server/Services/ProxmoxClusterService.ts +110 -1
- package/Server/Services/ResourceAiAccessService.ts +1439 -0
- package/Server/Services/ResourceAiAgentJobService.ts +202 -0
- package/Server/Services/ResourceAiAgentService.ts +2432 -0
- package/Server/Services/RunnerJobService.ts +611 -4
- package/Server/Services/StatusPagePrivateUserService.ts +1 -4
- package/Server/Services/StatusPageService.ts +1 -51
- package/Server/Services/TeamComplianceSettingService.ts +163 -42
- package/Server/Services/TelemetryUsageBillingService.ts +28 -0
- package/Server/Services/TraceRecordingRuleService.ts +33 -0
- package/Server/Services/UserNotificationRuleService.ts +8 -1
- package/Server/Services/VMwareVCenterService.ts +110 -1
- package/Server/Services/WorkspaceNotificationSummaryService.ts +12 -3
- package/Server/Types/Database/Permissions/CreatePermission.ts +17 -3
- package/Server/Types/Database/Permissions/EditionPermission.ts +140 -38
- package/Server/Types/Database/Permissions/OwnerTableRegistry.ts +16 -0
- package/Server/Types/Database/Permissions/TablePermission.ts +3 -3
- package/Server/Types/Database/Permissions/UpdatePermission.ts +20 -6
- package/Server/Utils/AI/Chat/AgentContextCompactor.ts +200 -0
- package/Server/Utils/AI/Chat/ChatAgentRunner.ts +307 -48
- package/Server/Utils/AI/Chat/ChatRunCancellation.ts +156 -0
- package/Server/Utils/AI/Chat/ObservabilityAssistant.ts +78 -18
- package/Server/Utils/AI/Chat/ObservabilityChatPrompt.ts +1 -1
- package/Server/Utils/AI/Chat/ToolOutputPager.ts +322 -0
- package/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.ts +88 -30
- package/Server/Utils/AI/ClusterAccess/KubectlJobRunner.ts +13 -1
- package/Server/Utils/AI/CodeFix/CodeFixReadiness.ts +0 -32
- package/Server/Utils/AI/CodeFix/FixRunBudget.ts +27 -25
- package/Server/Utils/AI/Remediation/RemediationCommandTools.ts +1442 -34
- package/Server/Utils/AI/Remediation/RemediationExecutionRunner.ts +968 -34
- package/Server/Utils/AI/Remediation/RemediationPlanRunner.ts +25 -1
- package/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.ts +622 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAccessContext.ts +271 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAccessToolNames.ts +45 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.ts +964 -0
- package/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.ts +333 -0
- package/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.ts +882 -0
- package/Server/Utils/AI/SRE/AIInvestigationEngine.ts +125 -12
- package/Server/Utils/AI/SRE/AlertInvestigationRunner.ts +99 -15
- package/Server/Utils/AI/SRE/IncidentInvestigationRunner.ts +99 -15
- package/Server/Utils/AI/SRE/InvestigationQueue.ts +16 -19
- package/Server/Utils/AI/SRE/InvestigationThread.ts +646 -0
- package/Server/Utils/AI/SRE/InvestigationThreadService.ts +715 -0
- package/Server/Utils/AI/Toolbox/Serializer.ts +10 -3
- package/Server/Utils/AutoRemediation/CommandPlanExecutor.ts +396 -13
- package/Server/Utils/AutoRemediation/RemediationVerifier.ts +35 -2
- package/Server/Utils/Database/ProjectScopedReferenceValidator.ts +9 -1
- package/Server/Utils/EditionEnforcement.ts +19 -202
- package/Server/Utils/LLM/LLMService.ts +259 -63
- package/Server/Utils/RelaxedScimTeamLocksReport.ts +245 -0
- package/Server/Utils/Rules/RuleRun/RuleRunRegistry.ts +25 -0
- package/Server/Utils/SameOriginRequest.ts +203 -0
- package/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.ts +920 -0
- package/Server/Utils/SessionReplay/SessionReplayUsage.ts +84 -6
- package/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.ts +2 -0
- package/Server/Utils/Telemetry/EntityRegistry.ts +4 -1
- package/Server/Utils/Telemetry/MessageQueueDiscovery.ts +1402 -0
- package/Server/Utils/Telemetry/ResourceEntityFilter.ts +4 -1
- package/Server/Utils/VendorAssets.ts +3 -3
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.ts +35 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.ts +33 -15
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.ts +21 -1
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.ts +301 -225
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.ts +38 -16
- package/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.ts +389 -175
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.ts +376 -144
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.ts +163 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.ts +396 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.ts +418 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.ts +152 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.ts +251 -0
- package/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.ts +214 -0
- package/Tests/App/Accounts/IncidentFormPage.test.tsx +2036 -0
- package/Tests/App/Accounts/IncidentFormServerMessages.test.ts +119 -0
- package/Tests/App/Accounts/IncidentFormUtils.test.ts +1157 -0
- package/Tests/App/Accounts/LoginPasskey.test.tsx +6 -4
- package/Tests/App/Accounts/LoginSso.test.tsx +724 -0
- package/Tests/App/AdminDashboard/AdminAuthenticationRequireSso.test.tsx +338 -0
- package/Tests/App/AdminDashboard/AdminAuthenticationSsoCardLocales.test.tsx +331 -0
- package/Tests/App/AdminDashboard/AdminEnterprisePluginPage.test.tsx +47 -33
- package/Tests/App/AdminDashboard/GlobalSsoOidcPages.test.tsx +1021 -0
- package/Tests/App/Dashboard/AffectedResourcesDisplay.test.tsx +876 -78
- package/Tests/App/Dashboard/AffectedResourcesSlo.test.tsx +20 -3
- package/Tests/App/Dashboard/CephProxmoxVMwareDocumentationCards.test.tsx +359 -0
- package/Tests/App/Dashboard/CephSetupGuide.test.ts +961 -0
- package/Tests/App/Dashboard/CloudDocumentationCard.test.tsx +381 -95
- package/Tests/App/Dashboard/CloudSetupGuide.test.ts +1463 -0
- package/Tests/App/Dashboard/ClusterAccessNotice.test.tsx +267 -12
- package/Tests/App/Dashboard/ContainerSetupGuideCards.test.tsx +345 -0
- package/Tests/App/Dashboard/CoreListEmptyStates.test.tsx +501 -0
- package/Tests/App/Dashboard/DashboardLazyPages.test.tsx +0 -1
- package/Tests/App/Dashboard/DatabaseDocumentationCard.test.tsx +400 -0
- package/Tests/App/Dashboard/DatabaseDocumentationMarkdown.test.ts +23 -6
- package/Tests/App/Dashboard/DatabaseSetupGuide.test.ts +1869 -0
- package/Tests/App/Dashboard/DatabaseTelemetryScope.test.ts +44 -0
- package/Tests/App/Dashboard/DatabaseTelemetryTabs.test.tsx +50 -9
- package/Tests/App/Dashboard/DockerSetupGuide.test.ts +899 -0
- package/Tests/App/Dashboard/DockerSwarmSetupGuide.test.ts +964 -0
- package/Tests/App/Dashboard/EnterpriseFeatureUpgrade.test.tsx +141 -7
- package/Tests/App/Dashboard/EnterprisePluginPage.test.tsx +52 -39
- package/Tests/App/Dashboard/EventOverviewPages.test.tsx +7 -1
- package/Tests/App/Dashboard/GettingStartedTaskRoutes.test.tsx +331 -0
- package/Tests/App/Dashboard/HomeOverviewStatsFirstRun.test.tsx +925 -0
- package/Tests/App/Dashboard/HostDocumentationCard.test.tsx +225 -0
- package/Tests/App/Dashboard/HostSetupGuide.test.ts +1183 -0
- package/Tests/App/Dashboard/IdentityEnterpriseShells.test.tsx +69 -45
- package/Tests/App/Dashboard/IncidentCreateTemplateCustomFieldSettings.test.tsx +745 -0
- package/Tests/App/Dashboard/IncidentCreateTemplateOwners.test.tsx +414 -0
- package/Tests/App/Dashboard/IncidentCustomFieldCreateSettingsForm.test.ts +1042 -0
- package/Tests/App/Dashboard/IncidentCustomFieldSettingsCard.test.tsx +1816 -0
- package/Tests/App/Dashboard/IncidentFormPlan.test.ts +89 -0
- package/Tests/App/Dashboard/IncidentFormShareLinkCard.test.tsx +846 -0
- package/Tests/App/Dashboard/IncidentFormsPages.test.tsx +1324 -0
- package/Tests/App/Dashboard/IncidentTemplateCustomFieldSettings.test.tsx +630 -0
- package/Tests/App/Dashboard/IncidentsSideMenu.test.tsx +13 -0
- package/Tests/App/Dashboard/IncomingEmailMonitorLinkVerifyHint.test.tsx +104 -0
- package/Tests/App/Dashboard/InvestigationConversation.test.tsx +1107 -0
- package/Tests/App/Dashboard/InvestigationConversationData.test.ts +546 -0
- package/Tests/App/Dashboard/InvestigationEvidenceList.test.tsx +170 -5
- package/Tests/App/Dashboard/InvestigationInfrastructureTools.test.tsx +506 -0
- package/Tests/App/Dashboard/InvestigationNotStarted.test.tsx +207 -2
- package/Tests/App/Dashboard/InvestigationPanel.test.tsx +729 -34
- package/Tests/App/Dashboard/InvestigationPanelStatus.test.tsx +9 -21
- package/Tests/App/Dashboard/InvestigationReportView.test.tsx +274 -37
- package/Tests/App/Dashboard/InvestigationStatusBadge.test.tsx +130 -0
- package/Tests/App/Dashboard/IoTDocumentationCard.test.tsx +218 -0
- package/Tests/App/Dashboard/IoTSetupGuide.test.ts +1124 -0
- package/Tests/App/Dashboard/KubernetesClusterAiAccessSettings.test.ts +20 -6
- package/Tests/App/Dashboard/KubernetesClusterAiDocumentationMarkdown.test.ts +107 -83
- package/Tests/App/Dashboard/KubernetesSetupGuide.test.ts +787 -0
- package/Tests/App/Dashboard/MessageQueueBreadcrumbs.test.tsx +228 -0
- package/Tests/App/Dashboard/MessageQueueBrokerHealth.test.tsx +1538 -0
- package/Tests/App/Dashboard/MessageQueueBrokerHealthMetricChart.test.tsx +969 -0
- package/Tests/App/Dashboard/MessageQueueBrokerHealthReads.test.ts +889 -0
- package/Tests/App/Dashboard/MessageQueueBrokerMetricsReach.test.ts +236 -0
- package/Tests/App/Dashboard/MessageQueueDocumentationCard.test.tsx +479 -0
- package/Tests/App/Dashboard/MessageQueueListPages.test.tsx +1232 -0
- package/Tests/App/Dashboard/MessageQueueMetricDescriptions.test.ts +244 -0
- package/Tests/App/Dashboard/MessageQueueMonitorLink.test.ts +952 -0
- package/Tests/App/Dashboard/MessageQueueMonitorLinkMonitorCreate.test.tsx +859 -0
- package/Tests/App/Dashboard/MessageQueueOverview.test.tsx +1773 -0
- package/Tests/App/Dashboard/MessageQueueOverviewPresentation.test.ts +196 -0
- package/Tests/App/Dashboard/MessageQueuePresentation.test.ts +799 -0
- package/Tests/App/Dashboard/MessageQueueProducersConsumers.test.tsx +680 -0
- package/Tests/App/Dashboard/MessageQueueRoutes.test.tsx +383 -0
- package/Tests/App/Dashboard/MessageQueueRulePages.test.tsx +278 -0
- package/Tests/App/Dashboard/MessageQueueSetupGuide.test.ts +2778 -0
- package/Tests/App/Dashboard/MessageQueueSideMenus.test.tsx +273 -0
- package/Tests/App/Dashboard/MessageQueueSpanPopulations.test.ts +930 -0
- package/Tests/App/Dashboard/MessageQueueSpanStore.ts +351 -0
- package/Tests/App/Dashboard/MessageQueueTelemetryScope.test.ts +375 -0
- package/Tests/App/Dashboard/MessageQueueTelemetryScopeTabs.test.tsx +668 -0
- package/Tests/App/Dashboard/MessageQueueViewPages.test.tsx +685 -0
- package/Tests/App/Dashboard/MonitorAndHomeNotOperationalMenus.test.tsx +342 -0
- package/Tests/App/Dashboard/MonitorCreateFirstRunDefaults.test.tsx +623 -0
- package/Tests/App/Dashboard/MonitorCreateFromMonitorBackedDevice.test.tsx +442 -0
- package/Tests/App/Dashboard/MonitorLogsPageViewSummary.test.tsx +814 -0
- package/Tests/App/Dashboard/MonitorSetupCardBodies.test.tsx +246 -0
- package/Tests/App/Dashboard/NavigationSearchKeywords.test.tsx +8 -0
- package/Tests/App/Dashboard/OnboardingSsoEmptyState.test.tsx +27 -12
- package/Tests/App/Dashboard/PlanGatedPage.test.tsx +292 -0
- package/Tests/App/Dashboard/PodmanSetupGuide.test.ts +948 -0
- package/Tests/App/Dashboard/ProductOrientation.test.tsx +5 -4
- package/Tests/App/Dashboard/ProductSettingsSectionCollapsed.test.tsx +266 -0
- package/Tests/App/Dashboard/ProxmoxSetupGuide.test.ts +1318 -0
- package/Tests/App/Dashboard/RemediationSuggestionCardDescription.test.tsx +209 -0
- package/Tests/App/Dashboard/RemediationSuggestionCardResource.test.tsx +317 -0
- package/Tests/App/Dashboard/ResourceAiAccessSettingsUtil.test.ts +921 -0
- package/Tests/App/Dashboard/ResourceAiAgentAttentionServerParity.test.ts +555 -0
- package/Tests/App/Dashboard/ResourceAiAgentInstall.test.ts +860 -0
- package/Tests/App/Dashboard/ResourceAiAgentPage.test.tsx +2010 -0
- package/Tests/App/Dashboard/ResourceAiAgentStatus.test.ts +1455 -0
- package/Tests/App/Dashboard/ResourceAiInsightsPage.test.tsx +931 -0
- package/Tests/App/Dashboard/ResourceAiNavigation.test.tsx +575 -0
- package/Tests/App/Dashboard/ResourceArchiveSettings.test.tsx +16 -0
- package/Tests/App/Dashboard/ResourceConnectionGuideCard.test.tsx +444 -0
- package/Tests/App/Dashboard/ResourceConnectionGuideOverviewsInfra.test.tsx +798 -0
- package/Tests/App/Dashboard/ResourceConnectionGuideOverviewsPlatforms.test.tsx +717 -0
- package/Tests/App/Dashboard/ResourceConnectionGuides.test.ts +981 -0
- package/Tests/App/Dashboard/ResourceConnectionState.test.ts +132 -0
- package/Tests/App/Dashboard/RumDocumentationCard.test.tsx +293 -0
- package/Tests/App/Dashboard/RumSessionReplayRetentionSettings.test.tsx +467 -0
- package/Tests/App/Dashboard/RumSetupGuide.test.ts +758 -0
- package/Tests/App/Dashboard/RunbookStepTypeMaps.test.ts +38 -7
- package/Tests/App/Dashboard/ScheduledMaintenanceOverviewPage.test.tsx +25 -0
- package/Tests/App/Dashboard/ServerlessDocumentationCard.test.tsx +254 -0
- package/Tests/App/Dashboard/ServerlessSetupGuide.test.ts +1074 -0
- package/Tests/App/Dashboard/SetupGuide.test.ts +246 -0
- package/Tests/App/Dashboard/SetupGuideCard.test.tsx +756 -0
- package/Tests/App/Dashboard/SloListSideMenu.test.tsx +120 -0
- package/Tests/App/Dashboard/SsoPages.test.tsx +833 -0
- package/Tests/App/Dashboard/TelemetryDocumentation.test.tsx +253 -0
- package/Tests/App/Dashboard/TelemetryRetentionShells.test.tsx +730 -0
- package/Tests/App/Dashboard/VMwareSetupGuide.test.ts +1033 -0
- package/Tests/App/StatusPage/StatusPageSsoEmptyState.test.tsx +87 -7
- package/Tests/Models/DatabaseModels/DatabaseServerModels.test.ts +61 -10
- package/Tests/Models/DatabaseModels/IncidentFormModel.test.ts +1250 -0
- package/Tests/Models/DatabaseModels/MessageQueueModels.test.ts +1983 -0
- package/Tests/Models/DatabaseModels/ResourceAiAccessColumns.test.ts +738 -0
- package/Tests/Models/DatabaseModels/ResourceAiAgentModel.test.ts +842 -0
- package/Tests/Models/DatabaseModels/StaticRuleCriteriaInheritance.test.ts +4 -2
- package/Tests/Models/DatabaseModels/TeamComplianceSettingModel.test.ts +190 -14
- package/Tests/Models/IncidentTemplateCustomFieldSettingsColumn.test.ts +291 -0
- package/Tests/Server/API/AIInvestigationConversationAPI.test.ts +412 -0
- package/Tests/Server/API/AutoRemediationApproveResourceRound.test.ts +835 -0
- package/Tests/Server/API/GlobalConfigLicense.test.ts +38 -9
- package/Tests/Server/API/IncidentFormAPI.test.ts +942 -0
- package/Tests/Server/API/IncidentFormPublicRoutes.test.ts +1653 -0
- package/Tests/Server/API/KubernetesClusterAiAccessAPI.test.ts +2 -1
- package/Tests/Server/API/ResourceAiAccessAPI.test.ts +2730 -0
- package/Tests/Server/API/{SsoProviderListingsEdition.test.ts → SsoProviderListings.test.ts} +164 -110
- package/Tests/Server/Enterprise/EnterpriseEdition.test.ts +76 -54
- package/Tests/Server/Enterprise/EnterpriseFeatureActive.test.ts +125 -42
- package/Tests/Server/Enterprise/EnterpriseLicenseSnapshot.test.ts +36 -10
- package/Tests/Server/Enterprise/EnterpriseModelFeatureMap.test.ts +51 -9
- package/Tests/Server/Enterprise/FakeEnterpriseModule.ts +13 -8
- package/Tests/Server/Enterprise/SsoInCommunityEdition.test.ts +540 -0
- package/Tests/Server/Infrastructure/Postgres/AddConfigurableRuleCriteriaMigration.test.ts +3 -0
- package/Tests/Server/Infrastructure/Postgres/AddDatabaseServerTablesMigration.test.ts +60 -0
- package/Tests/Server/Infrastructure/Postgres/AddIncidentFormsMigration.test.ts +438 -0
- package/Tests/Server/Infrastructure/Postgres/AddResourceAiAgentsMigration.test.ts +659 -0
- package/Tests/Server/Infrastructure/Postgres/AddTeamComplianceRuleNotificationChannelsMigration.test.ts +255 -0
- package/Tests/Server/Infrastructure/Postgres/MessageQueueTablesMigration.test.ts +637 -0
- package/Tests/Server/Infrastructure/SemaphoreMutex.test.ts +31 -0
- package/Tests/Server/Middleware/IncidentFormRateLimit.test.ts +1630 -0
- package/Tests/Server/Middleware/TelemetryIngestBrowserKey.test.ts +63 -5
- package/Tests/Server/Middleware/TelemetryIngestKubernetesAgentRunnerPinnedKey.test.ts +103 -5
- package/Tests/Server/Middleware/TelemetryIngestKubernetesAgentRunnerRateLimit.test.ts +19 -1
- package/Tests/Server/Middleware/UserAuthorization.test.ts +16 -17
- package/Tests/Server/Middleware/UserAuthorizationSsoEnforcement.test.ts +544 -0
- package/Tests/Server/Services/AIServiceDailyBudget.test.ts +37 -8
- package/Tests/Server/Services/AutoRemediationResourceRuleEngine.test.ts +1279 -0
- package/Tests/Server/Services/DatabaseServerService.test.ts +55 -0
- package/Tests/Server/Services/GroupTelemetryUsageExcludeNames.test.ts +299 -0
- package/Tests/Server/Services/HostServiceFindOrCreateMemo.test.ts +44 -0
- package/Tests/Server/Services/IncidentCreatedFeedTitle.test.ts +212 -0
- package/Tests/Server/Services/IncidentCustomFieldDeleteFormQuestions.test.ts +297 -0
- package/Tests/Server/Services/IncidentFormOwnersCreatedNotification.test.ts +497 -0
- package/Tests/Server/Services/IncidentFormPostgres.test.ts +958 -0
- package/Tests/Server/Services/IncidentFormPublicForm.test.ts +1260 -0
- package/Tests/Server/Services/IncidentFormPublicSubmission.test.ts +2520 -0
- package/Tests/Server/Services/IncidentFormRegistration.test.ts +159 -0
- package/Tests/Server/Services/IncidentFormService.test.ts +663 -0
- package/Tests/Server/Services/IncidentFormSubmissionService.test.ts +430 -0
- package/Tests/Server/Services/IncidentFormSubmissionTemplateBranch.test.ts +473 -0
- package/Tests/Server/Services/IncidentGroupingTemplateSubstitution.test.ts +81 -0
- package/Tests/Server/Services/IncidentTemplateCustomFieldSettings.test.ts +262 -0
- package/Tests/Server/Services/IncidentTemplateOwnersOnDeclare.test.ts +566 -0
- package/Tests/Server/Services/IncidentTitleMarkdownSinks.test.ts +640 -0
- package/Tests/Server/Services/LlmLogServiceTokenAggregateParams.test.ts +3 -3
- package/Tests/Server/Services/MessageQueueOwnerServices.test.ts +440 -0
- package/Tests/Server/Services/MessageQueueRegistries.test.ts +577 -0
- package/Tests/Server/Services/MessageQueueRuleEngines.test.ts +900 -0
- package/Tests/Server/Services/MessageQueueService.test.ts +2210 -0
- package/Tests/Server/Services/MessageQueueSqlPostgres.test.ts +1271 -0
- package/Tests/Server/Services/MonitorProbeServiceIntervalScheduling.test.ts +45 -6
- package/Tests/Server/Services/OpenTelemetryResourceRetentionMemo.test.ts +28 -1
- package/Tests/Server/Services/OpenTelemetryRetentionOverrideEdition.test.ts +474 -0
- package/Tests/Server/Services/OpenTelemetryServiceResolutionCache.test.ts +21 -0
- package/Tests/Server/Services/OwnerRowUniqueness.test.ts +3 -0
- package/Tests/Server/Services/ProjectServiceAuditLogLicense.test.ts +0 -1
- package/Tests/Server/Services/RecordingRuleReservedMetricName.test.ts +171 -0
- package/Tests/Server/Services/ResourceAiAccessChangeAuthorization.test.ts +256 -0
- package/Tests/Server/Services/ResourceAiAccessService.test.ts +1373 -0
- package/Tests/Server/Services/ResourceAiAgentJobService.test.ts +375 -0
- package/Tests/Server/Services/ResourceAiAgentServiceHelpers.test.ts +1114 -0
- package/Tests/Server/Services/ResourceAiAgentServiceLifecycle.test.ts +1050 -0
- package/Tests/Server/Services/ResourceAiAgentServiceRegister.test.ts +2251 -0
- package/Tests/Server/Services/ResourceAiSettingsCreate.test.ts +373 -0
- package/Tests/Server/Services/ResourceAiSettingsPermission.test.ts +1042 -0
- package/Tests/Server/Services/ResourceServiceDeleteCleansUpAi.test.ts +319 -0
- package/Tests/Server/Services/RuleRun/LabelRuleEnginesGroupBRun.test.ts +56 -6
- package/Tests/Server/Services/RuleRun/OwnerRuleEnginesGroupBRun.test.ts +30 -1
- package/Tests/Server/Services/RunnerJobEnqueueKubectl.test.ts +105 -0
- package/Tests/Server/Services/RunnerJobEnqueueResourceCommand.test.ts +986 -0
- package/Tests/Server/Services/RunnerJobResourceCommandLane.test.ts +211 -0
- package/Tests/Server/Services/RunnerJobResourceCommandTimeoutAndRedaction.test.ts +352 -0
- package/Tests/Server/Services/SsoRequirementReads.test.ts +454 -0
- package/Tests/Server/Services/SsoRequirementWrites.test.ts +529 -0
- package/Tests/Server/Services/StaticRuleCriteriaRuntimeCoverage.test.ts +3 -3
- package/Tests/Server/Services/StatusPagePrivateUserInvitationPolicy.test.ts +107 -89
- package/Tests/Server/Services/TeamComplianceSettingPostgres.test.ts +1068 -176
- package/Tests/Server/Services/TeamComplianceSettingService.test.ts +1962 -200
- package/Tests/Server/Services/TelemetryUsageBillingSloExclusion.test.ts +218 -0
- package/Tests/Server/TestingUtils/Services/FakeRunnerJobCount.ts +145 -0
- package/Tests/Server/Types/Database/Permissions/EditionPermission.test.ts +654 -297
- package/Tests/Server/Types/Database/Permissions/RetentionOverrideColumns.test.ts +784 -0
- package/Tests/Server/Types/Database/Permissions/SsoScalePlanGate.test.ts +418 -0
- package/Tests/Server/Utils/AI/AIAlertGating.test.ts +0 -1
- package/Tests/Server/Utils/AI/AIInvestigationEngineRunLimits.test.ts +136 -0
- package/Tests/Server/Utils/AI/AIInvestigationQueue.test.ts +15 -14
- package/Tests/Server/Utils/AI/AgentContextCompactor.test.ts +351 -0
- package/Tests/Server/Utils/AI/ChatAgentRunnerSharedThread.test.ts +842 -0
- package/Tests/Server/Utils/AI/ChatRunCancellation.test.ts +195 -0
- package/Tests/Server/Utils/AI/CodeFixReadiness.test.ts +10 -57
- package/Tests/Server/Utils/AI/FixRunBudget.test.ts +20 -24
- package/Tests/Server/Utils/AI/Insights/InvestigationQueueInsightSubject.test.ts +7 -30
- package/Tests/Server/Utils/AI/InvestigationClusterAccessWiring.test.ts +225 -29
- package/Tests/Server/Utils/AI/InvestigationInfrastructureAccessWiring.test.ts +694 -0
- package/Tests/Server/Utils/AI/InvestigationInfrastructureReport.test.ts +721 -0
- package/Tests/Server/Utils/AI/InvestigationThread.test.ts +580 -0
- package/Tests/Server/Utils/AI/InvestigationThreadService.test.ts +801 -0
- package/Tests/Server/Utils/AI/KubectlInvestigationToolkit.test.ts +525 -43
- package/Tests/Server/Utils/AI/KubectlJobRunner.test.ts +4 -2
- package/Tests/Server/Utils/AI/LLMServiceUnreachableProvider.test.ts +435 -0
- package/Tests/Server/Utils/AI/ObservabilityAssistantLimits.test.ts +462 -0
- package/Tests/Server/Utils/AI/RemediationCommandTools.test.ts +94 -1
- package/Tests/Server/Utils/AI/RemediationCommandToolsResource.test.ts +1530 -0
- package/Tests/Server/Utils/AI/RemediationExecutionRunner.test.ts +14 -25
- package/Tests/Server/Utils/AI/RemediationExecutionRunnerResourceMode.test.ts +1251 -0
- package/Tests/Server/Utils/AI/RemediationPlanRunner.test.ts +117 -0
- package/Tests/Server/Utils/AI/RemediationResourceCopyParity.test.ts +463 -0
- package/Tests/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.test.ts +1004 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceAccessContext.test.ts +266 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.test.ts +1220 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.test.ts +569 -0
- package/Tests/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.test.ts +834 -0
- package/Tests/Server/Utils/AI/ToolOutputPager.test.ts +382 -0
- package/Tests/Server/Utils/AI/ToolResultSerializer.test.ts +23 -4
- package/Tests/Server/Utils/AI/Toolbox/LogTools.test.ts +25 -6
- package/Tests/Server/Utils/AI/Toolbox/Serializer.test.ts +14 -3
- package/Tests/Server/Utils/AutoRemediation/CommandPlanExecutorResource.test.ts +717 -0
- package/Tests/Server/Utils/AutoRemediation/RemediationVerifierResourceFollowUp.test.ts +338 -0
- package/Tests/Server/Utils/EditionEnforcement.test.ts +107 -147
- package/Tests/Server/Utils/Monitor/Criteria/SessionReplayBudgetTemplateCriteria.test.ts +422 -0
- package/Tests/Server/Utils/{CommunityEditionSsoReport.test.ts → RelaxedScimTeamLocksReport.test.ts} +212 -208
- package/Tests/Server/Utils/SameOriginRequest.test.ts +372 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.test.ts +1647 -0
- package/Tests/Server/Utils/SessionReplay/SessionReplayUsage.test.ts +143 -1
- package/Tests/Server/Utils/Telemetry/EntityRegistry.test.ts +20 -0
- package/Tests/Server/Utils/Telemetry/MessageQueueDiscovery.test.ts +2590 -0
- package/Tests/Server/Utils/Telemetry/MessageQueueSpanQueryTwin.ts +246 -0
- package/Tests/Server/Utils/Telemetry/TelemetryEntity.test.ts +23 -0
- package/Tests/Server/Utils/Telemetry/TelemetryIngestionKeyGuard.test.ts +33 -3
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsAccountNotLinked.test.ts +1093 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.test.ts +1049 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.test.ts +1676 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCards.test.ts +2884 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.test.ts +2490 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateSubmit.test.ts +2293 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateSubmitServerTimezone.test.ts +386 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.test.ts +1477 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.test.ts +1967 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsStripHtmlTags.test.ts +92 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsSubmittedFormRemoval.test.ts +1819 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.test.ts +1033 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezoneServerZone.test.ts +610 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsBotMessageHandling.test.ts +2610 -0
- package/Tests/Server/Utils/Workspace/MicrosoftTeamsCreateCommandsEndToEnd.test.ts +4672 -0
- package/Tests/Server/Utils/Workspace/WorkspaceCreateProjectReferences.test.ts +190 -65
- package/Tests/Types/AI/AIAgentRunLimits.test.ts +255 -0
- package/Tests/Types/AutoRemediation/AiRemediationCommandPlan.test.ts +10 -4
- package/Tests/Types/AutoRemediation/AiRemediationCommandPlanResourceCommand.test.ts +305 -0
- package/Tests/Types/Code/JsonSyntax.test.ts +1300 -0
- package/Tests/Types/CustomField/CustomFieldCreateSettings.test.ts +1113 -0
- package/Tests/Types/CustomField/CustomFieldMappingCatalog.test.ts +91 -0
- package/Tests/Types/CustomField/CustomFieldValueValidator.test.ts +30 -0
- package/Tests/Types/Incident/IncidentFormIpAllowlist.test.ts +227 -0
- package/Tests/Types/Incident/IncidentFormPublic.test.ts +1916 -0
- package/Tests/Types/MessageQueue/MessageQueueEntityKey.test.ts +916 -0
- package/Tests/Types/MessageQueue/MessageQueueIdentity.test.ts +567 -0
- package/Tests/Types/MessageQueue/MessageQueueManualIdentity.test.ts +686 -0
- package/Tests/Types/MessageQueue/MessageQueueMetricCatalog.test.ts +1726 -0
- package/Tests/Types/MessageQueue/MessageQueueMetricResolution.test.ts +1758 -0
- package/Tests/Types/MessageQueue/MessagingInstrumentationFixtures.test.ts +4686 -0
- package/Tests/Types/MessageQueue/MessagingSystem.test.ts +840 -0
- package/Tests/Types/MessageQueue/MessagingTelemetryFixtures.ts +3287 -0
- package/Tests/Types/MessageQueue/MessagingTelemetryResolver.test.ts +2966 -0
- package/Tests/Types/Monitor/MessageQueueAlertTemplates.test.ts +5401 -0
- package/Tests/Types/Monitor/MetricEngineFold.ts +154 -0
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationCatalog.test.ts +277 -13
- package/Tests/Types/Monitor/Recommendation/MonitorRecommendationUtil.test.ts +113 -0
- package/Tests/Types/Monitor/RumAlertTemplates.test.ts +773 -2
- package/Tests/Types/ResourceAiAgent/AiResourceType.test.ts +419 -0
- package/Tests/Types/ResourceAiAgent/ResourceAiAccess.test.ts +519 -0
- package/Tests/Types/Runbook/RunbookStepType.test.ts +147 -8
- package/Tests/Types/Team/ComplianceRule.test.ts +588 -37
- package/Tests/Types/Team/TeamComplianceStatus.test.ts +64 -11
- package/Tests/Types/XML.test.ts +51 -0
- package/Tests/UI/Components/CodeEditor/CodeEditor.test.tsx +2362 -0
- package/Tests/UI/Components/CodeEditor/CodeEditorCommands.test.ts +810 -0
- package/Tests/UI/Components/CodeEditor/CodeEditorHighlight.test.ts +338 -0
- package/Tests/UI/Components/CodeEditor/CodeEditorLanguages.test.ts +222 -0
- package/Tests/UI/Components/CodeEditor/CodeEditorStyles.test.ts +807 -0
- package/Tests/UI/Components/CodeEditor/NoMonaco.test.ts +245 -0
- package/Tests/UI/Components/CodeEditor/YamlEditor.test.tsx +729 -0
- package/Tests/UI/Components/CopyTextButton.test.tsx +76 -0
- package/Tests/UI/Components/EditionLabelLapseCopy.ts +51 -14
- package/Tests/UI/Components/EditionLabelLicenseStatus.test.tsx +131 -23
- package/Tests/UI/Components/ErrorMessageAction.test.tsx +142 -0
- package/Tests/UI/Components/FacetSidebarInScope.test.tsx +459 -0
- package/Tests/UI/Components/FacetValuesInScope.test.ts +270 -0
- package/Tests/UI/Components/Forms/FormFieldCodeEditors.test.tsx +294 -0
- package/Tests/UI/Components/Forms/FormFieldMarkdown.test.tsx +126 -0
- package/Tests/UI/Components/Forms/FormFieldYaml.test.tsx +22 -75
- package/Tests/UI/Components/Forms/ModelFormOnBeforeCreateMiscData.test.tsx +254 -0
- package/Tests/UI/Components/Icon.test.tsx +32 -0
- package/Tests/UI/Components/Input.test.tsx +31 -0
- package/Tests/UI/Components/LockedFilterChipScope.test.tsx +501 -0
- package/Tests/UI/Components/MarkdownConverters.test.ts +253 -1
- package/Tests/UI/Components/MarkdownEditor.test.tsx +2785 -2
- package/Tests/UI/Components/MarkdownEditorHistory.test.ts +243 -0
- package/Tests/UI/Components/MarkdownListEditing.test.ts +1118 -0
- package/Tests/UI/Components/MarkdownPaste.test.ts +1180 -0
- package/Tests/UI/Components/MarkdownViewerCopy.test.tsx +466 -0
- package/Tests/UI/Components/MarkdownVisualEditing.test.ts +1089 -0
- package/Tests/UI/Components/ModelTable/BaseModelTableEmptyStateAction.test.tsx +623 -0
- package/Tests/UI/Components/ResetObjectID.test.tsx +282 -0
- package/Tests/UI/Components/RuleCriteria/RuleCriteriaModelTable.test.tsx +3 -3
- package/Tests/UI/Components/Table/EmptyTableMessage.test.ts +439 -0
- package/Tests/UI/Components/Table/TableEmptyState.test.tsx +352 -0
- package/Tests/UI/Components/TableRowMobileTitles.test.tsx +78 -0
- package/Tests/UI/Components/TextArea.test.tsx +19 -0
- package/Tests/UI/Components/Workflow/ModelColumnEditor.render.test.tsx +12 -29
- package/Tests/UI/Components/fixtures/MarkdownPasteFixtures.ts +460 -0
- package/Tests/UI/EsbuildConfig.test.ts +115 -39
- package/Tests/UI/EsbuildEnterpriseAlias.test.ts +4 -4
- package/Tests/UI/Monitor/MonitorLogSummaryRender.test.tsx +377 -0
- package/Tests/UI/Rum/RecordingHealthDashboard.test.tsx +769 -1
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealBreadcrumbTrails.ts +81 -1
- package/Tests/UI/Utils/Breadcrumb/fixtures/RealRoutePatterns.ts +17 -0
- package/Tests/Utils/AiRemediation/Resource/CephCommandPolicy.test.ts +1653 -0
- package/Tests/Utils/AiRemediation/Resource/CephOutputRedaction.test.ts +204 -0
- package/Tests/Utils/AiRemediation/Resource/DatabaseCommandPolicy.test.ts +1077 -0
- package/Tests/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.test.ts +558 -0
- package/Tests/Utils/AiRemediation/Resource/DatabaseQueryRedactor.test.ts +834 -0
- package/Tests/Utils/AiRemediation/Resource/DockerCliGrammar.test.ts +747 -0
- package/Tests/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.test.ts +1259 -0
- package/Tests/Utils/AiRemediation/Resource/DockerOutputRedaction.test.ts +386 -0
- package/Tests/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.test.ts +782 -0
- package/Tests/Utils/AiRemediation/Resource/GovcCommandPolicy.test.ts +2259 -0
- package/Tests/Utils/AiRemediation/Resource/HostCommandPolicy.test.ts +2019 -0
- package/Tests/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.test.ts +2497 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceCommandPolicy.test.ts +1305 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.test.ts +585 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceOutputRedactor.test.ts +334 -0
- package/Tests/Utils/AiRemediation/Resource/ResourceOutputRedactorCopyParity.test.ts +98 -0
- package/Tests/Utils/AiRemediation/Resource/ResourcePolicyImportClosure.test.ts +391 -0
- package/Tests/Utils/AiRemediation/ResourceAiAgentPolicyCopyParity.test.ts +497 -0
- package/Tests/Utils/LabelRuleImportExport.test.ts +5 -0
- package/Tests/Utils/Markdown/DashboardMarkdownRenderer.ts +81 -0
- package/Tests/Utils/Markdown/UntrustedMarkdown.test.ts +1339 -0
- package/Tests/Utils/Monitor/MonitorLogSummaryUtil.test.ts +862 -0
- package/Tests/Utils/SessionReplay/SessionReplayBudgetMetricType.test.ts +383 -0
- package/Types/AI/AIAgentRunLimits.ts +146 -0
- package/Types/AI/ResourceAiAccessApi.ts +140 -0
- package/Types/AI/ResourceAiAccessPermissions.ts +126 -0
- package/Types/AutoRemediation/AiRemediationCommandPlan.ts +183 -2
- package/Types/Code/CodeType.ts +2 -0
- package/Types/Code/JsonSyntax.ts +923 -0
- package/Types/CustomField/CustomFieldCreateSettings.ts +549 -0
- package/Types/CustomField/CustomFieldMappingCatalog.ts +77 -0
- package/Types/CustomField/CustomFieldValueValidator.ts +10 -7
- package/Types/EnterpriseLicense/EnterpriseLicensePeriods.ts +1 -1
- package/Types/Icon/IconProp.ts +2 -0
- package/Types/Incident/IncidentFormIpAllowlist.ts +206 -0
- package/Types/Incident/IncidentFormPublic.ts +1145 -0
- package/Types/Kubernetes/KubernetesClusterAiAccess.ts +10 -3
- package/Types/MessageQueue/MessageQueueIdentity.ts +256 -0
- package/Types/MessageQueue/MessageQueueManualIdentity.ts +325 -0
- package/Types/MessageQueue/MessageQueueMetricCatalog.ts +1357 -0
- package/Types/MessageQueue/MessagingSystem.ts +518 -0
- package/Types/MessageQueue/MessagingTelemetryResolver.ts +2311 -0
- package/Types/Monitor/MessageQueueAlertTemplates.ts +2128 -0
- package/Types/Monitor/Recommendation/MonitorRecommendationCatalog.ts +55 -22
- package/Types/Monitor/Recommendation/MonitorRecommendationTypes.ts +35 -3
- package/Types/Monitor/RumAlertTemplates.ts +351 -4
- package/Types/Permission.ts +310 -0
- package/Types/ResourceAiAgent/AiResourceType.ts +310 -0
- package/Types/ResourceAiAgent/ResourceAiAccess.ts +580 -0
- package/Types/Rules/RuleCriteriaFieldRegistry.ts +12 -0
- package/Types/Rules/RuleRun.ts +4 -0
- package/Types/Rum/SessionReplayBudgetMetricType.ts +47 -0
- package/Types/Runbook/RunbookStepType.ts +29 -0
- package/Types/Team/ComplianceNotificationChannel.ts +4 -3
- package/Types/Team/ComplianceRule.ts +71 -18
- package/Types/Team/ComplianceRuleType.ts +2 -2
- package/Types/Team/TeamComplianceStatus.ts +6 -2
- package/Types/Telemetry/EntityType.ts +16 -0
- package/Types/Telemetry/LockedFilterDetail.ts +22 -0
- package/Types/Telemetry/TelemetryIngestSurface.ts +14 -2
- package/Types/XML.ts +26 -0
- package/UI/Components/CodeEditor/CodeEditor.css +379 -0
- package/UI/Components/CodeEditor/CodeEditor.tsx +1128 -294
- package/UI/Components/CodeEditor/CodeEditorCommands.ts +774 -0
- package/UI/Components/CodeEditor/CodeEditorHighlight.ts +106 -0
- package/UI/Components/CodeEditor/CodeEditorLanguages.ts +164 -0
- package/UI/Components/CodeEditor/YamlEditor.tsx +28 -326
- package/UI/Components/CopyTextButton/CopyTextButton.tsx +5 -1
- package/UI/Components/CustomFields/CustomFieldModelFormFields.tsx +6 -25
- package/UI/Components/EditionLabel/EditionLabel.tsx +14 -13
- package/UI/Components/ErrorMessage/ErrorMessage.tsx +11 -1
- package/UI/Components/Forms/Fields/FormField.tsx +8 -0
- package/UI/Components/Forms/Types/Field.ts +8 -0
- package/UI/Components/Icon/Icon.tsx +18 -0
- package/UI/Components/Input/Input.tsx +11 -4
- package/UI/Components/LogsViewer/LogsViewer.tsx +4 -0
- package/UI/Components/LogsViewer/components/LogsFacetSidebar.tsx +21 -3
- package/UI/Components/Markdown.tsx/MarkdownConverters.ts +0 -0
- package/UI/Components/Markdown.tsx/MarkdownEditor.tsx +877 -79
- package/UI/Components/Markdown.tsx/MarkdownEditorHistory.ts +284 -0
- package/UI/Components/Markdown.tsx/MarkdownListEditing.ts +1362 -0
- package/UI/Components/Markdown.tsx/MarkdownPaste.ts +1326 -0
- package/UI/Components/Markdown.tsx/MarkdownViewer.tsx +106 -10
- package/UI/Components/Markdown.tsx/MarkdownVisualEditing.ts +1032 -0
- package/UI/Components/ModelTable/BaseModelTable.tsx +85 -7
- package/UI/Components/ResetObjectID/ResetObjectID.tsx +35 -9
- package/UI/Components/Table/EmptyTableMessage.ts +81 -0
- package/UI/Components/Table/Table.tsx +50 -21
- package/UI/Components/Table/TableRow.tsx +9 -1
- package/UI/Components/TelemetryViewer/FacetVisibility.ts +97 -2
- package/UI/Components/TelemetryViewer/TelemetryViewer.tsx +13 -0
- package/UI/Components/TelemetryViewer/components/LockedFilterChip.tsx +214 -7
- package/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.tsx +21 -3
- package/UI/Components/TextArea/TextArea.tsx +9 -2
- package/UI/Components/Workflow/ModelFieldPicker.tsx +10 -12
- package/UI/Styles/Theme.css +8 -0
- package/UI/esbuild-config.js +2 -32
- package/Utils/AI/InvestigationReport.ts +121 -15
- package/Utils/AiRemediation/Resource/CephCommandPolicy.ts +1936 -0
- package/Utils/AiRemediation/Resource/DatabaseCommandPolicy.ts +166 -0
- package/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.ts +1532 -0
- package/Utils/AiRemediation/Resource/DatabaseQueryRedactor.ts +1394 -0
- package/Utils/AiRemediation/Resource/DockerCliGrammar.ts +1839 -0
- package/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.ts +490 -0
- package/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.ts +687 -0
- package/Utils/AiRemediation/Resource/GovcCommandPolicy.ts +2096 -0
- package/Utils/AiRemediation/Resource/HostCommandPolicy.ts +2982 -0
- package/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.ts +1679 -0
- package/Utils/AiRemediation/Resource/ResourceCommandPolicy.ts +851 -0
- package/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.ts +593 -0
- package/Utils/AiRemediation/Resource/ResourceOutputRedactor.ts +2812 -0
- package/Utils/LabelRuleImportExport.ts +2 -0
- package/Utils/Markdown/UntrustedMarkdown.ts +1513 -0
- package/Utils/Monitor/IncomingEmailMonitorRequestUtil.ts +41 -0
- package/Utils/Monitor/MonitorLogSummaryUtil.ts +212 -0
- package/Utils/SessionReplay/SessionReplayBudgetMetricType.ts +184 -0
- package/Utils/Telemetry/EntityKey.ts +48 -0
- package/build/dist/Models/DatabaseModels/AIConversation.js +125 -1
- package/build/dist/Models/DatabaseModels/AIConversation.js.map +1 -1
- package/build/dist/Models/DatabaseModels/AutoRemediationSuggestion.js +62 -0
- package/build/dist/Models/DatabaseModels/AutoRemediationSuggestion.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CephCluster.js +231 -0
- package/build/dist/Models/DatabaseModels/CephCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/CloudResource.js +12 -0
- package/build/dist/Models/DatabaseModels/CloudResource.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DatabaseServer.js +231 -0
- package/build/dist/Models/DatabaseModels/DatabaseServer.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DockerHost.js +231 -0
- package/build/dist/Models/DatabaseModels/DockerHost.js.map +1 -1
- package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js +231 -0
- package/build/dist/Models/DatabaseModels/DockerSwarmCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js +1 -1
- package/build/dist/Models/DatabaseModels/GlobalConfig.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalOidc.js +0 -4
- package/build/dist/Models/DatabaseModels/GlobalOidc.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalOidcProject.js +0 -4
- package/build/dist/Models/DatabaseModels/GlobalOidcProject.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalSso.js +0 -4
- package/build/dist/Models/DatabaseModels/GlobalSso.js.map +1 -1
- package/build/dist/Models/DatabaseModels/GlobalSsoProject.js +0 -4
- package/build/dist/Models/DatabaseModels/GlobalSsoProject.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Host.js +231 -0
- package/build/dist/Models/DatabaseModels/Host.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IncidentForm.js +605 -0
- package/build/dist/Models/DatabaseModels/IncidentForm.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentFormSubmission.js +299 -0
- package/build/dist/Models/DatabaseModels/IncidentFormSubmission.js.map +1 -0
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js +60 -0
- package/build/dist/Models/DatabaseModels/IncidentTemplate.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Index.js +16 -0
- package/build/dist/Models/DatabaseModels/Index.js.map +1 -1
- package/build/dist/Models/DatabaseModels/IoTFleet.js +12 -0
- package/build/dist/Models/DatabaseModels/IoTFleet.js.map +1 -1
- package/build/dist/Models/DatabaseModels/KubernetesCluster.js +12 -0
- package/build/dist/Models/DatabaseModels/KubernetesCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/MessageQueue.js +1106 -0
- package/build/dist/Models/DatabaseModels/MessageQueue.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MessageQueueLabelRule.js +562 -0
- package/build/dist/Models/DatabaseModels/MessageQueueLabelRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MessageQueueOwnerRule.js +643 -0
- package/build/dist/Models/DatabaseModels/MessageQueueOwnerRule.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MessageQueueOwnerTeam.js +506 -0
- package/build/dist/Models/DatabaseModels/MessageQueueOwnerTeam.js.map +1 -0
- package/build/dist/Models/DatabaseModels/MessageQueueOwnerUser.js +505 -0
- package/build/dist/Models/DatabaseModels/MessageQueueOwnerUser.js.map +1 -0
- package/build/dist/Models/DatabaseModels/PodmanHost.js +231 -0
- package/build/dist/Models/DatabaseModels/PodmanHost.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Project.js +61 -0
- package/build/dist/Models/DatabaseModels/Project.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectOidc.js +0 -4
- package/build/dist/Models/DatabaseModels/ProjectOidc.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProjectSso.js +0 -4
- package/build/dist/Models/DatabaseModels/ProjectSso.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ProxmoxCluster.js +231 -0
- package/build/dist/Models/DatabaseModels/ProxmoxCluster.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ResourceAiAgent.js +439 -0
- package/build/dist/Models/DatabaseModels/ResourceAiAgent.js.map +1 -0
- package/build/dist/Models/DatabaseModels/RumApplication.js +12 -0
- package/build/dist/Models/DatabaseModels/RumApplication.js.map +1 -1
- package/build/dist/Models/DatabaseModels/RunnerJob.js +145 -0
- package/build/dist/Models/DatabaseModels/RunnerJob.js.map +1 -1
- package/build/dist/Models/DatabaseModels/ServerlessFunction.js +12 -0
- package/build/dist/Models/DatabaseModels/ServerlessFunction.js.map +1 -1
- package/build/dist/Models/DatabaseModels/Service.js +12 -0
- package/build/dist/Models/DatabaseModels/Service.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageOidc.js +0 -4
- package/build/dist/Models/DatabaseModels/StatusPageOidc.js.map +1 -1
- package/build/dist/Models/DatabaseModels/StatusPageSso.js +0 -4
- package/build/dist/Models/DatabaseModels/StatusPageSso.js.map +1 -1
- package/build/dist/Models/DatabaseModels/TeamComplianceSetting.js +49 -3
- package/build/dist/Models/DatabaseModels/TeamComplianceSetting.js.map +1 -1
- package/build/dist/Models/DatabaseModels/VMwareVCenter.js +231 -0
- package/build/dist/Models/DatabaseModels/VMwareVCenter.js.map +1 -1
- package/build/dist/Server/API/AIChatAPI.js +9 -103
- package/build/dist/Server/API/AIChatAPI.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationAPI.js +3 -3
- package/build/dist/Server/API/AIInvestigationAPI.js.map +1 -1
- package/build/dist/Server/API/AIInvestigationConversationAPI.js +162 -0
- package/build/dist/Server/API/AIInvestigationConversationAPI.js.map +1 -0
- package/build/dist/Server/API/AutoRemediationAPI.js +231 -1
- package/build/dist/Server/API/AutoRemediationAPI.js.map +1 -1
- package/build/dist/Server/API/IncidentFormAPI.js +245 -0
- package/build/dist/Server/API/IncidentFormAPI.js.map +1 -0
- package/build/dist/Server/API/ProjectOIDC.js +16 -24
- package/build/dist/Server/API/ProjectOIDC.js.map +1 -1
- package/build/dist/Server/API/ProjectSSO.js +16 -24
- package/build/dist/Server/API/ProjectSSO.js.map +1 -1
- package/build/dist/Server/API/ResourceAiAccessAPI.js +1119 -0
- package/build/dist/Server/API/ResourceAiAccessAPI.js.map +1 -0
- package/build/dist/Server/API/StatusPageAPI.js +42 -75
- package/build/dist/Server/API/StatusPageAPI.js.map +1 -1
- package/build/dist/Server/Enterprise/EnterpriseEdition.js +79 -25
- package/build/dist/Server/Enterprise/EnterpriseEdition.js.map +1 -1
- package/build/dist/Server/Enterprise/EnterpriseFeature.js +24 -3
- package/build/dist/Server/Enterprise/EnterpriseFeature.js.map +1 -1
- package/build/dist/Server/Enterprise/EnterpriseLicenseSnapshot.js +1 -1
- package/build/dist/Server/Enterprise/EnterpriseServerModule.js.map +1 -1
- package/build/dist/Server/EnvironmentConfig.js +1 -1
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796300000000-AddResourceAiAgents.js +168 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796300000000-AddResourceAiAgents.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796400000000-AddIncidentForms.js +63 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796400000000-AddIncidentForms.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796500000000-AddTeamComplianceRuleNotificationChannels.js +41 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796500000000-AddTeamComplianceRuleNotificationChannels.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796600000000-AddAIInvestigationConversationAndTimeLimits.js +40 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796600000000-AddAIInvestigationConversationAndTimeLimits.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796700000000-AddMessageQueueTables.js +183 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/1796700000000-AddMessageQueueTables.js.map +1 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js +10 -0
- package/build/dist/Server/Infrastructure/Postgres/SchemaMigrations/Index.js.map +1 -1
- package/build/dist/Server/Infrastructure/Semaphore.js +6 -0
- package/build/dist/Server/Infrastructure/Semaphore.js.map +1 -1
- package/build/dist/Server/Middleware/IncidentFormRateLimit.js +559 -0
- package/build/dist/Server/Middleware/IncidentFormRateLimit.js.map +1 -0
- package/build/dist/Server/Middleware/TelemetryIngest.js +12 -5
- package/build/dist/Server/Middleware/TelemetryIngest.js.map +1 -1
- package/build/dist/Server/Middleware/UserAuthorization.js +11 -30
- package/build/dist/Server/Middleware/UserAuthorization.js.map +1 -1
- package/build/dist/Server/Services/AIService.js +10 -13
- package/build/dist/Server/Services/AIService.js.map +1 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js +26 -1
- package/build/dist/Server/Services/AnalyticsDatabaseService.js.map +1 -1
- package/build/dist/Server/Services/AutoRemediationRuleEngineService.js +601 -3
- package/build/dist/Server/Services/AutoRemediationRuleEngineService.js.map +1 -1
- package/build/dist/Server/Services/CephClusterService.js +104 -0
- package/build/dist/Server/Services/CephClusterService.js.map +1 -1
- package/build/dist/Server/Services/DatabaseServerService.js +99 -0
- package/build/dist/Server/Services/DatabaseServerService.js.map +1 -1
- package/build/dist/Server/Services/DockerHostService.js +104 -0
- package/build/dist/Server/Services/DockerHostService.js.map +1 -1
- package/build/dist/Server/Services/DockerSwarmClusterService.js +104 -0
- package/build/dist/Server/Services/DockerSwarmClusterService.js.map +1 -1
- package/build/dist/Server/Services/HostService.js +114 -2
- package/build/dist/Server/Services/HostService.js.map +1 -1
- package/build/dist/Server/Services/IncidentCustomFieldService.js +83 -0
- package/build/dist/Server/Services/IncidentCustomFieldService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeMemberService.js +8 -4
- package/build/dist/Server/Services/IncidentEpisodeMemberService.js.map +1 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js +10 -1
- package/build/dist/Server/Services/IncidentEpisodeService.js.map +1 -1
- package/build/dist/Server/Services/IncidentFormService.js +1202 -0
- package/build/dist/Server/Services/IncidentFormService.js.map +1 -0
- package/build/dist/Server/Services/IncidentFormSubmissionService.js +91 -0
- package/build/dist/Server/Services/IncidentFormSubmissionService.js.map +1 -0
- package/build/dist/Server/Services/IncidentGroupingEngineService.js +20 -8
- package/build/dist/Server/Services/IncidentGroupingEngineService.js.map +1 -1
- package/build/dist/Server/Services/IncidentService.js +106 -4
- package/build/dist/Server/Services/IncidentService.js.map +1 -1
- package/build/dist/Server/Services/IncidentTemplateService.js +18 -0
- package/build/dist/Server/Services/IncidentTemplateService.js.map +1 -1
- package/build/dist/Server/Services/Index.js +14 -0
- package/build/dist/Server/Services/Index.js.map +1 -1
- package/build/dist/Server/Services/MessageQueueLabelRuleEngineService.js +262 -0
- package/build/dist/Server/Services/MessageQueueLabelRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/MessageQueueLabelRuleService.js +13 -0
- package/build/dist/Server/Services/MessageQueueLabelRuleService.js.map +1 -0
- package/build/dist/Server/Services/MessageQueueOwnerRuleEngineService.js +334 -0
- package/build/dist/Server/Services/MessageQueueOwnerRuleEngineService.js.map +1 -0
- package/build/dist/Server/Services/MessageQueueOwnerRuleService.js +13 -0
- package/build/dist/Server/Services/MessageQueueOwnerRuleService.js.map +1 -0
- package/build/dist/Server/Services/MessageQueueOwnerTeamService.js +62 -0
- package/build/dist/Server/Services/MessageQueueOwnerTeamService.js.map +1 -0
- package/build/dist/Server/Services/MessageQueueOwnerUserService.js +62 -0
- package/build/dist/Server/Services/MessageQueueOwnerUserService.js.map +1 -0
- package/build/dist/Server/Services/MessageQueueService.js +1140 -0
- package/build/dist/Server/Services/MessageQueueService.js.map +1 -0
- package/build/dist/Server/Services/MetricRecordingRuleService.js +46 -0
- package/build/dist/Server/Services/MetricRecordingRuleService.js.map +1 -1
- package/build/dist/Server/Services/OpenTelemetryIngestService.js +25 -4
- package/build/dist/Server/Services/OpenTelemetryIngestService.js.map +1 -1
- package/build/dist/Server/Services/PodmanHostService.js +104 -0
- package/build/dist/Server/Services/PodmanHostService.js.map +1 -1
- package/build/dist/Server/Services/ProjectService.js +0 -54
- package/build/dist/Server/Services/ProjectService.js.map +1 -1
- package/build/dist/Server/Services/ProxmoxClusterService.js +104 -0
- package/build/dist/Server/Services/ProxmoxClusterService.js.map +1 -1
- package/build/dist/Server/Services/ResourceAiAccessService.js +1028 -0
- package/build/dist/Server/Services/ResourceAiAccessService.js.map +1 -0
- package/build/dist/Server/Services/ResourceAiAgentJobService.js +173 -0
- package/build/dist/Server/Services/ResourceAiAgentJobService.js.map +1 -0
- package/build/dist/Server/Services/ResourceAiAgentService.js +1687 -0
- package/build/dist/Server/Services/ResourceAiAgentService.js.map +1 -0
- package/build/dist/Server/Services/RunnerJobService.js +344 -5
- package/build/dist/Server/Services/RunnerJobService.js.map +1 -1
- package/build/dist/Server/Services/StatusPagePrivateUserService.js +1 -4
- package/build/dist/Server/Services/StatusPagePrivateUserService.js.map +1 -1
- package/build/dist/Server/Services/StatusPageService.js +0 -46
- package/build/dist/Server/Services/StatusPageService.js.map +1 -1
- package/build/dist/Server/Services/TeamComplianceSettingService.js +120 -31
- package/build/dist/Server/Services/TeamComplianceSettingService.js.map +1 -1
- package/build/dist/Server/Services/TelemetryUsageBillingService.js +26 -0
- package/build/dist/Server/Services/TelemetryUsageBillingService.js.map +1 -1
- package/build/dist/Server/Services/TraceRecordingRuleService.js +37 -0
- package/build/dist/Server/Services/TraceRecordingRuleService.js.map +1 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js +8 -1
- package/build/dist/Server/Services/UserNotificationRuleService.js.map +1 -1
- package/build/dist/Server/Services/VMwareVCenterService.js +104 -0
- package/build/dist/Server/Services/VMwareVCenterService.js.map +1 -1
- package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js +12 -3
- package/build/dist/Server/Services/WorkspaceNotificationSummaryService.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js +6 -3
- package/build/dist/Server/Types/Database/Permissions/CreatePermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/EditionPermission.js +109 -37
- package/build/dist/Server/Types/Database/Permissions/EditionPermission.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js +16 -0
- package/build/dist/Server/Types/Database/Permissions/OwnerTableRegistry.js.map +1 -1
- package/build/dist/Server/Types/Database/Permissions/TablePermission.js +3 -3
- package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js +9 -6
- package/build/dist/Server/Types/Database/Permissions/UpdatePermission.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/AgentContextCompactor.js +128 -0
- package/build/dist/Server/Utils/AI/Chat/AgentContextCompactor.js.map +1 -0
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js +192 -50
- package/build/dist/Server/Utils/AI/Chat/ChatAgentRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ChatRunCancellation.js +133 -0
- package/build/dist/Server/Utils/AI/Chat/ChatRunCancellation.js.map +1 -0
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js +53 -13
- package/build/dist/Server/Utils/AI/Chat/ObservabilityAssistant.js.map +1 -1
- package/build/dist/Server/Utils/AI/Chat/ObservabilityChatPrompt.js +1 -1
- package/build/dist/Server/Utils/AI/Chat/ToolOutputPager.js +206 -0
- package/build/dist/Server/Utils/AI/Chat/ToolOutputPager.js.map +1 -0
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.js +53 -26
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlInvestigationToolkit.js.map +1 -1
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlJobRunner.js +4 -2
- package/build/dist/Server/Utils/AI/ClusterAccess/KubectlJobRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js +1 -29
- package/build/dist/Server/Utils/AI/CodeFix/CodeFixReadiness.js.map +1 -1
- package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js +24 -24
- package/build/dist/Server/Utils/AI/CodeFix/FixRunBudget.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js +1036 -32
- package/build/dist/Server/Utils/AI/Remediation/RemediationCommandTools.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js +661 -41
- package/build/dist/Server/Utils/AI/Remediation/RemediationExecutionRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationPlanRunner.js +21 -1
- package/build/dist/Server/Utils/AI/Remediation/RemediationPlanRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.js +354 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/InfrastructureInvestigationToolkit.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessContext.js +160 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessContext.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessToolNames.js +33 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAccessToolNames.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.js +640 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiAccessSettings.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.js +226 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceAiDeleteCleanup.js.map +1 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.js +602 -0
- package/build/dist/Server/Utils/AI/ResourceAccess/ResourceCommandJobRunner.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js +90 -14
- package/build/dist/Server/Utils/AI/SRE/AIInvestigationEngine.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js +73 -10
- package/build/dist/Server/Utils/AI/SRE/AlertInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js +73 -10
- package/build/dist/Server/Utils/AI/SRE/IncidentInvestigationRunner.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/InvestigationQueue.js +15 -18
- package/build/dist/Server/Utils/AI/SRE/InvestigationQueue.js.map +1 -1
- package/build/dist/Server/Utils/AI/SRE/InvestigationThread.js +412 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationThread.js.map +1 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationThreadService.js +495 -0
- package/build/dist/Server/Utils/AI/SRE/InvestigationThreadService.js.map +1 -0
- package/build/dist/Server/Utils/AI/Toolbox/Serializer.js +10 -3
- package/build/dist/Server/Utils/AI/Toolbox/Serializer.js.map +1 -1
- package/build/dist/Server/Utils/AutoRemediation/CommandPlanExecutor.js +290 -13
- package/build/dist/Server/Utils/AutoRemediation/CommandPlanExecutor.js.map +1 -1
- package/build/dist/Server/Utils/AutoRemediation/RemediationVerifier.js +29 -1
- package/build/dist/Server/Utils/AutoRemediation/RemediationVerifier.js.map +1 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js +9 -1
- package/build/dist/Server/Utils/Database/ProjectScopedReferenceValidator.js.map +1 -1
- package/build/dist/Server/Utils/EditionEnforcement.js +20 -158
- package/build/dist/Server/Utils/EditionEnforcement.js.map +1 -1
- package/build/dist/Server/Utils/LLM/LLMService.js +193 -54
- package/build/dist/Server/Utils/LLM/LLMService.js.map +1 -1
- package/build/dist/Server/Utils/RelaxedScimTeamLocksReport.js +160 -0
- package/build/dist/Server/Utils/RelaxedScimTeamLocksReport.js.map +1 -0
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js +25 -0
- package/build/dist/Server/Utils/Rules/RuleRun/RuleRunRegistry.js.map +1 -1
- package/build/dist/Server/Utils/SameOriginRequest.js +151 -0
- package/build/dist/Server/Utils/SameOriginRequest.js.map +1 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.js +627 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayBudgetMetrics.js.map +1 -0
- package/build/dist/Server/Utils/SessionReplay/SessionReplayUsage.js +60 -5
- package/build/dist/Server/Utils/SessionReplay/SessionReplayUsage.js.map +1 -1
- package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js +2 -0
- package/build/dist/Server/Utils/TeamMember/ProjectLeaveResourceCleanup.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js +4 -1
- package/build/dist/Server/Utils/Telemetry/EntityRegistry.js.map +1 -1
- package/build/dist/Server/Utils/Telemetry/MessageQueueDiscovery.js +1015 -0
- package/build/dist/Server/Utils/Telemetry/MessageQueueDiscovery.js.map +1 -0
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js +4 -1
- package/build/dist/Server/Utils/Telemetry/ResourceEntityFilter.js.map +1 -1
- package/build/dist/Server/Utils/VendorAssets.js +3 -3
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js +19 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Alert.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js +19 -15
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/AlertEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js +17 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Auth.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js +186 -210
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/Incident.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.js +22 -16
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/IncidentEpisode.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js +233 -167
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/Actions/ScheduledMaintenance.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js +273 -111
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeams.js.map +1 -1
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.js +129 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsActivityDeduplicator.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.js +266 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCardChoices.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.js +258 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsCreateCommands.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.js +104 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsMessageSize.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.js +183 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsReplies.js.map +1 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.js +123 -0
- package/build/dist/Server/Utils/Workspace/MicrosoftTeams/MicrosoftTeamsTimezone.js.map +1 -0
- package/build/dist/Types/AI/AIAgentRunLimits.js +91 -0
- package/build/dist/Types/AI/AIAgentRunLimits.js.map +1 -0
- package/build/dist/Types/AI/ResourceAiAccessApi.js +30 -0
- package/build/dist/Types/AI/ResourceAiAccessApi.js.map +1 -0
- package/build/dist/Types/AI/ResourceAiAccessPermissions.js +98 -0
- package/build/dist/Types/AI/ResourceAiAccessPermissions.js.map +1 -0
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPlan.js +116 -29
- package/build/dist/Types/AutoRemediation/AiRemediationCommandPlan.js.map +1 -1
- package/build/dist/Types/Code/CodeType.js +2 -0
- package/build/dist/Types/Code/CodeType.js.map +1 -1
- package/build/dist/Types/Code/JsonSyntax.js +604 -0
- package/build/dist/Types/Code/JsonSyntax.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldCreateSettings.js +310 -0
- package/build/dist/Types/CustomField/CustomFieldCreateSettings.js.map +1 -0
- package/build/dist/Types/CustomField/CustomFieldMappingCatalog.js +38 -0
- package/build/dist/Types/CustomField/CustomFieldMappingCatalog.js.map +1 -1
- package/build/dist/Types/CustomField/CustomFieldValueValidator.js +10 -7
- package/build/dist/Types/CustomField/CustomFieldValueValidator.js.map +1 -1
- package/build/dist/Types/EnterpriseLicense/EnterpriseLicensePeriods.js +1 -1
- package/build/dist/Types/Icon/IconProp.js +2 -0
- package/build/dist/Types/Icon/IconProp.js.map +1 -1
- package/build/dist/Types/Incident/IncidentFormIpAllowlist.js +119 -0
- package/build/dist/Types/Incident/IncidentFormIpAllowlist.js.map +1 -0
- package/build/dist/Types/Incident/IncidentFormPublic.js +678 -0
- package/build/dist/Types/Incident/IncidentFormPublic.js.map +1 -0
- package/build/dist/Types/Kubernetes/KubernetesClusterAiAccess.js +10 -3
- package/build/dist/Types/Kubernetes/KubernetesClusterAiAccess.js.map +1 -1
- package/build/dist/Types/MessageQueue/MessageQueueIdentity.js +184 -0
- package/build/dist/Types/MessageQueue/MessageQueueIdentity.js.map +1 -0
- package/build/dist/Types/MessageQueue/MessageQueueManualIdentity.js +190 -0
- package/build/dist/Types/MessageQueue/MessageQueueManualIdentity.js.map +1 -0
- package/build/dist/Types/MessageQueue/MessageQueueMetricCatalog.js +1057 -0
- package/build/dist/Types/MessageQueue/MessageQueueMetricCatalog.js.map +1 -0
- package/build/dist/Types/MessageQueue/MessagingSystem.js +394 -0
- package/build/dist/Types/MessageQueue/MessagingSystem.js.map +1 -0
- package/build/dist/Types/MessageQueue/MessagingTelemetryResolver.js +1768 -0
- package/build/dist/Types/MessageQueue/MessagingTelemetryResolver.js.map +1 -0
- package/build/dist/Types/Monitor/MessageQueueAlertTemplates.js +1207 -0
- package/build/dist/Types/Monitor/MessageQueueAlertTemplates.js.map +1 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js +47 -21
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationCatalog.js.map +1 -1
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js +5 -0
- package/build/dist/Types/Monitor/Recommendation/MonitorRecommendationTypes.js.map +1 -1
- package/build/dist/Types/Monitor/RumAlertTemplates.js +199 -3
- package/build/dist/Types/Monitor/RumAlertTemplates.js.map +1 -1
- package/build/dist/Types/Permission.js +274 -0
- package/build/dist/Types/Permission.js.map +1 -1
- package/build/dist/Types/ResourceAiAgent/AiResourceType.js +242 -0
- package/build/dist/Types/ResourceAiAgent/AiResourceType.js.map +1 -0
- package/build/dist/Types/ResourceAiAgent/ResourceAiAccess.js +281 -0
- package/build/dist/Types/ResourceAiAgent/ResourceAiAccess.js.map +1 -0
- package/build/dist/Types/Rules/RuleCriteriaFieldRegistry.js +12 -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/Rum/SessionReplayBudgetMetricType.js +45 -0
- package/build/dist/Types/Rum/SessionReplayBudgetMetricType.js.map +1 -0
- package/build/dist/Types/Runbook/RunbookStepType.js +27 -0
- package/build/dist/Types/Runbook/RunbookStepType.js.map +1 -1
- package/build/dist/Types/Team/ComplianceNotificationChannel.js +4 -3
- package/build/dist/Types/Team/ComplianceNotificationChannel.js.map +1 -1
- package/build/dist/Types/Team/ComplianceRule.js +48 -14
- package/build/dist/Types/Team/ComplianceRule.js.map +1 -1
- package/build/dist/Types/Team/ComplianceRuleType.js +2 -2
- package/build/dist/Types/Telemetry/EntityType.js +16 -0
- package/build/dist/Types/Telemetry/EntityType.js.map +1 -1
- package/build/dist/Types/Telemetry/TelemetryIngestSurface.js +13 -2
- package/build/dist/Types/Telemetry/TelemetryIngestSurface.js.map +1 -1
- package/build/dist/Types/XML.js +23 -0
- package/build/dist/Types/XML.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js +641 -266
- package/build/dist/UI/Components/CodeEditor/CodeEditor.js.map +1 -1
- package/build/dist/UI/Components/CodeEditor/CodeEditorCommands.js +464 -0
- package/build/dist/UI/Components/CodeEditor/CodeEditorCommands.js.map +1 -0
- package/build/dist/UI/Components/CodeEditor/CodeEditorHighlight.js +69 -0
- package/build/dist/UI/Components/CodeEditor/CodeEditorHighlight.js.map +1 -0
- package/build/dist/UI/Components/CodeEditor/CodeEditorLanguages.js +108 -0
- package/build/dist/UI/Components/CodeEditor/CodeEditorLanguages.js.map +1 -0
- package/build/dist/UI/Components/CodeEditor/YamlEditor.js +14 -186
- package/build/dist/UI/Components/CodeEditor/YamlEditor.js.map +1 -1
- package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js +5 -1
- package/build/dist/UI/Components/CopyTextButton/CopyTextButton.js.map +1 -1
- package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js +5 -14
- package/build/dist/UI/Components/CustomFields/CustomFieldModelFormFields.js.map +1 -1
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js +14 -13
- package/build/dist/UI/Components/EditionLabel/EditionLabel.js.map +1 -1
- package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js +1 -1
- package/build/dist/UI/Components/ErrorMessage/ErrorMessage.js.map +1 -1
- package/build/dist/UI/Components/Forms/Fields/FormField.js +8 -3
- package/build/dist/UI/Components/Forms/Fields/FormField.js.map +1 -1
- package/build/dist/UI/Components/Icon/Icon.js +8 -0
- package/build/dist/UI/Components/Icon/Icon.js.map +1 -1
- package/build/dist/UI/Components/Input/Input.js +11 -3
- package/build/dist/UI/Components/Input/Input.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js +2 -1
- package/build/dist/UI/Components/LogsViewer/LogsViewer.js.map +1 -1
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.js +14 -4
- package/build/dist/UI/Components/LogsViewer/components/LogsFacetSidebar.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/Markdown.tsx/MarkdownEditor.js +710 -65
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditor.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditorHistory.js +238 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownEditorHistory.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownListEditing.js +1028 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownListEditing.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownPaste.js +1088 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownPaste.js.map +1 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js +70 -10
- package/build/dist/UI/Components/Markdown.tsx/MarkdownViewer.js.map +1 -1
- package/build/dist/UI/Components/Markdown.tsx/MarkdownVisualEditing.js +887 -0
- package/build/dist/UI/Components/Markdown.tsx/MarkdownVisualEditing.js.map +1 -0
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js +57 -6
- package/build/dist/UI/Components/ModelTable/BaseModelTable.js.map +1 -1
- package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js +7 -5
- package/build/dist/UI/Components/ResetObjectID/ResetObjectID.js.map +1 -1
- package/build/dist/UI/Components/Table/EmptyTableMessage.js +51 -0
- package/build/dist/UI/Components/Table/EmptyTableMessage.js.map +1 -0
- package/build/dist/UI/Components/Table/Table.js +30 -11
- package/build/dist/UI/Components/Table/Table.js.map +1 -1
- package/build/dist/UI/Components/Table/TableRow.js +9 -2
- package/build/dist/UI/Components/Table/TableRow.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js +63 -1
- package/build/dist/UI/Components/TelemetryViewer/FacetVisibility.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js +4 -2
- package/build/dist/UI/Components/TelemetryViewer/TelemetryViewer.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js +91 -10
- package/build/dist/UI/Components/TelemetryViewer/components/LockedFilterChip.js.map +1 -1
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js +14 -4
- package/build/dist/UI/Components/TelemetryViewer/components/TelemetryFacetSidebar.js.map +1 -1
- package/build/dist/UI/Components/TextArea/TextArea.js +9 -3
- package/build/dist/UI/Components/TextArea/TextArea.js.map +1 -1
- package/build/dist/UI/Components/Workflow/ModelFieldPicker.js +1 -2
- package/build/dist/UI/Components/Workflow/ModelFieldPicker.js.map +1 -1
- package/build/dist/Utils/AI/InvestigationReport.js +71 -11
- package/build/dist/Utils/AI/InvestigationReport.js.map +1 -1
- package/build/dist/Utils/AiRemediation/Resource/CephCommandPolicy.js +1462 -0
- package/build/dist/Utils/AiRemediation/Resource/CephCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseCommandPolicy.js +122 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.js +1139 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseDiagnosticCatalog.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseQueryRedactor.js +1060 -0
- package/build/dist/Utils/AiRemediation/Resource/DatabaseQueryRedactor.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerCliGrammar.js +1301 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerCliGrammar.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.js +370 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerEngineCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.js +498 -0
- package/build/dist/Utils/AiRemediation/Resource/DockerSwarmCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/GovcCommandPolicy.js +1565 -0
- package/build/dist/Utils/AiRemediation/Resource/GovcCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/HostCommandPolicy.js +2206 -0
- package/build/dist/Utils/AiRemediation/Resource/HostCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.js +1129 -0
- package/build/dist/Utils/AiRemediation/Resource/ProxmoxCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicy.js +565 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicy.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.js +408 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceCommandPolicyCore.js.map +1 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceOutputRedactor.js +1910 -0
- package/build/dist/Utils/AiRemediation/Resource/ResourceOutputRedactor.js.map +1 -0
- package/build/dist/Utils/LabelRuleImportExport.js +2 -0
- package/build/dist/Utils/LabelRuleImportExport.js.map +1 -1
- package/build/dist/Utils/Markdown/UntrustedMarkdown.js +988 -0
- package/build/dist/Utils/Markdown/UntrustedMarkdown.js.map +1 -0
- package/build/dist/Utils/Monitor/IncomingEmailMonitorRequestUtil.js +34 -0
- package/build/dist/Utils/Monitor/IncomingEmailMonitorRequestUtil.js.map +1 -0
- package/build/dist/Utils/Monitor/MonitorLogSummaryUtil.js +148 -0
- package/build/dist/Utils/Monitor/MonitorLogSummaryUtil.js.map +1 -0
- package/build/dist/Utils/SessionReplay/SessionReplayBudgetMetricType.js +160 -0
- package/build/dist/Utils/SessionReplay/SessionReplayBudgetMetricType.js.map +1 -0
- package/build/dist/Utils/Telemetry/EntityKey.js +36 -0
- package/build/dist/Utils/Telemetry/EntityKey.js.map +1 -1
- package/package.json +1 -3
- package/Server/Utils/CommunityEditionSsoReport.ts +0 -361
- package/Tests/App/Accounts/LoginSsoEdition.test.tsx +0 -616
- package/Tests/App/AdminDashboard/AdminAuthenticationSsoEdition.test.tsx +0 -217
- package/Tests/App/AdminDashboard/GlobalSSOEnterpriseShells.test.tsx +0 -271
- package/Tests/App/Dashboard/CloudDocumentationMarkdown.test.ts +0 -215
- package/Tests/App/Dashboard/TelemetryResourceRetentionSettings.test.tsx +0 -784
- package/Tests/Server/Middleware/UserAuthorizationEditionEnforcement.test.ts +0 -518
- package/Tests/Server/Services/SsoRequirementReadMasking.test.ts +0 -419
- package/Tests/Server/Services/SsoRequirementWriteGuard.test.ts +0 -769
- package/Tests/UI/Components/CodeEditor.test.tsx +0 -638
- package/Tests/UI/Components/MonacoLoader.test.ts +0 -67
- package/Tests/UI/Components/MonacoRuntime.test.ts +0 -121
- package/Tests/UI/Components/Telemetry/TelemetryRetentionConfigForm.test.tsx +0 -329
- package/Tests/UI/Components/YamlEditor.test.tsx +0 -847
- package/UI/Components/CodeEditor/MonacoLoader.ts +0 -36
- package/UI/Components/Telemetry/TelemetryRetentionConfigForm.tsx +0 -319
- package/UI/Components/Telemetry/TelemetryRetentionConfigSummary.tsx +0 -223
- package/build/dist/Server/Utils/CommunityEditionSsoReport.js +0 -223
- package/build/dist/Server/Utils/CommunityEditionSsoReport.js.map +0 -1
- package/build/dist/UI/Components/CodeEditor/MonacoLoader.js +0 -34
- package/build/dist/UI/Components/CodeEditor/MonacoLoader.js.map +0 -1
- package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigForm.js +0 -171
- package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigForm.js.map +0 -1
- package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigSummary.js +0 -119
- package/build/dist/UI/Components/Telemetry/TelemetryRetentionConfigSummary.js.map +0 -1
|
@@ -0,0 +1,1839 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The docker CLI grammar the docker-engine and docker-swarm command
|
|
3
|
+
* policies share (DockerEngineCommandPolicy, DockerSwarmCommandPolicy):
|
|
4
|
+
* how the docker CLI (docker 29.x, cobra + pflag) finds the command in an
|
|
5
|
+
* argv and parses its flags, the engine's read commands both profiles
|
|
6
|
+
* allow, the commands neither ever allows, and the value checks every
|
|
7
|
+
* command uses.
|
|
8
|
+
*
|
|
9
|
+
* The agent spawns the docker CLI with the argv this grammar read, so the
|
|
10
|
+
* grammar has to see the SAME command, flags and positionals docker will
|
|
11
|
+
* see — otherwise a denied flag or a second container could hide inside
|
|
12
|
+
* what we took for a flag value. The rules, which parseDockerFlags()
|
|
13
|
+
* mirrors exactly (pflag's parseLongArg / parseSingleShortArg):
|
|
14
|
+
*
|
|
15
|
+
* - The command is picked before any flag is read. docker's global flags
|
|
16
|
+
* (-H/--host, -c/--context, --config, --tls*, -D/--debug,
|
|
17
|
+
* -l/--log-level, -v/--version) exist ONLY before the command, and are
|
|
18
|
+
* exactly what would point the CLI at another engine or another
|
|
19
|
+
* credential store, so ANY word that starts with "-" before the
|
|
20
|
+
* command (and, for a command group such as `docker container`, before
|
|
21
|
+
* its subcommand) is refused. After the command, a global flag is just
|
|
22
|
+
* a flag that command does not have.
|
|
23
|
+
* - "--flag=value" carries its value inline. "--flag value" takes the next
|
|
24
|
+
* word ONLY when the flag takes a value — whatever that word looks like
|
|
25
|
+
* ("--since -f" is a since of "-f"). A switch never takes the next word:
|
|
26
|
+
* "--all true" is the switch plus a positional "true". A switch may be
|
|
27
|
+
* written "--all=false"; its value is read like Go's strconv.ParseBool.
|
|
28
|
+
* - "-abc" is a cluster of one-letter flags read letter by letter: each
|
|
29
|
+
* switch letter is followed by another letter, until a letter that
|
|
30
|
+
* takes a value, whose value is "=x" ("-n=5"), the rest of the word
|
|
31
|
+
* ("-n5") or, when nothing is left, the next word ("-n 5").
|
|
32
|
+
* - "--" ends the flags; every word after it is positional. So does the
|
|
33
|
+
* first positional for a command that stops reading flags there
|
|
34
|
+
* (docker top: everything after the container is a ps option).
|
|
35
|
+
* - Flag names are case-sensitive and never normalized ("--no_trunc" is
|
|
36
|
+
* not "--no-trunc"); a flag the command does not have is an error.
|
|
37
|
+
*
|
|
38
|
+
* On top of the CLI's own rules, fail-closed ones: a flag this grammar does
|
|
39
|
+
* not list for the command is Denied (unknown means we cannot know what it
|
|
40
|
+
* does, or which word it swallows); a flag written twice is Denied unless
|
|
41
|
+
* docker appends its values (--filter), since pflag keeps the LAST value
|
|
42
|
+
* and "--no-stream --no-stream=false" would stream; a value that must be a
|
|
43
|
+
* number, a duration or a name is checked against exactly that; and a
|
|
44
|
+
* container, image, network, volume, service, node or stack is only ever
|
|
45
|
+
* a word docker itself would accept as one ([A-Za-z0-9][A-Za-z0-9_.-]*),
|
|
46
|
+
* so a unicode dash, a quote or a template can never pose as one.
|
|
47
|
+
*
|
|
48
|
+
* `--format` is limited to "json" (and "table" for list commands): a Go
|
|
49
|
+
* template can print a container's environment unlabelled, where the
|
|
50
|
+
* output redactor could not recognise it.
|
|
51
|
+
*
|
|
52
|
+
* Part of the import-closed resource policy directory that the resource AI
|
|
53
|
+
* agent carries a byte-identical copy of: relative imports of that set
|
|
54
|
+
* only, and nothing from Node.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
import { ResourceCommandTier } from "../../../Types/ResourceAiAgent/ResourceAiAccess";
|
|
58
|
+
import { MAX_COMMAND_LENGTH_CHARS } from "../../../Types/AutoRemediation/AiRemediationCommandPolicyVerdict";
|
|
59
|
+
import {
|
|
60
|
+
MAX_RESOURCE_COMMAND_TOKENS,
|
|
61
|
+
ResourceCommandPolicyResult,
|
|
62
|
+
deniedResult,
|
|
63
|
+
renderResourceDisplayCommand,
|
|
64
|
+
} from "./ResourceCommandPolicyCore";
|
|
65
|
+
|
|
66
|
+
// ---- Flags ------------------------------------------------------------------
|
|
67
|
+
|
|
68
|
+
export enum DockerFlagKind {
|
|
69
|
+
// A switch: never takes the next word ("-a", "--all", "--all=false").
|
|
70
|
+
Bool = "Bool",
|
|
71
|
+
// Always takes a value: "-n 5", "-n5", "-n=5", "--last 5", "--last=5".
|
|
72
|
+
Value = "Value",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface DockerFlagSpec {
|
|
76
|
+
// The long name, without dashes: "all", "tail", "no-stream".
|
|
77
|
+
name: string;
|
|
78
|
+
// The one-letter shorthand the real CLI defines for it, if any.
|
|
79
|
+
shorthand?: string | undefined;
|
|
80
|
+
kind: DockerFlagKind;
|
|
81
|
+
// Other long spellings the CLI accepts for the same flag ("time" for "timeout").
|
|
82
|
+
aliases?: ReadonlyArray<string> | undefined;
|
|
83
|
+
// docker appends every use (--filter); any other flag may be given once.
|
|
84
|
+
repeatable?: boolean | undefined;
|
|
85
|
+
/*
|
|
86
|
+
* Set when docker has the flag but OneUptime AI may never use it: the
|
|
87
|
+
* tail of the reason, after "the --x flag ".
|
|
88
|
+
*/
|
|
89
|
+
refusal?: string | undefined;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface DockerParsedArgs {
|
|
93
|
+
positionals: Array<string>;
|
|
94
|
+
/*
|
|
95
|
+
* Each flag's values in the order given, keyed by its long name. A
|
|
96
|
+
* switch's value is "true" or "false" (after ParseBool).
|
|
97
|
+
*/
|
|
98
|
+
values: Map<string, Array<string>>;
|
|
99
|
+
// The first problem: an unknown or refused flag, bad syntax, a missing value, a repeat.
|
|
100
|
+
problem?: string | undefined;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/*
|
|
104
|
+
* The long and short spellings of docker's global flags, which never follow
|
|
105
|
+
* the command. Used only to explain a refusal better.
|
|
106
|
+
*/
|
|
107
|
+
const GLOBAL_LONG_FLAGS: Set<string> = new Set<string>([
|
|
108
|
+
"host",
|
|
109
|
+
"context",
|
|
110
|
+
"config",
|
|
111
|
+
"tls",
|
|
112
|
+
"tlscacert",
|
|
113
|
+
"tlscert",
|
|
114
|
+
"tlskey",
|
|
115
|
+
"tlsverify",
|
|
116
|
+
"debug",
|
|
117
|
+
"log-level",
|
|
118
|
+
"version",
|
|
119
|
+
]);
|
|
120
|
+
|
|
121
|
+
const GLOBAL_SHORT_FLAGS: Set<string> = new Set<string>([
|
|
122
|
+
"H",
|
|
123
|
+
"c",
|
|
124
|
+
"D",
|
|
125
|
+
"l",
|
|
126
|
+
"v",
|
|
127
|
+
]);
|
|
128
|
+
|
|
129
|
+
export const DOCKER_GLOBAL_FLAG_RULE: string =
|
|
130
|
+
"docker's global flags (-H/--host, -c/--context, --config, --tls*, -D/--debug, -l/--log-level) are never allowed: the agent always talks to its own engine with its own settings";
|
|
131
|
+
|
|
132
|
+
// Go's strconv.ParseBool, which pflag reads a switch's "=value" with.
|
|
133
|
+
const GO_TRUE_WORDS: Set<string> = new Set<string>([
|
|
134
|
+
"1",
|
|
135
|
+
"t",
|
|
136
|
+
"T",
|
|
137
|
+
"TRUE",
|
|
138
|
+
"true",
|
|
139
|
+
"True",
|
|
140
|
+
]);
|
|
141
|
+
|
|
142
|
+
const GO_FALSE_WORDS: Set<string> = new Set<string>([
|
|
143
|
+
"0",
|
|
144
|
+
"f",
|
|
145
|
+
"F",
|
|
146
|
+
"FALSE",
|
|
147
|
+
"false",
|
|
148
|
+
"False",
|
|
149
|
+
]);
|
|
150
|
+
|
|
151
|
+
function parseGoBool(value: string): boolean | null {
|
|
152
|
+
if (GO_TRUE_WORDS.has(value)) {
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if (GO_FALSE_WORDS.has(value)) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
return null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function findLongFlag(
|
|
164
|
+
flags: ReadonlyArray<DockerFlagSpec>,
|
|
165
|
+
name: string,
|
|
166
|
+
): DockerFlagSpec | undefined {
|
|
167
|
+
return flags.find((flag: DockerFlagSpec): boolean => {
|
|
168
|
+
return (
|
|
169
|
+
flag.name === name ||
|
|
170
|
+
(Array.isArray(flag.aliases) && flag.aliases.includes(name))
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function findShortFlag(
|
|
176
|
+
flags: ReadonlyArray<DockerFlagSpec>,
|
|
177
|
+
letter: string,
|
|
178
|
+
): DockerFlagSpec | undefined {
|
|
179
|
+
return flags.find((flag: DockerFlagSpec): boolean => {
|
|
180
|
+
return flag.shorthand !== undefined && flag.shorthand === letter;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// "-a/--all, --no-trunc, -f/--filter KEY=VALUE" — the flags a command allows.
|
|
185
|
+
export function describeAllowedDockerFlags(
|
|
186
|
+
flags: ReadonlyArray<DockerFlagSpec>,
|
|
187
|
+
): string {
|
|
188
|
+
const allowed: Array<string> = flags
|
|
189
|
+
.filter((flag: DockerFlagSpec): boolean => {
|
|
190
|
+
return !flag.refusal;
|
|
191
|
+
})
|
|
192
|
+
.map((flag: DockerFlagSpec): string => {
|
|
193
|
+
const long: string = `--${flag.name}`;
|
|
194
|
+
const written: string = flag.shorthand
|
|
195
|
+
? `-${flag.shorthand}/${long}`
|
|
196
|
+
: long;
|
|
197
|
+
return flag.kind === DockerFlagKind.Value ? `${written} VALUE` : written;
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
return allowed.length > 0 ? allowed.join(", ") : "none";
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
function describeUnknownFlag(data: {
|
|
204
|
+
shown: string;
|
|
205
|
+
bareName: string;
|
|
206
|
+
isShort: boolean;
|
|
207
|
+
command: string;
|
|
208
|
+
flags: ReadonlyArray<DockerFlagSpec>;
|
|
209
|
+
}): string {
|
|
210
|
+
const isGlobal: boolean = data.isShort
|
|
211
|
+
? GLOBAL_SHORT_FLAGS.has(data.bareName)
|
|
212
|
+
: GLOBAL_LONG_FLAGS.has(data.bareName) || data.bareName.startsWith("tls");
|
|
213
|
+
|
|
214
|
+
const allowed: string = `flags ${data.command} allows: ${describeAllowedDockerFlags(
|
|
215
|
+
data.flags,
|
|
216
|
+
)}`;
|
|
217
|
+
|
|
218
|
+
if (isGlobal) {
|
|
219
|
+
return `the ${data.shown} flag is not allowed: ${DOCKER_GLOBAL_FLAG_RULE} (${allowed})`;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return `the ${data.shown} flag is not one OneUptime AI may use with ${data.command} (${allowed})`;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/*
|
|
226
|
+
* Parse the words after the command path exactly the way pflag would (see
|
|
227
|
+
* the header). Stops at the first problem; a caller must refuse the
|
|
228
|
+
* command when `problem` is set.
|
|
229
|
+
*/
|
|
230
|
+
export function parseDockerFlags(data: {
|
|
231
|
+
words: Array<string>;
|
|
232
|
+
flags: ReadonlyArray<DockerFlagSpec>;
|
|
233
|
+
// For messages: "docker logs", "docker service update".
|
|
234
|
+
command: string;
|
|
235
|
+
// false for a command that stops reading flags at its first positional.
|
|
236
|
+
interspersed: boolean;
|
|
237
|
+
}): DockerParsedArgs {
|
|
238
|
+
const words: Array<string> = data.words;
|
|
239
|
+
const positionals: Array<string> = [];
|
|
240
|
+
const values: Map<string, Array<string>> = new Map<string, Array<string>>();
|
|
241
|
+
let flagsEnded: boolean = false;
|
|
242
|
+
|
|
243
|
+
const fail: (problem: string) => DockerParsedArgs = (
|
|
244
|
+
problem: string,
|
|
245
|
+
): DockerParsedArgs => {
|
|
246
|
+
return { positionals, values, problem };
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
// Records one value; returns why it cannot be recorded, or null.
|
|
250
|
+
const record: (
|
|
251
|
+
flag: DockerFlagSpec,
|
|
252
|
+
rawValue: string,
|
|
253
|
+
shown: string,
|
|
254
|
+
) => string | null = (
|
|
255
|
+
flag: DockerFlagSpec,
|
|
256
|
+
rawValue: string,
|
|
257
|
+
shown: string,
|
|
258
|
+
): string | null => {
|
|
259
|
+
let value: string = rawValue;
|
|
260
|
+
|
|
261
|
+
if (flag.kind === DockerFlagKind.Bool) {
|
|
262
|
+
const parsed: boolean | null = parseGoBool(rawValue);
|
|
263
|
+
|
|
264
|
+
if (parsed === null) {
|
|
265
|
+
return `the ${shown} flag is a switch: write it alone (or =true / =false), not with "${rawValue}"`;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
value = parsed ? "true" : "false";
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const existing: Array<string> | undefined = values.get(flag.name);
|
|
272
|
+
|
|
273
|
+
if (existing && !flag.repeatable) {
|
|
274
|
+
return `the ${shown} flag is given more than once: docker keeps only the last value, so write it once`;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if (existing) {
|
|
278
|
+
existing.push(value);
|
|
279
|
+
} else {
|
|
280
|
+
values.set(flag.name, [value]);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return null;
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
for (let index: number = 0; index < words.length; index++) {
|
|
287
|
+
const word: string = words[index] || "";
|
|
288
|
+
|
|
289
|
+
// pflag: "", "-" and anything not starting with "-" are positionals.
|
|
290
|
+
if (flagsEnded || word.length < 2 || !word.startsWith("-")) {
|
|
291
|
+
positionals.push(word);
|
|
292
|
+
|
|
293
|
+
if (!data.interspersed) {
|
|
294
|
+
flagsEnded = true;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (word === "--") {
|
|
301
|
+
flagsEnded = true;
|
|
302
|
+
continue;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (word.startsWith("--")) {
|
|
306
|
+
const body: string = word.slice(2);
|
|
307
|
+
|
|
308
|
+
if (body.startsWith("-") || body.startsWith("=")) {
|
|
309
|
+
return fail(`"${word}" is not valid flag syntax`);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const equals: number = body.indexOf("=");
|
|
313
|
+
const name: string = equals >= 0 ? body.slice(0, equals) : body;
|
|
314
|
+
const shown: string = `--${name}`;
|
|
315
|
+
const flag: DockerFlagSpec | undefined = findLongFlag(data.flags, name);
|
|
316
|
+
|
|
317
|
+
if (!flag) {
|
|
318
|
+
return fail(
|
|
319
|
+
describeUnknownFlag({
|
|
320
|
+
shown,
|
|
321
|
+
bareName: name,
|
|
322
|
+
isShort: false,
|
|
323
|
+
command: data.command,
|
|
324
|
+
flags: data.flags,
|
|
325
|
+
}),
|
|
326
|
+
);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if (flag.refusal) {
|
|
330
|
+
return fail(`the ${shown} flag ${flag.refusal}`);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
let value: string;
|
|
334
|
+
|
|
335
|
+
if (equals >= 0) {
|
|
336
|
+
value = body.slice(equals + 1);
|
|
337
|
+
} else if (flag.kind === DockerFlagKind.Bool) {
|
|
338
|
+
value = "true";
|
|
339
|
+
} else if (index + 1 < words.length) {
|
|
340
|
+
value = words[index + 1] || "";
|
|
341
|
+
index++;
|
|
342
|
+
} else {
|
|
343
|
+
return fail(`the ${shown} flag needs a value`);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
const problem: string | null = record(flag, value, shown);
|
|
347
|
+
|
|
348
|
+
if (problem) {
|
|
349
|
+
return fail(problem);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// "-abc": a cluster of one-letter flags, read letter by letter like pflag.
|
|
356
|
+
let rest: string = word.slice(1);
|
|
357
|
+
|
|
358
|
+
while (rest.length > 0) {
|
|
359
|
+
const letter: string = rest.charAt(0);
|
|
360
|
+
const shown: string =
|
|
361
|
+
word === `-${letter}` || word.startsWith(`-${letter}=`)
|
|
362
|
+
? `-${letter}`
|
|
363
|
+
: `-${letter} (in "${word}")`;
|
|
364
|
+
const flag: DockerFlagSpec | undefined = findShortFlag(
|
|
365
|
+
data.flags,
|
|
366
|
+
letter,
|
|
367
|
+
);
|
|
368
|
+
|
|
369
|
+
if (!flag) {
|
|
370
|
+
return fail(
|
|
371
|
+
describeUnknownFlag({
|
|
372
|
+
shown,
|
|
373
|
+
bareName: letter,
|
|
374
|
+
isShort: true,
|
|
375
|
+
command: data.command,
|
|
376
|
+
flags: data.flags,
|
|
377
|
+
}),
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if (flag.refusal) {
|
|
382
|
+
return fail(`the ${shown} flag ${flag.refusal}`);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
let value: string;
|
|
386
|
+
|
|
387
|
+
if (rest.length > 2 && rest.charAt(1) === "=") {
|
|
388
|
+
// "-n=5" (and "-a=false")
|
|
389
|
+
value = rest.slice(2);
|
|
390
|
+
rest = "";
|
|
391
|
+
} else if (flag.kind === DockerFlagKind.Bool) {
|
|
392
|
+
// "-aq": the next letter is another flag.
|
|
393
|
+
value = "true";
|
|
394
|
+
rest = rest.slice(1);
|
|
395
|
+
} else if (rest.length > 1) {
|
|
396
|
+
// "-n5"
|
|
397
|
+
value = rest.slice(1);
|
|
398
|
+
rest = "";
|
|
399
|
+
} else if (index + 1 < words.length) {
|
|
400
|
+
// "-n 5"
|
|
401
|
+
value = words[index + 1] || "";
|
|
402
|
+
index++;
|
|
403
|
+
rest = "";
|
|
404
|
+
} else {
|
|
405
|
+
return fail(`the ${shown} flag needs a value`);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
const problem: string | null = record(flag, value, shown);
|
|
409
|
+
|
|
410
|
+
if (problem) {
|
|
411
|
+
return fail(problem);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return { positionals, values };
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
// Every value a flag was given, by its long name.
|
|
420
|
+
export function dockerFlagValues(
|
|
421
|
+
parsed: DockerParsedArgs,
|
|
422
|
+
name: string,
|
|
423
|
+
): Array<string> {
|
|
424
|
+
return parsed.values.get(name) || [];
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// The flag's value (flags other than --filter are given at most once).
|
|
428
|
+
export function dockerFlagValue(
|
|
429
|
+
parsed: DockerParsedArgs,
|
|
430
|
+
name: string,
|
|
431
|
+
): string | undefined {
|
|
432
|
+
const all: Array<string> = dockerFlagValues(parsed, name);
|
|
433
|
+
return all.length > 0 ? all[all.length - 1] : undefined;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export function isDockerFlagGiven(
|
|
437
|
+
parsed: DockerParsedArgs,
|
|
438
|
+
name: string,
|
|
439
|
+
): boolean {
|
|
440
|
+
return dockerFlagValues(parsed, name).length > 0;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
// A switch that is on: given, and not "=false".
|
|
444
|
+
export function isDockerSwitchOn(
|
|
445
|
+
parsed: DockerParsedArgs,
|
|
446
|
+
name: string,
|
|
447
|
+
): boolean {
|
|
448
|
+
return dockerFlagValue(parsed, name) === "true";
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
// ---- Values -----------------------------------------------------------------
|
|
452
|
+
|
|
453
|
+
/*
|
|
454
|
+
* A container, network, volume, service, task, node or stack: a name docker
|
|
455
|
+
* accepts, or an id (or a hex prefix of one). ASCII only, so a unicode dash
|
|
456
|
+
* or a look-alike letter never passes for a name — or for a flag.
|
|
457
|
+
*/
|
|
458
|
+
const DOCKER_OBJECT_NAME_REGEX: RegExp = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,254}$/;
|
|
459
|
+
|
|
460
|
+
/*
|
|
461
|
+
* An image reference: [registry[:port]/]repository[:tag][@digest]. Checked
|
|
462
|
+
* loosely (docker checks the rest); never a flag, a space or a template.
|
|
463
|
+
*/
|
|
464
|
+
const DOCKER_IMAGE_REFERENCE_REGEX: RegExp =
|
|
465
|
+
/^[A-Za-z0-9][A-Za-z0-9_.:/@+-]{0,254}$/;
|
|
466
|
+
|
|
467
|
+
export function isDockerObjectName(word: string): boolean {
|
|
468
|
+
return typeof word === "string" && DOCKER_OBJECT_NAME_REGEX.test(word);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
export function isDockerImageReference(word: string): boolean {
|
|
472
|
+
return typeof word === "string" && DOCKER_IMAGE_REFERENCE_REGEX.test(word);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
// Why one of these words is not a name of this kind, or null when all are.
|
|
476
|
+
export function findBadDockerName(
|
|
477
|
+
words: Array<string>,
|
|
478
|
+
kind: string,
|
|
479
|
+
isValid: (word: string) => boolean = isDockerObjectName,
|
|
480
|
+
): string | null {
|
|
481
|
+
for (const word of words) {
|
|
482
|
+
if (!isValid(word)) {
|
|
483
|
+
return `"${word}" is not a ${kind} name or id docker accepts (letters, digits, "_", "." and "-", starting with a letter or digit)`;
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return null;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// Plain digits: no sign, no spaces, at most nine of them.
|
|
491
|
+
const DOCKER_COUNT_DIGITS_REGEX: RegExp = /^[0-9]{1,9}$/;
|
|
492
|
+
|
|
493
|
+
// A whole number 0..max written in plain digits (no sign, no spaces), or null.
|
|
494
|
+
export function parseDockerCount(value: string, max: number): number | null {
|
|
495
|
+
if (typeof value !== "string" || !DOCKER_COUNT_DIGITS_REGEX.test(value)) {
|
|
496
|
+
return null;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
const count: number = Number(value);
|
|
500
|
+
return count <= max ? count : null;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
// A Go duration, as docker reads --since 30m: "90s", "1h30m", "1.5h".
|
|
504
|
+
const GO_DURATION_REGEX: RegExp =
|
|
505
|
+
/^(?:[0-9]{1,9}(?:\.[0-9]{1,9})?(?:ns|us|ms|s|m|h)){1,6}$/;
|
|
506
|
+
|
|
507
|
+
// An RFC 3339 date or date-time docker's --since/--until accepts.
|
|
508
|
+
const DATE_TIME_REGEX: RegExp =
|
|
509
|
+
/^[0-9]{4}-[0-9]{2}-[0-9]{2}(?:T[0-9]{2}:[0-9]{2}(?::[0-9]{2}(?:\.[0-9]{1,9})?)?(?:Z|[+-][0-9]{2}:?[0-9]{2})?)?$/;
|
|
510
|
+
|
|
511
|
+
// A Unix timestamp in seconds (2001 onwards), optionally with a fraction.
|
|
512
|
+
const UNIX_TIME_REGEX: RegExp = /^[0-9]{10}(?:\.[0-9]{1,9})?$/;
|
|
513
|
+
|
|
514
|
+
/*
|
|
515
|
+
* A --since / --until value: a relative duration ("30m", "2h"), an RFC 3339
|
|
516
|
+
* date or date-time, or a Unix timestamp. Never empty — docker reads an
|
|
517
|
+
* empty --since as no bound at all — and never "0" (the epoch).
|
|
518
|
+
*/
|
|
519
|
+
export function isDockerTimeValue(value: string): boolean {
|
|
520
|
+
if (typeof value !== "string" || !value || value.length > 64) {
|
|
521
|
+
return false;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
return (
|
|
525
|
+
GO_DURATION_REGEX.test(value) ||
|
|
526
|
+
DATE_TIME_REGEX.test(value) ||
|
|
527
|
+
UNIX_TIME_REGEX.test(value)
|
|
528
|
+
);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export function isGoDuration(value: string): boolean {
|
|
532
|
+
return (
|
|
533
|
+
typeof value === "string" &&
|
|
534
|
+
value.length <= 64 &&
|
|
535
|
+
(value === "0" || GO_DURATION_REGEX.test(value))
|
|
536
|
+
);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const GO_DURATION_PART_REGEX: RegExp =
|
|
540
|
+
/([0-9]{1,9}(?:\.[0-9]{1,9})?)(ns|us|ms|s|m|h)/g;
|
|
541
|
+
|
|
542
|
+
const GO_DURATION_UNIT_SECONDS: Readonly<Record<string, number>> = {
|
|
543
|
+
ns: 1e-9,
|
|
544
|
+
us: 1e-6,
|
|
545
|
+
ms: 1e-3,
|
|
546
|
+
s: 1,
|
|
547
|
+
m: 60,
|
|
548
|
+
h: 3600,
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
/*
|
|
552
|
+
* A relative --since / --until value ("30m", "1h30m", "0s") in seconds, or
|
|
553
|
+
* null when the value is not one (an RFC 3339 time, a Unix timestamp). docker
|
|
554
|
+
* reads it as that long before now, so it always points into the past.
|
|
555
|
+
*/
|
|
556
|
+
export function parseDockerRelativeTimeSeconds(value: string): number | null {
|
|
557
|
+
if (typeof value !== "string" || !isDockerTimeValue(value)) {
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if (!GO_DURATION_REGEX.test(value)) {
|
|
562
|
+
return null;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
let seconds: number = 0;
|
|
566
|
+
|
|
567
|
+
GO_DURATION_PART_REGEX.lastIndex = 0;
|
|
568
|
+
let part: RegExpExecArray | null = GO_DURATION_PART_REGEX.exec(value);
|
|
569
|
+
|
|
570
|
+
while (part) {
|
|
571
|
+
seconds +=
|
|
572
|
+
Number(part[1] || "0") * (GO_DURATION_UNIT_SECONDS[part[2] || ""] || 0);
|
|
573
|
+
part = GO_DURATION_PART_REGEX.exec(value);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
return seconds;
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
/*
|
|
580
|
+
* A memory size as docker reads --memory / --limit-memory (units.RAMInBytes):
|
|
581
|
+
* digits, an optional fraction, an optional k/m/g/t (with an optional "i")
|
|
582
|
+
* and an optional "b": "512m", "1g", "1.5GiB", "536870912".
|
|
583
|
+
*/
|
|
584
|
+
const MEMORY_SIZE_REGEX: RegExp =
|
|
585
|
+
/^[0-9]{1,15}(?:\.[0-9]{1,6})?(?:[kKmMgGtT][iI]?)?[bB]?$/;
|
|
586
|
+
|
|
587
|
+
export function isDockerMemorySize(value: string): boolean {
|
|
588
|
+
return typeof value === "string" && MEMORY_SIZE_REGEX.test(value);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// A number of CPUs as docker reads --cpus / --limit-cpu: "0.5", "2", "1.25".
|
|
592
|
+
const CPU_COUNT_REGEX: RegExp = /^[0-9]{1,4}(?:\.[0-9]{1,3})?$/;
|
|
593
|
+
|
|
594
|
+
export function isDockerCpuCount(value: string): boolean {
|
|
595
|
+
return typeof value === "string" && CPU_COUNT_REGEX.test(value);
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
// "--filter KEY=VALUE", as docker's filter parser requires.
|
|
599
|
+
const DOCKER_FILTER_REGEX: RegExp = /^[A-Za-z][A-Za-z0-9_.-]{0,63}=/;
|
|
600
|
+
|
|
601
|
+
// Why a --filter value is unusable, or null when every one is KEY=VALUE.
|
|
602
|
+
export function findBadDockerFilter(parsed: DockerParsedArgs): string | null {
|
|
603
|
+
for (const filter of dockerFlagValues(parsed, "filter")) {
|
|
604
|
+
if (!DOCKER_FILTER_REGEX.test(filter) || filter.length > 256) {
|
|
605
|
+
return `--filter takes KEY=VALUE (e.g. --filter status=exited or --filter name=web), not "${filter}"`;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return null;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// Why --format is unusable, or null when it is absent or one of `allowed`.
|
|
613
|
+
export function findBadDockerFormat(
|
|
614
|
+
parsed: DockerParsedArgs,
|
|
615
|
+
allowed: ReadonlyArray<string>,
|
|
616
|
+
): string | null {
|
|
617
|
+
const format: string | undefined = dockerFlagValue(parsed, "format");
|
|
618
|
+
|
|
619
|
+
if (format === undefined || allowed.includes(format)) {
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
const choices: string = allowed
|
|
624
|
+
.map((choice: string): string => {
|
|
625
|
+
return `"${choice}"`;
|
|
626
|
+
})
|
|
627
|
+
.join(" or ");
|
|
628
|
+
|
|
629
|
+
return `--format may only be ${choices} (or left out), not "${format}": Go templates are not allowed, since one can print a container's environment unlabelled`;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
// ---- Command paths ----------------------------------------------------------
|
|
633
|
+
|
|
634
|
+
/*
|
|
635
|
+
* The command groups whose subcommands this grammar reads one by one, with
|
|
636
|
+
* every alias docker accepts for a subcommand mapped to its canonical name
|
|
637
|
+
* (`docker container list` and `docker container ps` are `container ls`).
|
|
638
|
+
* A subcommand not listed is looked up as written and refused.
|
|
639
|
+
*/
|
|
640
|
+
const SUBCOMMAND_GROUPS: ReadonlyMap<
|
|
641
|
+
string,
|
|
642
|
+
ReadonlyMap<string, string>
|
|
643
|
+
> = new Map<string, ReadonlyMap<string, string>>([
|
|
644
|
+
[
|
|
645
|
+
"container",
|
|
646
|
+
new Map<string, string>([
|
|
647
|
+
["ls", "ls"],
|
|
648
|
+
["list", "ls"],
|
|
649
|
+
["ps", "ls"],
|
|
650
|
+
["inspect", "inspect"],
|
|
651
|
+
["logs", "logs"],
|
|
652
|
+
["stats", "stats"],
|
|
653
|
+
["top", "top"],
|
|
654
|
+
["port", "port"],
|
|
655
|
+
["diff", "diff"],
|
|
656
|
+
["restart", "restart"],
|
|
657
|
+
["start", "start"],
|
|
658
|
+
["unpause", "unpause"],
|
|
659
|
+
["stop", "stop"],
|
|
660
|
+
["kill", "kill"],
|
|
661
|
+
["pause", "pause"],
|
|
662
|
+
["update", "update"],
|
|
663
|
+
["rm", "rm"],
|
|
664
|
+
["remove", "rm"],
|
|
665
|
+
]),
|
|
666
|
+
],
|
|
667
|
+
[
|
|
668
|
+
"image",
|
|
669
|
+
new Map<string, string>([
|
|
670
|
+
["ls", "ls"],
|
|
671
|
+
["list", "ls"],
|
|
672
|
+
["inspect", "inspect"],
|
|
673
|
+
["rm", "rm"],
|
|
674
|
+
["remove", "rm"],
|
|
675
|
+
["rmi", "rm"],
|
|
676
|
+
]),
|
|
677
|
+
],
|
|
678
|
+
[
|
|
679
|
+
"network",
|
|
680
|
+
new Map<string, string>([
|
|
681
|
+
["ls", "ls"],
|
|
682
|
+
["list", "ls"],
|
|
683
|
+
["inspect", "inspect"],
|
|
684
|
+
["rm", "rm"],
|
|
685
|
+
["remove", "rm"],
|
|
686
|
+
]),
|
|
687
|
+
],
|
|
688
|
+
[
|
|
689
|
+
"volume",
|
|
690
|
+
new Map<string, string>([
|
|
691
|
+
["ls", "ls"],
|
|
692
|
+
["list", "ls"],
|
|
693
|
+
["inspect", "inspect"],
|
|
694
|
+
["rm", "rm"],
|
|
695
|
+
["remove", "rm"],
|
|
696
|
+
]),
|
|
697
|
+
],
|
|
698
|
+
[
|
|
699
|
+
"system",
|
|
700
|
+
new Map<string, string>([
|
|
701
|
+
["df", "df"],
|
|
702
|
+
["info", "info"],
|
|
703
|
+
["events", "events"],
|
|
704
|
+
]),
|
|
705
|
+
],
|
|
706
|
+
[
|
|
707
|
+
"service",
|
|
708
|
+
new Map<string, string>([
|
|
709
|
+
["ls", "ls"],
|
|
710
|
+
["list", "ls"],
|
|
711
|
+
["ps", "ps"],
|
|
712
|
+
["inspect", "inspect"],
|
|
713
|
+
["logs", "logs"],
|
|
714
|
+
["update", "update"],
|
|
715
|
+
["rollback", "rollback"],
|
|
716
|
+
["scale", "scale"],
|
|
717
|
+
["rm", "rm"],
|
|
718
|
+
["remove", "rm"],
|
|
719
|
+
]),
|
|
720
|
+
],
|
|
721
|
+
[
|
|
722
|
+
"node",
|
|
723
|
+
new Map<string, string>([
|
|
724
|
+
["ls", "ls"],
|
|
725
|
+
["list", "ls"],
|
|
726
|
+
["ps", "ps"],
|
|
727
|
+
["inspect", "inspect"],
|
|
728
|
+
["update", "update"],
|
|
729
|
+
["rm", "rm"],
|
|
730
|
+
["remove", "rm"],
|
|
731
|
+
]),
|
|
732
|
+
],
|
|
733
|
+
[
|
|
734
|
+
"stack",
|
|
735
|
+
new Map<string, string>([
|
|
736
|
+
["ls", "ls"],
|
|
737
|
+
["list", "ls"],
|
|
738
|
+
["ps", "ps"],
|
|
739
|
+
["services", "services"],
|
|
740
|
+
["deploy", "deploy"],
|
|
741
|
+
["up", "deploy"],
|
|
742
|
+
["rm", "rm"],
|
|
743
|
+
["remove", "rm"],
|
|
744
|
+
["down", "rm"],
|
|
745
|
+
]),
|
|
746
|
+
],
|
|
747
|
+
]);
|
|
748
|
+
|
|
749
|
+
export interface DockerCommandPath {
|
|
750
|
+
/*
|
|
751
|
+
* The canonical command path: "ps", "container ls", "service update" —
|
|
752
|
+
* or the group alone ("container") when no subcommand was written.
|
|
753
|
+
*/
|
|
754
|
+
path: string;
|
|
755
|
+
// The command group ("container"), when the command is in one.
|
|
756
|
+
group?: string | undefined;
|
|
757
|
+
// How the command was written, for messages: "container list".
|
|
758
|
+
written: string;
|
|
759
|
+
// The words after the command path, for the flag parser.
|
|
760
|
+
rest: Array<string>;
|
|
761
|
+
// Set when no command can be read: a flag before it, or a group with no subcommand.
|
|
762
|
+
problem?: string | undefined;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/*
|
|
766
|
+
* Find the command in an argv whose first word is "docker": the word after
|
|
767
|
+
* it, and for a command group the word after that. Refuses a flag in front
|
|
768
|
+
* of either (see the header: that is where docker's global flags live).
|
|
769
|
+
*/
|
|
770
|
+
export function resolveDockerCommandPath(
|
|
771
|
+
words: Array<string>,
|
|
772
|
+
): DockerCommandPath {
|
|
773
|
+
const first: string | undefined = words[1];
|
|
774
|
+
|
|
775
|
+
if (first === undefined) {
|
|
776
|
+
return {
|
|
777
|
+
path: "",
|
|
778
|
+
written: "",
|
|
779
|
+
rest: [],
|
|
780
|
+
problem:
|
|
781
|
+
'a docker command must name what to run after "docker" (e.g. docker ps)',
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
if (first.startsWith("-") && first.length > 1) {
|
|
786
|
+
return {
|
|
787
|
+
path: "",
|
|
788
|
+
written: first,
|
|
789
|
+
rest: words.slice(2),
|
|
790
|
+
problem: `"${first}" comes before the docker command: ${DOCKER_GLOBAL_FLAG_RULE}. Write the command right after "docker" (e.g. docker ps)`,
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
const group: ReadonlyMap<string, string> | undefined =
|
|
795
|
+
SUBCOMMAND_GROUPS.get(first);
|
|
796
|
+
|
|
797
|
+
if (!group) {
|
|
798
|
+
return { path: first, written: first, rest: words.slice(2) };
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
const second: string | undefined = words[2];
|
|
802
|
+
|
|
803
|
+
if (second === undefined) {
|
|
804
|
+
return {
|
|
805
|
+
path: first,
|
|
806
|
+
group: first,
|
|
807
|
+
written: first,
|
|
808
|
+
rest: [],
|
|
809
|
+
problem: `docker ${first} needs a subcommand (e.g. docker ${first} ls)`,
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
if (second.startsWith("-") && second.length > 1) {
|
|
814
|
+
return {
|
|
815
|
+
path: first,
|
|
816
|
+
group: first,
|
|
817
|
+
written: `${first} ${second}`,
|
|
818
|
+
rest: words.slice(3),
|
|
819
|
+
problem: `"${second}" comes before the docker ${first} subcommand: write the subcommand right after "docker ${first}" and its flags after it (e.g. docker ${first} ls)`,
|
|
820
|
+
};
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
return {
|
|
824
|
+
path: `${first} ${group.get(second) || second}`,
|
|
825
|
+
group: first,
|
|
826
|
+
written: `${first} ${second}`,
|
|
827
|
+
rest: words.slice(3),
|
|
828
|
+
};
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
// ---- Commands and profiles --------------------------------------------------
|
|
832
|
+
|
|
833
|
+
// What a command's judge says about one parsed command.
|
|
834
|
+
export interface DockerJudgement {
|
|
835
|
+
tier: ResourceCommandTier;
|
|
836
|
+
reason: string;
|
|
837
|
+
// The objects a write changes, as written. Ignored for reads.
|
|
838
|
+
targets?: Array<string> | undefined;
|
|
839
|
+
requiresHuman?: boolean | undefined;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export interface DockerCommandSpec {
|
|
843
|
+
// The audit label: the canonical command path ("ps", "container ls", "service update").
|
|
844
|
+
verb: string;
|
|
845
|
+
flags: ReadonlyArray<DockerFlagSpec>;
|
|
846
|
+
// false for a command that stops reading flags at its first positional (docker top).
|
|
847
|
+
interspersed?: boolean | undefined;
|
|
848
|
+
judge(parsed: DockerParsedArgs, command: string): DockerJudgement;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
export interface DockerProfile {
|
|
852
|
+
// The tool policy's name: "docker-engine", "docker-swarm".
|
|
853
|
+
name: string;
|
|
854
|
+
// "a Docker or Podman host", "a Docker Swarm cluster".
|
|
855
|
+
resourceDescription: string;
|
|
856
|
+
// Every command the profile allows, by canonical path.
|
|
857
|
+
commands: ReadonlyMap<string, DockerCommandSpec>;
|
|
858
|
+
/*
|
|
859
|
+
* Commands the profile knows and refuses (by canonical path, or by group
|
|
860
|
+
* for a whole group), with why — the tail after "it ". Consulted before
|
|
861
|
+
* DOCKER_COMMAND_REFUSALS.
|
|
862
|
+
*/
|
|
863
|
+
refusals: ReadonlyMap<string, string>;
|
|
864
|
+
// Appended to every command-level refusal: what the model may run instead.
|
|
865
|
+
allowedSummary: string;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
export function readJudgement(reason: string): DockerJudgement {
|
|
869
|
+
return { tier: ResourceCommandTier.Read, reason };
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export function deniedJudgement(reason: string): DockerJudgement {
|
|
873
|
+
return { tier: ResourceCommandTier.Denied, reason };
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
// The names a write lists, each once, in the order written.
|
|
877
|
+
export function uniqueDockerTargets(words: Array<string>): Array<string> {
|
|
878
|
+
const seen: Set<string> = new Set<string>();
|
|
879
|
+
const targets: Array<string> = [];
|
|
880
|
+
|
|
881
|
+
for (const word of words) {
|
|
882
|
+
if (!seen.has(word)) {
|
|
883
|
+
seen.add(word);
|
|
884
|
+
targets.push(word);
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
return targets;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/*
|
|
892
|
+
* Commands neither profile ever runs, with why (the tail after "it "): by
|
|
893
|
+
* canonical path, and by group for a group no subcommand of which is
|
|
894
|
+
* allowed. A profile's own refusals come first.
|
|
895
|
+
*/
|
|
896
|
+
export const DOCKER_COMMAND_REFUSALS: ReadonlyMap<string, string> = new Map<
|
|
897
|
+
string,
|
|
898
|
+
string
|
|
899
|
+
>([
|
|
900
|
+
["exec", "runs a program inside a container"],
|
|
901
|
+
["container exec", "runs a program inside a container"],
|
|
902
|
+
[
|
|
903
|
+
"run",
|
|
904
|
+
"creates and starts a new container, with any image, mounts and privileges",
|
|
905
|
+
],
|
|
906
|
+
[
|
|
907
|
+
"container run",
|
|
908
|
+
"creates and starts a new container, with any image, mounts and privileges",
|
|
909
|
+
],
|
|
910
|
+
["create", "creates a new container, with any image, mounts and privileges"],
|
|
911
|
+
[
|
|
912
|
+
"container create",
|
|
913
|
+
"creates a new container, with any image, mounts and privileges",
|
|
914
|
+
],
|
|
915
|
+
["cp", "copies files into or out of a container"],
|
|
916
|
+
["container cp", "copies files into or out of a container"],
|
|
917
|
+
["attach", "attaches to a container's terminal and input"],
|
|
918
|
+
["container attach", "attaches to a container's terminal and input"],
|
|
919
|
+
["rm", "deletes containers"],
|
|
920
|
+
["container rm", "deletes containers"],
|
|
921
|
+
["rmi", "deletes images"],
|
|
922
|
+
["image rm", "deletes images"],
|
|
923
|
+
["container prune", "deletes every stopped container"],
|
|
924
|
+
["image prune", "deletes images in bulk"],
|
|
925
|
+
["network prune", "deletes every unused network"],
|
|
926
|
+
["volume prune", "deletes volumes and the data in them"],
|
|
927
|
+
["system prune", "deletes containers, networks, images and caches in bulk"],
|
|
928
|
+
["build", "builds images from files on the host"],
|
|
929
|
+
["image build", "builds images from files on the host"],
|
|
930
|
+
["buildx", "builds images or manages the build cache"],
|
|
931
|
+
["builder", "builds images or manages the build cache"],
|
|
932
|
+
["bake", "builds images from files on the host"],
|
|
933
|
+
["push", "uploads images to a registry"],
|
|
934
|
+
["image push", "uploads images to a registry"],
|
|
935
|
+
["pull", "downloads images from a registry"],
|
|
936
|
+
["image pull", "downloads images from a registry"],
|
|
937
|
+
["login", "handles registry credentials"],
|
|
938
|
+
["logout", "handles registry credentials"],
|
|
939
|
+
["save", "copies images out of the engine"],
|
|
940
|
+
["image save", "copies images out of the engine"],
|
|
941
|
+
["load", "loads images into the engine"],
|
|
942
|
+
["image load", "loads images into the engine"],
|
|
943
|
+
["export", "copies a container's filesystem out of the engine"],
|
|
944
|
+
["container export", "copies a container's filesystem out of the engine"],
|
|
945
|
+
["import", "creates an image from a filesystem archive"],
|
|
946
|
+
["image import", "creates an image from a filesystem archive"],
|
|
947
|
+
["commit", "turns a container's filesystem into a new image"],
|
|
948
|
+
["container commit", "turns a container's filesystem into a new image"],
|
|
949
|
+
["rename", "renames a container, which breaks whatever finds it by name"],
|
|
950
|
+
[
|
|
951
|
+
"container rename",
|
|
952
|
+
"renames a container, which breaks whatever finds it by name",
|
|
953
|
+
],
|
|
954
|
+
["wait", "blocks until a container stops"],
|
|
955
|
+
["container wait", "blocks until a container stops"],
|
|
956
|
+
[
|
|
957
|
+
"history",
|
|
958
|
+
"prints an image's build steps, which can carry build arguments with secrets",
|
|
959
|
+
],
|
|
960
|
+
[
|
|
961
|
+
"image history",
|
|
962
|
+
"prints an image's build steps, which can carry build arguments with secrets",
|
|
963
|
+
],
|
|
964
|
+
["tag", "retags images"],
|
|
965
|
+
["image tag", "retags images"],
|
|
966
|
+
["search", "queries a registry"],
|
|
967
|
+
[
|
|
968
|
+
"plugin",
|
|
969
|
+
"installs, enables or reconfigures engine plugins, which run with full privileges",
|
|
970
|
+
],
|
|
971
|
+
["secret", "reads or changes swarm secrets"],
|
|
972
|
+
["config", "reads or changes swarm configs, whose contents it prints"],
|
|
973
|
+
["swarm", "changes swarm membership, join tokens or unlock keys"],
|
|
974
|
+
["context", "switches the engine the docker CLI talks to"],
|
|
975
|
+
["trust", "signs or revokes image trust data"],
|
|
976
|
+
["manifest", "creates or pushes image manifests"],
|
|
977
|
+
[
|
|
978
|
+
"compose",
|
|
979
|
+
"is not shipped with the agent (it creates, recreates and removes containers from a project file)",
|
|
980
|
+
],
|
|
981
|
+
["checkpoint", "checkpoints or restores containers"],
|
|
982
|
+
["network create", "changes container networking"],
|
|
983
|
+
["network rm", "changes container networking"],
|
|
984
|
+
["network connect", "changes container networking"],
|
|
985
|
+
["network disconnect", "changes container networking"],
|
|
986
|
+
["volume create", "creates or changes volumes"],
|
|
987
|
+
["volume update", "creates or changes volumes"],
|
|
988
|
+
["volume rm", "deletes volumes and the data in them"],
|
|
989
|
+
["system dial-stdio", "opens a raw connection to the engine's API"],
|
|
990
|
+
[
|
|
991
|
+
"service create",
|
|
992
|
+
"creates a new service, with any image, mounts and privileges",
|
|
993
|
+
],
|
|
994
|
+
["service rm", "deletes a service and all of its tasks"],
|
|
995
|
+
["stack deploy", "creates or replaces a whole stack from a compose file"],
|
|
996
|
+
["stack rm", "deletes a whole stack"],
|
|
997
|
+
["stack config", "renders a stack's compose files, environment included"],
|
|
998
|
+
["node rm", "removes a node from the swarm"],
|
|
999
|
+
["node promote", "changes which nodes manage the swarm (its Raft quorum)"],
|
|
1000
|
+
["node demote", "changes which nodes manage the swarm (its Raft quorum)"],
|
|
1001
|
+
]);
|
|
1002
|
+
|
|
1003
|
+
/*
|
|
1004
|
+
* Evaluate one argv (program included) against a profile. Total — any
|
|
1005
|
+
* input, any shape — and fail-closed: a command, subcommand, flag or value
|
|
1006
|
+
* the profile does not model is Denied with a reason that says what IS
|
|
1007
|
+
* allowed.
|
|
1008
|
+
*/
|
|
1009
|
+
export function evaluateDockerArgv(
|
|
1010
|
+
profile: DockerProfile,
|
|
1011
|
+
argv: unknown,
|
|
1012
|
+
): ResourceCommandPolicyResult {
|
|
1013
|
+
const words: Array<string> = Array.isArray(argv)
|
|
1014
|
+
? argv.filter((word: unknown): word is string => {
|
|
1015
|
+
return typeof word === "string";
|
|
1016
|
+
})
|
|
1017
|
+
: [];
|
|
1018
|
+
|
|
1019
|
+
if (!Array.isArray(argv) || words.length === 0) {
|
|
1020
|
+
return deniedResult(words, "Empty command.");
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1023
|
+
if (words.length !== argv.length) {
|
|
1024
|
+
return deniedResult(words, "Every word of the command must be a string.");
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
if (words[0] !== "docker") {
|
|
1028
|
+
return deniedResult(
|
|
1029
|
+
words,
|
|
1030
|
+
`the ${profile.name} command policy covers the docker CLI only: start the command with "docker"`,
|
|
1031
|
+
);
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
// The dispatcher's bounds, again: this policy never relies on a caller.
|
|
1035
|
+
if (words.length > MAX_RESOURCE_COMMAND_TOKENS) {
|
|
1036
|
+
return deniedResult(
|
|
1037
|
+
words,
|
|
1038
|
+
`A command may have at most ${MAX_RESOURCE_COMMAND_TOKENS} words.`,
|
|
1039
|
+
);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
if (words.join(" ").length > MAX_COMMAND_LENGTH_CHARS) {
|
|
1043
|
+
return deniedResult(
|
|
1044
|
+
words,
|
|
1045
|
+
`Command exceeds the ${MAX_COMMAND_LENGTH_CHARS}-character limit.`,
|
|
1046
|
+
);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
const deny: (reason: string, verb: string) => ResourceCommandPolicyResult = (
|
|
1050
|
+
reason: string,
|
|
1051
|
+
verb: string,
|
|
1052
|
+
): ResourceCommandPolicyResult => {
|
|
1053
|
+
return { ...deniedResult(words, reason), verb };
|
|
1054
|
+
};
|
|
1055
|
+
|
|
1056
|
+
const resolved: DockerCommandPath = resolveDockerCommandPath(words);
|
|
1057
|
+
const spec: DockerCommandSpec | undefined = resolved.problem
|
|
1058
|
+
? undefined
|
|
1059
|
+
: profile.commands.get(resolved.path);
|
|
1060
|
+
|
|
1061
|
+
if (!spec) {
|
|
1062
|
+
const refusal: string | undefined = resolved.path
|
|
1063
|
+
? profile.refusals.get(resolved.path) ||
|
|
1064
|
+
(resolved.group ? profile.refusals.get(resolved.group) : undefined) ||
|
|
1065
|
+
DOCKER_COMMAND_REFUSALS.get(resolved.path) ||
|
|
1066
|
+
(resolved.group
|
|
1067
|
+
? DOCKER_COMMAND_REFUSALS.get(resolved.group)
|
|
1068
|
+
: undefined)
|
|
1069
|
+
: undefined;
|
|
1070
|
+
|
|
1071
|
+
let reason: string;
|
|
1072
|
+
|
|
1073
|
+
if (refusal) {
|
|
1074
|
+
// With a problem, only the group was read: name the group alone.
|
|
1075
|
+
reason = `docker ${
|
|
1076
|
+
resolved.problem ? resolved.path : resolved.written
|
|
1077
|
+
} is never allowed for ${profile.resourceDescription}: it ${refusal}`;
|
|
1078
|
+
} else if (resolved.problem) {
|
|
1079
|
+
reason = resolved.problem;
|
|
1080
|
+
} else {
|
|
1081
|
+
const lowered: string = resolved.written.toLowerCase();
|
|
1082
|
+
const hint: string =
|
|
1083
|
+
lowered !== resolved.written &&
|
|
1084
|
+
(profile.commands.has(lowered) ||
|
|
1085
|
+
profile.commands.has(resolved.path.toLowerCase()))
|
|
1086
|
+
? " (docker commands are lowercase)"
|
|
1087
|
+
: "";
|
|
1088
|
+
|
|
1089
|
+
reason = `docker ${resolved.written} is not a docker command OneUptime AI may run${hint}`;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
return deny(`${reason}. ${profile.allowedSummary}`, "");
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
const command: string = `docker ${resolved.written}`;
|
|
1096
|
+
const parsed: DockerParsedArgs = parseDockerFlags({
|
|
1097
|
+
words: resolved.rest,
|
|
1098
|
+
flags: spec.flags,
|
|
1099
|
+
command,
|
|
1100
|
+
interspersed: spec.interspersed !== false,
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
if (parsed.problem) {
|
|
1104
|
+
return deny(`${command}: ${parsed.problem}`, spec.verb);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1107
|
+
const judgement: DockerJudgement = spec.judge(parsed, command);
|
|
1108
|
+
|
|
1109
|
+
const isWrite: boolean =
|
|
1110
|
+
judgement.tier === ResourceCommandTier.SafeWrite ||
|
|
1111
|
+
judgement.tier === ResourceCommandTier.RiskyWrite;
|
|
1112
|
+
|
|
1113
|
+
// Denied, and anything that is not a tier at all, never runs.
|
|
1114
|
+
if (!isWrite && judgement.tier !== ResourceCommandTier.Read) {
|
|
1115
|
+
return deny(`${command}: ${judgement.reason}`, spec.verb);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
const result: ResourceCommandPolicyResult = {
|
|
1119
|
+
tier: judgement.tier,
|
|
1120
|
+
reason: judgement.reason,
|
|
1121
|
+
program: "docker",
|
|
1122
|
+
args: words.slice(1),
|
|
1123
|
+
verb: spec.verb,
|
|
1124
|
+
displayCommand: renderResourceDisplayCommand(words),
|
|
1125
|
+
targets: isWrite ? uniqueDockerTargets(judgement.targets || []) : [],
|
|
1126
|
+
};
|
|
1127
|
+
|
|
1128
|
+
if (isWrite && judgement.requiresHuman === true) {
|
|
1129
|
+
result.requiresHuman = true;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
return result;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
// A total wrapper: a bug in a judge is a Denied, never an exception.
|
|
1136
|
+
export function evaluateDockerArgvSafely(
|
|
1137
|
+
profile: DockerProfile,
|
|
1138
|
+
argv: unknown,
|
|
1139
|
+
): ResourceCommandPolicyResult {
|
|
1140
|
+
try {
|
|
1141
|
+
return evaluateDockerArgv(profile, argv);
|
|
1142
|
+
} catch {
|
|
1143
|
+
const words: Array<string> = Array.isArray(argv)
|
|
1144
|
+
? argv.filter((word: unknown): word is string => {
|
|
1145
|
+
return typeof word === "string";
|
|
1146
|
+
})
|
|
1147
|
+
: [];
|
|
1148
|
+
|
|
1149
|
+
return deniedResult(
|
|
1150
|
+
words,
|
|
1151
|
+
`the ${profile.name} command policy could not evaluate this command`,
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
// ---- The engine's read commands (both profiles) -----------------------------
|
|
1157
|
+
|
|
1158
|
+
const FILTER_FLAG: DockerFlagSpec = {
|
|
1159
|
+
name: "filter",
|
|
1160
|
+
shorthand: "f",
|
|
1161
|
+
kind: DockerFlagKind.Value,
|
|
1162
|
+
repeatable: true,
|
|
1163
|
+
};
|
|
1164
|
+
|
|
1165
|
+
const FORMAT_FLAG: DockerFlagSpec = {
|
|
1166
|
+
name: "format",
|
|
1167
|
+
kind: DockerFlagKind.Value,
|
|
1168
|
+
};
|
|
1169
|
+
|
|
1170
|
+
// inspect, info and version spell --format with -f.
|
|
1171
|
+
const FORMAT_FLAG_WITH_SHORTHAND: DockerFlagSpec = {
|
|
1172
|
+
name: "format",
|
|
1173
|
+
shorthand: "f",
|
|
1174
|
+
kind: DockerFlagKind.Value,
|
|
1175
|
+
};
|
|
1176
|
+
|
|
1177
|
+
const QUIET_FLAG: DockerFlagSpec = {
|
|
1178
|
+
name: "quiet",
|
|
1179
|
+
shorthand: "q",
|
|
1180
|
+
kind: DockerFlagKind.Bool,
|
|
1181
|
+
};
|
|
1182
|
+
|
|
1183
|
+
const NO_TRUNC_FLAG: DockerFlagSpec = {
|
|
1184
|
+
name: "no-trunc",
|
|
1185
|
+
kind: DockerFlagKind.Bool,
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
export const DOCKER_FILTER_FLAG: DockerFlagSpec = FILTER_FLAG;
|
|
1189
|
+
export const DOCKER_FORMAT_FLAG: DockerFlagSpec = FORMAT_FLAG;
|
|
1190
|
+
export const DOCKER_FORMAT_FLAG_WITH_SHORTHAND: DockerFlagSpec =
|
|
1191
|
+
FORMAT_FLAG_WITH_SHORTHAND;
|
|
1192
|
+
export const DOCKER_QUIET_FLAG: DockerFlagSpec = QUIET_FLAG;
|
|
1193
|
+
export const DOCKER_NO_TRUNC_FLAG: DockerFlagSpec = NO_TRUNC_FLAG;
|
|
1194
|
+
|
|
1195
|
+
export const DOCKER_FOLLOW_REFUSAL: string =
|
|
1196
|
+
"is never allowed: it streams the log until the command is killed. Read a bounded slice with --tail N (N up to 2000) or --since 30m instead";
|
|
1197
|
+
|
|
1198
|
+
// The most log lines one command may ask for.
|
|
1199
|
+
export const DOCKER_MAX_LOG_TAIL_LINES: number = 2000;
|
|
1200
|
+
|
|
1201
|
+
/*
|
|
1202
|
+
* How far back --since alone (no --tail) may reach, in hours. Without
|
|
1203
|
+
* --tail, --since is the only bound on what a logs command streams: an old
|
|
1204
|
+
* --since (2001-01-01, 100000h) reads the whole log history, which the
|
|
1205
|
+
* daemon and the CLI keep producing until the command ends or is killed.
|
|
1206
|
+
*/
|
|
1207
|
+
export const DOCKER_MAX_LOG_SINCE_HOURS: number = 24;
|
|
1208
|
+
|
|
1209
|
+
// The flags `docker logs` and `docker service logs` share.
|
|
1210
|
+
export const DOCKER_LOG_FLAGS: ReadonlyArray<DockerFlagSpec> = [
|
|
1211
|
+
{ name: "details", kind: DockerFlagKind.Bool },
|
|
1212
|
+
{
|
|
1213
|
+
name: "follow",
|
|
1214
|
+
shorthand: "f",
|
|
1215
|
+
kind: DockerFlagKind.Bool,
|
|
1216
|
+
refusal: DOCKER_FOLLOW_REFUSAL,
|
|
1217
|
+
},
|
|
1218
|
+
{ name: "since", kind: DockerFlagKind.Value },
|
|
1219
|
+
{ name: "tail", shorthand: "n", kind: DockerFlagKind.Value },
|
|
1220
|
+
{ name: "timestamps", shorthand: "t", kind: DockerFlagKind.Bool },
|
|
1221
|
+
];
|
|
1222
|
+
|
|
1223
|
+
/*
|
|
1224
|
+
* Why a logs command does not read a bounded slice, or null when it does:
|
|
1225
|
+
* --tail N with N up to DOCKER_MAX_LOG_TAIL_LINES, or — without --tail — a
|
|
1226
|
+
* relative --since of at most DOCKER_MAX_LOG_SINCE_HOURS (an absolute time
|
|
1227
|
+
* can lie any distance back, so it needs --tail too); --until (for docker
|
|
1228
|
+
* logs) a time too. Relative, so the verdict is the same whenever the
|
|
1229
|
+
* command is checked (at enqueue, and again on the agent).
|
|
1230
|
+
*/
|
|
1231
|
+
export function findUnboundedLogProblem(
|
|
1232
|
+
parsed: DockerParsedArgs,
|
|
1233
|
+
command: string,
|
|
1234
|
+
): string | null {
|
|
1235
|
+
const tail: string | undefined = dockerFlagValue(parsed, "tail");
|
|
1236
|
+
const since: string | undefined = dockerFlagValue(parsed, "since");
|
|
1237
|
+
const until: string | undefined = dockerFlagValue(parsed, "until");
|
|
1238
|
+
|
|
1239
|
+
if (
|
|
1240
|
+
tail !== undefined &&
|
|
1241
|
+
parseDockerCount(tail, DOCKER_MAX_LOG_TAIL_LINES) === null
|
|
1242
|
+
) {
|
|
1243
|
+
return `--tail takes a number of lines from 0 to ${DOCKER_MAX_LOG_TAIL_LINES}, not "${tail}"`;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
if (since !== undefined && !isDockerTimeValue(since)) {
|
|
1247
|
+
return `--since takes a duration (30m, 2h), an RFC 3339 time or a Unix timestamp, not "${since}"`;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
if (until !== undefined && !isDockerTimeValue(until)) {
|
|
1251
|
+
return `--until takes a duration (5m), an RFC 3339 time or a Unix timestamp, not "${until}"`;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
if (tail === undefined && since === undefined) {
|
|
1255
|
+
return `${command} needs --tail N (N up to ${DOCKER_MAX_LOG_TAIL_LINES}) or --since (e.g. --since 30m), so it reads a bounded slice of the log`;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
if (tail === undefined && since !== undefined) {
|
|
1259
|
+
const sinceSeconds: number | null = parseDockerRelativeTimeSeconds(since);
|
|
1260
|
+
|
|
1261
|
+
if (sinceSeconds === null) {
|
|
1262
|
+
return `--since ${since} is an absolute time, which alone does not bound how much of the log ${command} reads: add --tail N (N up to ${DOCKER_MAX_LOG_TAIL_LINES}), or write --since as a duration of at most ${DOCKER_MAX_LOG_SINCE_HOURS}h (e.g. --since 30m)`;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
if (sinceSeconds > DOCKER_MAX_LOG_SINCE_HOURS * 3600) {
|
|
1266
|
+
return `--since ${since} reaches further back than ${DOCKER_MAX_LOG_SINCE_HOURS}h, which alone does not bound how much of the log ${command} reads: add --tail N (N up to ${DOCKER_MAX_LOG_TAIL_LINES}), or use a shorter --since`;
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
return null;
|
|
1271
|
+
}
|
|
1272
|
+
|
|
1273
|
+
function judgeContainerList(parsed: DockerParsedArgs): DockerJudgement {
|
|
1274
|
+
if (parsed.positionals.length > 0) {
|
|
1275
|
+
return deniedJudgement(
|
|
1276
|
+
`it takes no container names (got "${parsed.positionals[0]}"); narrow it with --filter name=NAME instead`,
|
|
1277
|
+
);
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
const last: string | undefined = dockerFlagValue(parsed, "last");
|
|
1281
|
+
|
|
1282
|
+
if (last !== undefined && parseDockerCount(last, 100000) === null) {
|
|
1283
|
+
return deniedJudgement(`-n/--last takes a number, not "${last}"`);
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
const problem: string | null =
|
|
1287
|
+
findBadDockerFilter(parsed) ||
|
|
1288
|
+
findBadDockerFormat(parsed, ["json", "table"]);
|
|
1289
|
+
|
|
1290
|
+
return problem
|
|
1291
|
+
? deniedJudgement(problem)
|
|
1292
|
+
: readJudgement("lists containers; it changes nothing");
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
const CONTAINER_LIST_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1296
|
+
verb: string,
|
|
1297
|
+
): DockerCommandSpec => {
|
|
1298
|
+
return {
|
|
1299
|
+
verb,
|
|
1300
|
+
flags: [
|
|
1301
|
+
{ name: "all", shorthand: "a", kind: DockerFlagKind.Bool },
|
|
1302
|
+
FILTER_FLAG,
|
|
1303
|
+
FORMAT_FLAG,
|
|
1304
|
+
{ name: "last", shorthand: "n", kind: DockerFlagKind.Value },
|
|
1305
|
+
{ name: "latest", shorthand: "l", kind: DockerFlagKind.Bool },
|
|
1306
|
+
NO_TRUNC_FLAG,
|
|
1307
|
+
QUIET_FLAG,
|
|
1308
|
+
{ name: "size", shorthand: "s", kind: DockerFlagKind.Bool },
|
|
1309
|
+
],
|
|
1310
|
+
judge: judgeContainerList,
|
|
1311
|
+
};
|
|
1312
|
+
};
|
|
1313
|
+
|
|
1314
|
+
// The object kinds `docker inspect --type` may name.
|
|
1315
|
+
export const DOCKER_INSPECT_TYPES: ReadonlyArray<string> = [
|
|
1316
|
+
"container",
|
|
1317
|
+
"image",
|
|
1318
|
+
"network",
|
|
1319
|
+
"volume",
|
|
1320
|
+
];
|
|
1321
|
+
|
|
1322
|
+
function judgeInspectOf(
|
|
1323
|
+
kind: string,
|
|
1324
|
+
parsed: DockerParsedArgs,
|
|
1325
|
+
): DockerJudgement {
|
|
1326
|
+
if (parsed.positionals.length === 0) {
|
|
1327
|
+
return deniedJudgement(`it needs at least one ${kind} name or id`);
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
const problem: string | null =
|
|
1331
|
+
findBadDockerName(
|
|
1332
|
+
parsed.positionals,
|
|
1333
|
+
kind,
|
|
1334
|
+
kind === "image" ? isDockerImageReference : isDockerObjectName,
|
|
1335
|
+
) || findBadDockerFormat(parsed, ["json"]);
|
|
1336
|
+
|
|
1337
|
+
return problem
|
|
1338
|
+
? deniedJudgement(problem)
|
|
1339
|
+
: readJudgement(
|
|
1340
|
+
`shows each ${kind}'s configuration and state (environment values are redacted); it changes nothing`,
|
|
1341
|
+
);
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
const INSPECT_SPEC: DockerCommandSpec = {
|
|
1345
|
+
verb: "inspect",
|
|
1346
|
+
flags: [
|
|
1347
|
+
FORMAT_FLAG_WITH_SHORTHAND,
|
|
1348
|
+
{ name: "size", shorthand: "s", kind: DockerFlagKind.Bool },
|
|
1349
|
+
{ name: "type", kind: DockerFlagKind.Value },
|
|
1350
|
+
],
|
|
1351
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1352
|
+
const type: string | undefined = dockerFlagValue(parsed, "type");
|
|
1353
|
+
|
|
1354
|
+
if (type === undefined || !DOCKER_INSPECT_TYPES.includes(type)) {
|
|
1355
|
+
return deniedJudgement(
|
|
1356
|
+
`it needs --type ${DOCKER_INSPECT_TYPES.join("|")}${
|
|
1357
|
+
type === undefined ? "" : ` (not "${type}")`
|
|
1358
|
+
}: without it docker also matches swarm configs and secrets by name, and prints a config's contents. Or use docker container inspect NAME`,
|
|
1359
|
+
);
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
return judgeInspectOf(type, parsed);
|
|
1363
|
+
},
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
const inspectSpecFor: (
|
|
1367
|
+
kind: string,
|
|
1368
|
+
extraFlags: ReadonlyArray<DockerFlagSpec>,
|
|
1369
|
+
) => DockerCommandSpec = (
|
|
1370
|
+
kind: string,
|
|
1371
|
+
extraFlags: ReadonlyArray<DockerFlagSpec>,
|
|
1372
|
+
): DockerCommandSpec => {
|
|
1373
|
+
return {
|
|
1374
|
+
verb: `${kind} inspect`,
|
|
1375
|
+
flags: [FORMAT_FLAG_WITH_SHORTHAND, ...extraFlags],
|
|
1376
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1377
|
+
return judgeInspectOf(kind, parsed);
|
|
1378
|
+
},
|
|
1379
|
+
};
|
|
1380
|
+
};
|
|
1381
|
+
|
|
1382
|
+
const LOGS_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1383
|
+
verb: string,
|
|
1384
|
+
): DockerCommandSpec => {
|
|
1385
|
+
return {
|
|
1386
|
+
verb,
|
|
1387
|
+
flags: [...DOCKER_LOG_FLAGS, { name: "until", kind: DockerFlagKind.Value }],
|
|
1388
|
+
judge(parsed: DockerParsedArgs, command: string): DockerJudgement {
|
|
1389
|
+
if (parsed.positionals.length !== 1) {
|
|
1390
|
+
return deniedJudgement(
|
|
1391
|
+
`it reads exactly one container's log (got ${parsed.positionals.length} names)`,
|
|
1392
|
+
);
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
const problem: string | null =
|
|
1396
|
+
findBadDockerName(parsed.positionals, "container") ||
|
|
1397
|
+
findUnboundedLogProblem(parsed, command);
|
|
1398
|
+
|
|
1399
|
+
return problem
|
|
1400
|
+
? deniedJudgement(problem)
|
|
1401
|
+
: readJudgement(
|
|
1402
|
+
"reads a bounded slice of one container's log; it changes nothing",
|
|
1403
|
+
);
|
|
1404
|
+
},
|
|
1405
|
+
};
|
|
1406
|
+
};
|
|
1407
|
+
|
|
1408
|
+
const STATS_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1409
|
+
verb: string,
|
|
1410
|
+
): DockerCommandSpec => {
|
|
1411
|
+
return {
|
|
1412
|
+
verb,
|
|
1413
|
+
flags: [
|
|
1414
|
+
{ name: "all", shorthand: "a", kind: DockerFlagKind.Bool },
|
|
1415
|
+
FORMAT_FLAG,
|
|
1416
|
+
{ name: "no-stream", kind: DockerFlagKind.Bool },
|
|
1417
|
+
NO_TRUNC_FLAG,
|
|
1418
|
+
],
|
|
1419
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1420
|
+
if (!isDockerSwitchOn(parsed, "no-stream")) {
|
|
1421
|
+
return deniedJudgement(
|
|
1422
|
+
"it needs --no-stream: without it docker stats streams until the command is killed",
|
|
1423
|
+
);
|
|
1424
|
+
}
|
|
1425
|
+
|
|
1426
|
+
const problem: string | null =
|
|
1427
|
+
findBadDockerName(parsed.positionals, "container") ||
|
|
1428
|
+
findBadDockerFormat(parsed, ["json", "table"]);
|
|
1429
|
+
|
|
1430
|
+
return problem
|
|
1431
|
+
? deniedJudgement(problem)
|
|
1432
|
+
: readJudgement(
|
|
1433
|
+
"takes one snapshot of container resource usage; it changes nothing",
|
|
1434
|
+
);
|
|
1435
|
+
},
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
|
|
1439
|
+
const TOP_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1440
|
+
verb: string,
|
|
1441
|
+
): DockerCommandSpec => {
|
|
1442
|
+
return {
|
|
1443
|
+
verb,
|
|
1444
|
+
flags: [],
|
|
1445
|
+
// docker top CONTAINER [ps OPTIONS]: every word after the container goes to ps.
|
|
1446
|
+
interspersed: false,
|
|
1447
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1448
|
+
if (parsed.positionals.length !== 1) {
|
|
1449
|
+
return deniedJudgement(
|
|
1450
|
+
"it takes exactly one container and no ps options (write docker top NAME)",
|
|
1451
|
+
);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
const problem: string | null = findBadDockerName(
|
|
1455
|
+
parsed.positionals,
|
|
1456
|
+
"container",
|
|
1457
|
+
);
|
|
1458
|
+
|
|
1459
|
+
return problem
|
|
1460
|
+
? deniedJudgement(problem)
|
|
1461
|
+
: readJudgement(
|
|
1462
|
+
"lists the processes running in one container; it changes nothing",
|
|
1463
|
+
);
|
|
1464
|
+
},
|
|
1465
|
+
};
|
|
1466
|
+
};
|
|
1467
|
+
|
|
1468
|
+
const EVENTS_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1469
|
+
verb: string,
|
|
1470
|
+
): DockerCommandSpec => {
|
|
1471
|
+
return {
|
|
1472
|
+
verb,
|
|
1473
|
+
flags: [
|
|
1474
|
+
FILTER_FLAG,
|
|
1475
|
+
FORMAT_FLAG,
|
|
1476
|
+
{ name: "since", kind: DockerFlagKind.Value },
|
|
1477
|
+
{ name: "until", kind: DockerFlagKind.Value },
|
|
1478
|
+
],
|
|
1479
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1480
|
+
if (parsed.positionals.length > 0) {
|
|
1481
|
+
return deniedJudgement(
|
|
1482
|
+
`it takes no names (got "${parsed.positionals[0]}"); narrow it with --filter KEY=VALUE`,
|
|
1483
|
+
);
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
const since: string | undefined = dockerFlagValue(parsed, "since");
|
|
1487
|
+
const until: string | undefined = dockerFlagValue(parsed, "until");
|
|
1488
|
+
|
|
1489
|
+
if (since === undefined || until === undefined) {
|
|
1490
|
+
return deniedJudgement(
|
|
1491
|
+
"it needs both --since and --until (e.g. --since 30m --until 0s): without --until docker events streams until the command is killed",
|
|
1492
|
+
);
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
if (!isDockerTimeValue(since) || !isDockerTimeValue(until)) {
|
|
1496
|
+
return deniedJudgement(
|
|
1497
|
+
`--since and --until take a duration (30m, 0s), an RFC 3339 time or a Unix timestamp, not "${
|
|
1498
|
+
isDockerTimeValue(since) ? until : since
|
|
1499
|
+
}"`,
|
|
1500
|
+
);
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
/*
|
|
1504
|
+
* docker reads a duration as that long before now, so a relative
|
|
1505
|
+
* --until always closes the window in the past; an absolute one can
|
|
1506
|
+
* lie in the future (2099-12-31, 9999999999), and docker events then
|
|
1507
|
+
* streams until the command is killed.
|
|
1508
|
+
*/
|
|
1509
|
+
if (parseDockerRelativeTimeSeconds(until) === null) {
|
|
1510
|
+
return deniedJudgement(
|
|
1511
|
+
`--until must be a duration (e.g. --until 0s, or --until 30m for a window that closed 30 minutes ago), not the absolute time "${until}": an absolute --until can lie in the future, and docker events then streams until the command is killed`,
|
|
1512
|
+
);
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
const problem: string | null =
|
|
1516
|
+
findBadDockerFilter(parsed) || findBadDockerFormat(parsed, ["json"]);
|
|
1517
|
+
|
|
1518
|
+
return problem
|
|
1519
|
+
? deniedJudgement(problem)
|
|
1520
|
+
: readJudgement(
|
|
1521
|
+
"lists the engine's events in a closed time window; it changes nothing",
|
|
1522
|
+
);
|
|
1523
|
+
},
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
/*
|
|
1528
|
+
* A read command that takes no positionals: its flags, and the --format
|
|
1529
|
+
* values it accepts (--filter values are checked when it has --filter).
|
|
1530
|
+
*/
|
|
1531
|
+
export const dockerNoArgumentReadSpec: (
|
|
1532
|
+
verb: string,
|
|
1533
|
+
reason: string,
|
|
1534
|
+
flags: ReadonlyArray<DockerFlagSpec>,
|
|
1535
|
+
formats: ReadonlyArray<string>,
|
|
1536
|
+
) => DockerCommandSpec = (
|
|
1537
|
+
verb: string,
|
|
1538
|
+
reason: string,
|
|
1539
|
+
flags: ReadonlyArray<DockerFlagSpec>,
|
|
1540
|
+
formats: ReadonlyArray<string>,
|
|
1541
|
+
): DockerCommandSpec => {
|
|
1542
|
+
return {
|
|
1543
|
+
verb,
|
|
1544
|
+
flags,
|
|
1545
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1546
|
+
if (parsed.positionals.length > 0) {
|
|
1547
|
+
return deniedJudgement(
|
|
1548
|
+
`it takes no arguments (got "${parsed.positionals[0]}")`,
|
|
1549
|
+
);
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
const problem: string | null =
|
|
1553
|
+
findBadDockerFilter(parsed) || findBadDockerFormat(parsed, formats);
|
|
1554
|
+
|
|
1555
|
+
return problem ? deniedJudgement(problem) : readJudgement(reason);
|
|
1556
|
+
},
|
|
1557
|
+
};
|
|
1558
|
+
};
|
|
1559
|
+
|
|
1560
|
+
const INFO_REASON: string =
|
|
1561
|
+
"shows the engine's configuration and health; it changes nothing";
|
|
1562
|
+
|
|
1563
|
+
/*
|
|
1564
|
+
* docker system df [-v] [--format json|table]. -v with --format json is
|
|
1565
|
+
* refused: it prints every build-cache record's full Description — the
|
|
1566
|
+
* command line of each RUN step (`mount / from exec /bin/sh -c ...`), the
|
|
1567
|
+
* very build steps `docker history` is refused for. The verbose table
|
|
1568
|
+
* leaves Description out.
|
|
1569
|
+
*/
|
|
1570
|
+
const SYSTEM_DF_SPEC: DockerCommandSpec = {
|
|
1571
|
+
verb: "system df",
|
|
1572
|
+
flags: [
|
|
1573
|
+
FORMAT_FLAG,
|
|
1574
|
+
{ name: "verbose", shorthand: "v", kind: DockerFlagKind.Bool },
|
|
1575
|
+
],
|
|
1576
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1577
|
+
if (parsed.positionals.length > 0) {
|
|
1578
|
+
return deniedJudgement(
|
|
1579
|
+
`it takes no arguments (got "${parsed.positionals[0]}")`,
|
|
1580
|
+
);
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
const problem: string | null = findBadDockerFormat(parsed, [
|
|
1584
|
+
"json",
|
|
1585
|
+
"table",
|
|
1586
|
+
]);
|
|
1587
|
+
|
|
1588
|
+
if (problem) {
|
|
1589
|
+
return deniedJudgement(problem);
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
if (
|
|
1593
|
+
isDockerSwitchOn(parsed, "verbose") &&
|
|
1594
|
+
dockerFlagValue(parsed, "format") === "json"
|
|
1595
|
+
) {
|
|
1596
|
+
return deniedJudgement(
|
|
1597
|
+
"-v/--verbose with --format json is not allowed: it prints each build-cache record's Description, the command line of every RUN build step, which can carry secrets (the reason docker history is refused). Use docker system df -v (its table leaves Description out) or docker system df --format json",
|
|
1598
|
+
);
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
return readJudgement("shows the engine's disk usage; it changes nothing");
|
|
1602
|
+
},
|
|
1603
|
+
};
|
|
1604
|
+
|
|
1605
|
+
const IMAGES_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1606
|
+
verb: string,
|
|
1607
|
+
): DockerCommandSpec => {
|
|
1608
|
+
return {
|
|
1609
|
+
verb,
|
|
1610
|
+
flags: [
|
|
1611
|
+
{ name: "all", shorthand: "a", kind: DockerFlagKind.Bool },
|
|
1612
|
+
{ name: "digests", kind: DockerFlagKind.Bool },
|
|
1613
|
+
FILTER_FLAG,
|
|
1614
|
+
FORMAT_FLAG,
|
|
1615
|
+
NO_TRUNC_FLAG,
|
|
1616
|
+
QUIET_FLAG,
|
|
1617
|
+
],
|
|
1618
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1619
|
+
if (parsed.positionals.length > 1) {
|
|
1620
|
+
return deniedJudgement("it takes at most one REPOSITORY[:TAG] to list");
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
const problem: string | null =
|
|
1624
|
+
findBadDockerName(
|
|
1625
|
+
parsed.positionals,
|
|
1626
|
+
"image",
|
|
1627
|
+
isDockerImageReference,
|
|
1628
|
+
) ||
|
|
1629
|
+
findBadDockerFilter(parsed) ||
|
|
1630
|
+
findBadDockerFormat(parsed, ["json", "table"]);
|
|
1631
|
+
|
|
1632
|
+
return problem
|
|
1633
|
+
? deniedJudgement(problem)
|
|
1634
|
+
: readJudgement("lists images; it changes nothing");
|
|
1635
|
+
},
|
|
1636
|
+
};
|
|
1637
|
+
};
|
|
1638
|
+
|
|
1639
|
+
// PORT[/PROTOCOL], as `docker port` reads it: 80, 80/tcp, 53/udp, 9/sctp.
|
|
1640
|
+
const DOCKER_PORT_ARGUMENT_REGEX: RegExp =
|
|
1641
|
+
/^[0-9]{1,5}(?:\/(?:tcp|udp|sctp))?$/;
|
|
1642
|
+
|
|
1643
|
+
const PORT_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1644
|
+
verb: string,
|
|
1645
|
+
): DockerCommandSpec => {
|
|
1646
|
+
return {
|
|
1647
|
+
verb,
|
|
1648
|
+
flags: [],
|
|
1649
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1650
|
+
const container: string | undefined = parsed.positionals[0];
|
|
1651
|
+
const port: string | undefined = parsed.positionals[1];
|
|
1652
|
+
|
|
1653
|
+
if (container === undefined || parsed.positionals.length > 2) {
|
|
1654
|
+
return deniedJudgement(
|
|
1655
|
+
"it takes one container and, optionally, one PORT[/PROTOCOL] (write docker port NAME 80/tcp)",
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
if (port !== undefined && !DOCKER_PORT_ARGUMENT_REGEX.test(port)) {
|
|
1660
|
+
return deniedJudgement(
|
|
1661
|
+
`"${port}" is not a PORT[/PROTOCOL] (e.g. 80 or 53/udp)`,
|
|
1662
|
+
);
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
const problem: string | null = findBadDockerName(
|
|
1666
|
+
[container],
|
|
1667
|
+
"container",
|
|
1668
|
+
);
|
|
1669
|
+
|
|
1670
|
+
return problem
|
|
1671
|
+
? deniedJudgement(problem)
|
|
1672
|
+
: readJudgement(
|
|
1673
|
+
"lists one container's published ports; it changes nothing",
|
|
1674
|
+
);
|
|
1675
|
+
},
|
|
1676
|
+
};
|
|
1677
|
+
};
|
|
1678
|
+
|
|
1679
|
+
const DIFF_SPEC: (verb: string) => DockerCommandSpec = (
|
|
1680
|
+
verb: string,
|
|
1681
|
+
): DockerCommandSpec => {
|
|
1682
|
+
return {
|
|
1683
|
+
verb,
|
|
1684
|
+
flags: [],
|
|
1685
|
+
judge(parsed: DockerParsedArgs): DockerJudgement {
|
|
1686
|
+
if (parsed.positionals.length !== 1) {
|
|
1687
|
+
return deniedJudgement("it takes exactly one container");
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
const problem: string | null = findBadDockerName(
|
|
1691
|
+
parsed.positionals,
|
|
1692
|
+
"container",
|
|
1693
|
+
);
|
|
1694
|
+
|
|
1695
|
+
return problem
|
|
1696
|
+
? deniedJudgement(problem)
|
|
1697
|
+
: readJudgement(
|
|
1698
|
+
"lists the files changed in one container's filesystem; it changes nothing",
|
|
1699
|
+
);
|
|
1700
|
+
},
|
|
1701
|
+
};
|
|
1702
|
+
};
|
|
1703
|
+
|
|
1704
|
+
/*
|
|
1705
|
+
* The engine's read commands, by canonical path. Both profiles allow all of
|
|
1706
|
+
* them (the swarm agent runs on a manager node, whose engine is a Docker
|
|
1707
|
+
* engine like any other).
|
|
1708
|
+
*/
|
|
1709
|
+
export const DOCKER_ENGINE_READ_COMMANDS: ReadonlyMap<
|
|
1710
|
+
string,
|
|
1711
|
+
DockerCommandSpec
|
|
1712
|
+
> = new Map<string, DockerCommandSpec>([
|
|
1713
|
+
["ps", CONTAINER_LIST_SPEC("ps")],
|
|
1714
|
+
["container ls", CONTAINER_LIST_SPEC("container ls")],
|
|
1715
|
+
["inspect", INSPECT_SPEC],
|
|
1716
|
+
[
|
|
1717
|
+
"container inspect",
|
|
1718
|
+
inspectSpecFor("container", [
|
|
1719
|
+
{ name: "size", shorthand: "s", kind: DockerFlagKind.Bool },
|
|
1720
|
+
]),
|
|
1721
|
+
],
|
|
1722
|
+
["image inspect", inspectSpecFor("image", [])],
|
|
1723
|
+
[
|
|
1724
|
+
"network inspect",
|
|
1725
|
+
inspectSpecFor("network", [
|
|
1726
|
+
{ name: "verbose", shorthand: "v", kind: DockerFlagKind.Bool },
|
|
1727
|
+
]),
|
|
1728
|
+
],
|
|
1729
|
+
["volume inspect", inspectSpecFor("volume", [])],
|
|
1730
|
+
["logs", LOGS_SPEC("logs")],
|
|
1731
|
+
["container logs", LOGS_SPEC("container logs")],
|
|
1732
|
+
["stats", STATS_SPEC("stats")],
|
|
1733
|
+
["container stats", STATS_SPEC("container stats")],
|
|
1734
|
+
["top", TOP_SPEC("top")],
|
|
1735
|
+
["container top", TOP_SPEC("container top")],
|
|
1736
|
+
["events", EVENTS_SPEC("events")],
|
|
1737
|
+
["system events", EVENTS_SPEC("system events")],
|
|
1738
|
+
[
|
|
1739
|
+
"info",
|
|
1740
|
+
dockerNoArgumentReadSpec(
|
|
1741
|
+
"info",
|
|
1742
|
+
INFO_REASON,
|
|
1743
|
+
[FORMAT_FLAG_WITH_SHORTHAND],
|
|
1744
|
+
["json"],
|
|
1745
|
+
),
|
|
1746
|
+
],
|
|
1747
|
+
[
|
|
1748
|
+
"system info",
|
|
1749
|
+
dockerNoArgumentReadSpec(
|
|
1750
|
+
"system info",
|
|
1751
|
+
INFO_REASON,
|
|
1752
|
+
[FORMAT_FLAG_WITH_SHORTHAND],
|
|
1753
|
+
["json"],
|
|
1754
|
+
),
|
|
1755
|
+
],
|
|
1756
|
+
[
|
|
1757
|
+
"version",
|
|
1758
|
+
dockerNoArgumentReadSpec(
|
|
1759
|
+
"version",
|
|
1760
|
+
"shows the docker client and engine versions; it changes nothing",
|
|
1761
|
+
[FORMAT_FLAG_WITH_SHORTHAND],
|
|
1762
|
+
["json"],
|
|
1763
|
+
),
|
|
1764
|
+
],
|
|
1765
|
+
["system df", SYSTEM_DF_SPEC],
|
|
1766
|
+
["images", IMAGES_SPEC("images")],
|
|
1767
|
+
["image ls", IMAGES_SPEC("image ls")],
|
|
1768
|
+
[
|
|
1769
|
+
"network ls",
|
|
1770
|
+
dockerNoArgumentReadSpec(
|
|
1771
|
+
"network ls",
|
|
1772
|
+
"lists networks; it changes nothing",
|
|
1773
|
+
[FILTER_FLAG, FORMAT_FLAG, NO_TRUNC_FLAG, QUIET_FLAG],
|
|
1774
|
+
["json", "table"],
|
|
1775
|
+
),
|
|
1776
|
+
],
|
|
1777
|
+
[
|
|
1778
|
+
"volume ls",
|
|
1779
|
+
dockerNoArgumentReadSpec(
|
|
1780
|
+
"volume ls",
|
|
1781
|
+
"lists volumes; it changes nothing",
|
|
1782
|
+
[FILTER_FLAG, FORMAT_FLAG, QUIET_FLAG],
|
|
1783
|
+
["json", "table"],
|
|
1784
|
+
),
|
|
1785
|
+
],
|
|
1786
|
+
["port", PORT_SPEC("port")],
|
|
1787
|
+
["container port", PORT_SPEC("container port")],
|
|
1788
|
+
["diff", DIFF_SPEC("diff")],
|
|
1789
|
+
["container diff", DIFF_SPEC("container diff")],
|
|
1790
|
+
]);
|
|
1791
|
+
|
|
1792
|
+
/*
|
|
1793
|
+
* The engine's write commands, by canonical path — the docker-engine
|
|
1794
|
+
* profile allows them; the docker-swarm profile refuses every one (see
|
|
1795
|
+
* DockerSwarmCommandPolicy).
|
|
1796
|
+
*/
|
|
1797
|
+
export const DOCKER_ENGINE_WRITE_PATHS: ReadonlyArray<string> = [
|
|
1798
|
+
"restart",
|
|
1799
|
+
"container restart",
|
|
1800
|
+
"start",
|
|
1801
|
+
"container start",
|
|
1802
|
+
"unpause",
|
|
1803
|
+
"container unpause",
|
|
1804
|
+
"stop",
|
|
1805
|
+
"container stop",
|
|
1806
|
+
"kill",
|
|
1807
|
+
"container kill",
|
|
1808
|
+
"pause",
|
|
1809
|
+
"container pause",
|
|
1810
|
+
"update",
|
|
1811
|
+
"container update",
|
|
1812
|
+
];
|
|
1813
|
+
|
|
1814
|
+
// The command groups only a swarm manager runs.
|
|
1815
|
+
export const DOCKER_SWARM_GROUPS: ReadonlyArray<string> = [
|
|
1816
|
+
"service",
|
|
1817
|
+
"node",
|
|
1818
|
+
"stack",
|
|
1819
|
+
];
|
|
1820
|
+
|
|
1821
|
+
// Merge command tables; a later table never overrides an earlier path.
|
|
1822
|
+
export function mergeDockerCommands(
|
|
1823
|
+
...tables: Array<ReadonlyMap<string, DockerCommandSpec>>
|
|
1824
|
+
): ReadonlyMap<string, DockerCommandSpec> {
|
|
1825
|
+
const merged: Map<string, DockerCommandSpec> = new Map<
|
|
1826
|
+
string,
|
|
1827
|
+
DockerCommandSpec
|
|
1828
|
+
>();
|
|
1829
|
+
|
|
1830
|
+
for (const table of tables) {
|
|
1831
|
+
table.forEach((spec: DockerCommandSpec, path: string): void => {
|
|
1832
|
+
if (!merged.has(path)) {
|
|
1833
|
+
merged.set(path, spec);
|
|
1834
|
+
}
|
|
1835
|
+
});
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
return merged;
|
|
1839
|
+
}
|