@opensoha/contracts 0.1.23 → 0.1.25
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/COMPATIBILITY.md +95 -0
- package/README.md +24 -6
- package/agent/environment/README.md +55 -0
- package/agent/environment/export.go +139 -0
- package/agent/environment/export_test.go +62 -0
- package/agent/environment/preflight.go +62 -0
- package/agent/environment/preflight_test.go +41 -0
- package/agent/environment/protocol.go +221 -0
- package/agent/environment/protocol_test.go +81 -0
- package/agent/environment-lease.schema.json +2 -2
- package/agent/environment-template.schema.json +1 -1
- package/agent/guest/browser_network.go +77 -0
- package/agent/guest/data.go +62 -0
- package/agent/guest/protocol.go +235 -0
- package/agent/guest/protocol_test.go +142 -0
- package/agent/guest/renewal.go +56 -0
- package/agent/guest/renewal_test.go +53 -0
- package/agent/guest/runtime.go +315 -0
- package/agent/guest/runtime_json.go +75 -0
- package/agent/guest/runtime_test.go +110 -0
- package/agent/personal-browser-network-request.schema.json +40 -0
- package/agent/personal-browser-network-response.schema.json +44 -0
- package/agent/personal-environment-export.schema.json +55 -0
- package/agent/personal-environment-preflight-request.schema.json +52 -0
- package/agent/personal-environment-preflight-result.schema.json +69 -0
- package/agent/personal-environment-request.schema.json +137 -0
- package/agent/personal-environment-result.schema.json +101 -0
- package/agent/personal-guest-binding.schema.json +92 -0
- package/agent/personal-guest-data-plan.schema.json +32 -0
- package/agent/personal-guest-enrollment.schema.json +21 -0
- package/agent/personal-guest-heartbeat.schema.json +44 -0
- package/agent/personal-guest-provisioning.schema.json +71 -0
- package/agent/personal-guest-renewal.schema.json +33 -0
- package/agent/personal-guest-runtime-result.schema.json +164 -0
- package/agent/personal-guest-runtime.schema.json +304 -0
- package/agent/personal-guest-tools.schema.json +75 -0
- package/auth/catalog_generated.go +2 -2
- package/auth/gateway_permissions_test.go +48 -0
- package/auth/permission-catalog.json +331 -1
- package/auth/token-claims.schema.json +5 -0
- package/compat/consumer-revisions.json +3 -2
- package/compat/json-schema-ecosystem-0.1.0.json +1 -1
- package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
- package/connectors/connector-action.schema.json +138 -0
- package/fixtures/json-schema/connector-action/invalid/empty-values.json +11 -0
- package/fixtures/json-schema/connector-action/invalid/invalid-expiry.json +16 -0
- package/fixtures/json-schema/connector-action/invalid/lowercase-alias.json +16 -0
- package/fixtures/json-schema/connector-action/invalid/unknown-entry-field.json +17 -0
- package/fixtures/json-schema/connector-action/invalid/unknown-frame-field.json +17 -0
- package/fixtures/json-schema/connector-action/invalid/unknown-version.json +16 -0
- package/fixtures/json-schema/connector-action/invalid/unversioned-reference.json +16 -0
- package/fixtures/json-schema/connector-action/invalid/zero-version.json +16 -0
- package/fixtures/json-schema/connector-action/valid/pinned.json +16 -0
- package/fixtures/json-schema/connector-definition/invalid/credential-userinfo.json +8 -0
- package/fixtures/json-schema/connector-definition/invalid/reference-traversal.json +8 -0
- package/fixtures/json-schema/connector-definition/invalid/zero-version.json +8 -0
- package/fixtures/json-schema/connector-definition/valid/canonical.json +8 -0
- package/fixtures/json-schema/connector-definition/valid/pinned.json +8 -0
- package/fixtures/json-schema/personal-browser-network-request/invalid/bounded.json +4 -0
- package/fixtures/json-schema/personal-browser-network-request/valid/bounded.json +4 -0
- package/fixtures/json-schema/personal-browser-network-response/invalid/bounded.json +5 -0
- package/fixtures/json-schema/personal-browser-network-response/valid/bounded.json +5 -0
- package/fixtures/json-schema/personal-environment-export/invalid/extra.json +11 -0
- package/fixtures/json-schema/personal-environment-export/invalid/ownerId.json +10 -0
- package/fixtures/json-schema/personal-environment-export/invalid/sha256.json +10 -0
- package/fixtures/json-schema/personal-environment-export/invalid/sizeBytes.json +10 -0
- package/fixtures/json-schema/personal-environment-export/valid/complete.json +10 -0
- package/fixtures/json-schema/personal-environment-preflight-request/invalid/disk.json +11 -0
- package/fixtures/json-schema/personal-environment-preflight-request/invalid/network.json +11 -0
- package/fixtures/json-schema/personal-environment-preflight-request/invalid/node.json +12 -0
- package/fixtures/json-schema/personal-environment-preflight-request/invalid/owner.json +12 -0
- package/fixtures/json-schema/personal-environment-preflight-request/valid/bounded.json +11 -0
- package/fixtures/json-schema/personal-environment-preflight-result/invalid/disk.json +15 -0
- package/fixtures/json-schema/personal-environment-preflight-result/invalid/network.json +15 -0
- package/fixtures/json-schema/personal-environment-preflight-result/invalid/no-hard-quota.json +15 -0
- package/fixtures/json-schema/personal-environment-preflight-result/invalid/node.json +16 -0
- package/fixtures/json-schema/personal-environment-preflight-result/invalid/not-ready.json +15 -0
- package/fixtures/json-schema/personal-environment-preflight-result/invalid/owner.json +16 -0
- package/fixtures/json-schema/personal-environment-preflight-result/valid/bounded.json +15 -0
- package/fixtures/json-schema/personal-environment-request/invalid/delete-data-argv.json +24 -0
- package/fixtures/json-schema/personal-environment-request/invalid/delete-data-createData.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/delete-data-taskId.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/export-argv.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/export-createData.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/export-taskId.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/extra-command.json +24 -0
- package/fixtures/json-schema/personal-environment-request/invalid/host-workspace.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/image-injection.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/network-egress.json +21 -0
- package/fixtures/json-schema/personal-environment-request/invalid/no-command.json +21 -0
- package/fixtures/json-schema/personal-environment-request/invalid/recreate-on-release.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/relative-command.json +24 -0
- package/fixtures/json-schema/personal-environment-request/invalid/released-identity.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/task-empty.json +27 -0
- package/fixtures/json-schema/personal-environment-request/invalid/task-host-path.json +27 -0
- package/fixtures/json-schema/personal-environment-request/invalid/task-noncanonical.json +27 -0
- package/fixtures/json-schema/personal-environment-request/invalid/task-null.json +27 -0
- package/fixtures/json-schema/personal-environment-request/invalid/task-on-inspection.json +22 -0
- package/fixtures/json-schema/personal-environment-request/invalid/unbounded-quota.json +21 -0
- package/fixtures/json-schema/personal-environment-request/valid/acquire.json +21 -0
- package/fixtures/json-schema/personal-environment-request/valid/delete-data.json +21 -0
- package/fixtures/json-schema/personal-environment-request/valid/execute.json +26 -0
- package/fixtures/json-schema/personal-environment-request/valid/export-data.json +21 -0
- package/fixtures/json-schema/personal-environment-request/valid/inspect.json +21 -0
- package/fixtures/json-schema/personal-environment-request/valid/provision.json +22 -0
- package/fixtures/json-schema/personal-environment-request/valid/release.json +21 -0
- package/fixtures/json-schema/personal-environment-request/valid/task-workspace.json +27 -0
- package/fixtures/json-schema/personal-environment-result/invalid/active-without-observation.json +7 -0
- package/fixtures/json-schema/personal-environment-result/invalid/deleted-output.json +8 -0
- package/fixtures/json-schema/personal-environment-result/invalid/deleted-snapshot.json +8 -0
- package/fixtures/json-schema/personal-environment-result/invalid/deleted-taskId.json +8 -0
- package/fixtures/json-schema/personal-environment-result/invalid/private-handle.json +8 -0
- package/fixtures/json-schema/personal-environment-result/invalid/stopped-fake-observation.json +20 -0
- package/fixtures/json-schema/personal-environment-result/invalid/task-empty.json +22 -0
- package/fixtures/json-schema/personal-environment-result/invalid/task-host-path.json +22 -0
- package/fixtures/json-schema/personal-environment-result/invalid/task-null.json +22 -0
- package/fixtures/json-schema/personal-environment-result/invalid/task-on-stopped.json +8 -0
- package/fixtures/json-schema/personal-environment-result/invalid/task-without-command-output.json +21 -0
- package/fixtures/json-schema/personal-environment-result/valid/active.json +21 -0
- package/fixtures/json-schema/personal-environment-result/valid/deleted.json +7 -0
- package/fixtures/json-schema/personal-environment-result/valid/expired.json +7 -0
- package/fixtures/json-schema/personal-environment-result/valid/missing.json +7 -0
- package/fixtures/json-schema/personal-environment-result/valid/released.json +7 -0
- package/fixtures/json-schema/personal-environment-result/valid/task-workspace.json +22 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/host-path.json +17 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/invalid-policy.json +17 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/invalid-serial.json +17 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/legacy-version.json +17 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/missing-generation.json +17 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/missing-identity.json +16 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/missing-provider-identity.json +16 -0
- package/fixtures/json-schema/personal-guest-binding/invalid/raw-provider-identity.json +17 -0
- package/fixtures/json-schema/personal-guest-binding/valid/minimal.json +17 -0
- package/fixtures/json-schema/personal-guest-data-plan/invalid/quota.json +1 -0
- package/fixtures/json-schema/personal-guest-data-plan/valid/basic.json +1 -0
- package/fixtures/json-schema/personal-guest-enrollment/invalid/capabilities.json +7 -0
- package/fixtures/json-schema/personal-guest-enrollment/invalid/legacy-version.json +4 -0
- package/fixtures/json-schema/personal-guest-enrollment/invalid/missing-identity.json +3 -0
- package/fixtures/json-schema/personal-guest-enrollment/invalid/ownerId.json +5 -0
- package/fixtures/json-schema/personal-guest-enrollment/invalid/token.json +5 -0
- package/fixtures/json-schema/personal-guest-enrollment/valid/minimal.json +4 -0
- package/fixtures/json-schema/personal-guest-heartbeat/invalid/argv.json +11 -0
- package/fixtures/json-schema/personal-guest-heartbeat/invalid/legacy-version.json +8 -0
- package/fixtures/json-schema/personal-guest-heartbeat/invalid/missing-identity.json +7 -0
- package/fixtures/json-schema/personal-guest-heartbeat/invalid/owner.json +9 -0
- package/fixtures/json-schema/personal-guest-heartbeat/invalid/self-ready.json +9 -0
- package/fixtures/json-schema/personal-guest-heartbeat/invalid/zero-sequence.json +8 -0
- package/fixtures/json-schema/personal-guest-heartbeat/valid/minimal.json +8 -0
- package/fixtures/json-schema/personal-guest-provisioning/invalid/network.json +1 -0
- package/fixtures/json-schema/personal-guest-provisioning/valid/basic.json +1 -0
- package/fixtures/json-schema/personal-guest-renewal/invalid/unknown.json +1 -0
- package/fixtures/json-schema/personal-guest-renewal/valid/basic.json +1 -0
- package/fixtures/json-schema/personal-guest-runtime/invalid/minimal.json +45 -0
- package/fixtures/json-schema/personal-guest-runtime/valid/minimal.json +45 -0
- package/fixtures/json-schema/personal-guest-runtime-result/invalid/minimal.json +28 -0
- package/fixtures/json-schema/personal-guest-runtime-result/valid/minimal.json +27 -0
- package/fixtures/json-schema/personal-guest-tools/invalid/minimal.json +31 -0
- package/fixtures/json-schema/personal-guest-tools/valid/minimal.json +30 -0
- package/fixtures/json-schema/source-import-policy/invalid/case-variant-scope.json +4 -0
- package/fixtures/json-schema/source-import-policy/invalid/case-variant-version.json +4 -0
- package/fixtures/json-schema/source-import-policy/invalid/duplicate-grant.json +4 -0
- package/fixtures/json-schema/source-import-policy/invalid/empty-id.json +4 -0
- package/fixtures/json-schema/source-import-policy/invalid/future-version.json +4 -0
- package/fixtures/json-schema/source-import-policy/invalid/unknown-field.json +4 -0
- package/fixtures/json-schema/source-import-policy/valid/deny-all.json +4 -0
- package/fixtures/json-schema/source-import-policy/valid/shared.json +4 -0
- package/fixtures/json-schema/token-claims/invalid/authz-negative.json +23 -0
- package/fixtures/json-schema/token-claims/invalid/authz-string.json +23 -0
- package/fixtures/json-schema/token-claims/invalid/authz-zero.json +23 -0
- package/fixtures/json-schema/token-claims/valid/versioned-session.json +23 -0
- package/fixtures/openapi/AgentRunEventListEnvelope/invalid/basic.json +8 -0
- package/fixtures/openapi/AgentRunEventListEnvelope/valid/basic.json +8 -0
- package/fixtures/openapi/AgentRunEventListEnvelope/valid/native.json +1 -0
- package/fixtures/openapi/AgentRunResumeRequest/invalid/basic.json +3 -0
- package/fixtures/openapi/AgentRunResumeRequest/valid/basic.json +3 -0
- package/fixtures/openapi/AgentSSHCommandRequest/invalid/task51.json +24 -0
- package/fixtures/openapi/AgentSSHCommandRequest/valid/task51.json +23 -0
- package/fixtures/openapi/AgentSSHCommandResult/invalid/task51.json +8 -0
- package/fixtures/openapi/AgentSSHCommandResult/valid/task51.json +7 -0
- package/fixtures/openapi/AgentSSHSessionRequest/invalid/task51.json +20 -0
- package/fixtures/openapi/AgentSSHSessionRequest/valid/task51.json +19 -0
- package/fixtures/openapi/CapabilityTaskInput/invalid/duplicate-scope.json +36 -0
- package/fixtures/openapi/CapabilityTaskInput/valid/scoped.json +32 -0
- package/fixtures/openapi/DockerQuickCreateHostInput/invalid/guest-access.json +7 -0
- package/fixtures/openapi/DockerQuickCreateHostInput/valid/guest-access.json +9 -0
- package/fixtures/openapi/KnowledgeSourceDocument/invalid/tombstone-with-content.json +1 -0
- package/fixtures/openapi/KnowledgeSourceDocument/valid/tombstone.json +1 -0
- package/fixtures/openapi/KubernetesAgentActionCheck/invalid/unproven-state.json +6 -0
- package/fixtures/openapi/KubernetesAgentActionCheck/valid/configured-denied.json +9 -0
- package/fixtures/openapi/KubernetesAgentActionProfile/invalid/wildcard.json +1 -0
- package/fixtures/openapi/KubernetesAgentActionProfile/valid/workbench.json +1 -0
- package/fixtures/openapi/KubernetesClusterRegistrationRequest/invalid/action-profile.json +3 -0
- package/fixtures/openapi/KubernetesClusterRegistrationRequest/valid/action-profile.json +5 -0
- package/fixtures/openapi/KubernetesNodeListEnvelope/invalid/condition-status-boolean.json +17 -0
- package/fixtures/openapi/KubernetesNodeListEnvelope/invalid/taint-effect-missing.json +16 -0
- package/fixtures/openapi/KubernetesNodeListEnvelope/valid/legacy-fields-absent.json +11 -0
- package/fixtures/openapi/KubernetesNodeListEnvelope/valid/no-taints.json +13 -0
- package/fixtures/openapi/KubernetesNodeListEnvelope/valid/ready-cordoned-tainted.json +28 -0
- package/fixtures/openapi/KubernetesNodeListEnvelope/valid/unknown-fields-null.json +13 -0
- package/fixtures/openapi/KubernetesResourceUpdatePlanRequest/invalid/missing-required.json +1 -0
- package/fixtures/openapi/KubernetesResourceYaml/invalid/missing-required.json +1 -0
- package/fixtures/openapi/KubernetesTopologyCoverage/invalid/empty-as-success.json +5 -0
- package/fixtures/openapi/KubernetesTopologyCoverage/valid/not-installed.json +6 -0
- package/fixtures/openapi/KubernetesTopologyGraphEdge/invalid/negative-weight.json +8 -0
- package/fixtures/openapi/KubernetesTopologyGraphEdge/valid/zero-weight.json +20 -0
- package/fixtures/openapi/KubernetesTopologyGraphNode/invalid/fake-flow-kind.json +42 -0
- package/fixtures/openapi/KubernetesTopologyGraphNode/valid/rule.json +42 -0
- package/fixtures/openapi/KubernetesTopologySnapshot/invalid/raw-source-field.json +33 -0
- package/fixtures/openapi/KubernetesTopologySnapshot/valid/projected-source.json +32 -0
- package/fixtures/openapi/KubernetesTopologySnapshotRequest/invalid/arbitrary-gvr.json +8 -0
- package/fixtures/openapi/KubernetesTopologySnapshotRequest/valid/bounded-sources.json +11 -0
- package/fixtures/openapi/KubernetesTopologySourceQuery/invalid/cluster-namespace.json +4 -0
- package/fixtures/openapi/KubernetesTopologySourceQuery/valid/all-namespaces.json +4 -0
- package/fixtures/openapi/ObservabilityDataSource/invalid/missing-required.json +1 -0
- package/fixtures/openapi/PersonalAgentAccess/invalid/invalid.json +1 -0
- package/fixtures/openapi/PersonalAgentAccess/valid/valid.json +1 -0
- package/fixtures/openapi/PersonalAgentAccessDecision/invalid/invalid.json +1 -0
- package/fixtures/openapi/PersonalAgentAccessDecision/valid/valid.json +1 -0
- package/fixtures/openapi/PersonalAssistantArtifactListEnvelope/invalid/owner.json +8 -0
- package/fixtures/openapi/PersonalAssistantArtifactListEnvelope/valid/side-chat.json +9 -0
- package/fixtures/openapi/PersonalAssistantAvatarRequest/invalid/motion.json +1 -0
- package/fixtures/openapi/PersonalAssistantAvatarRequest/invalid/owner.json +1 -0
- package/fixtures/openapi/PersonalAssistantAvatarRequest/invalid/remote.json +1 -0
- package/fixtures/openapi/PersonalAssistantAvatarRequest/invalid/svg.json +1 -0
- package/fixtures/openapi/PersonalAssistantAvatarRequest/valid/raster.json +1 -0
- package/fixtures/openapi/PersonalAssistantAvatarRequest/valid/reset.json +1 -0
- package/fixtures/openapi/PersonalAssistantUpdateRequest/invalid/empty.json +1 -0
- package/fixtures/openapi/PersonalAssistantUpdateRequest/invalid/owner.json +1 -0
- package/fixtures/openapi/PersonalAssistantUpdateRequest/valid/name.json +1 -0
- package/fixtures/openapi/PersonalDockerEnvironmentPolicy/invalid/host-url.json +12 -0
- package/fixtures/openapi/PersonalDockerEnvironmentPolicy/invalid/lifetime.json +11 -0
- package/fixtures/openapi/PersonalDockerEnvironmentPolicy/invalid/unknown-agent.json +11 -0
- package/fixtures/openapi/PersonalDockerEnvironmentPolicy/valid/basic.json +11 -0
- package/fixtures/openapi/PersonalEnvironment/invalid/invented-state.json +6 -0
- package/fixtures/openapi/PersonalEnvironment/invalid/missing-state.json +5 -0
- package/fixtures/openapi/PersonalEnvironment/invalid/negative-generation.json +7 -0
- package/fixtures/openapi/PersonalEnvironment/invalid/network.json +23 -0
- package/fixtures/openapi/PersonalEnvironment/invalid/private-node.json +24 -0
- package/fixtures/openapi/PersonalEnvironment/invalid/unsupported-backend.json +7 -0
- package/fixtures/openapi/PersonalEnvironment/valid/deleted.json +23 -0
- package/fixtures/openapi/PersonalEnvironment/valid/deleting.json +23 -0
- package/fixtures/openapi/PersonalEnvironment/valid/deletion_unknown.json +23 -0
- package/fixtures/openapi/PersonalEnvironment/valid/frozen-binding.json +13 -0
- package/fixtures/openapi/PersonalEnvironment/valid/ready.json +23 -0
- package/fixtures/openapi/PersonalEnvironment/valid/unknown.json +23 -0
- package/fixtures/openapi/PersonalEnvironment/valid/unprovisioned.json +6 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/invalid/command.json +3 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/invalid/node.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/invalid/owner.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/invalid/quota.json +10 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/valid/reconcile.json +3 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/valid/sleep.json +3 -0
- package/fixtures/openapi/PersonalEnvironmentActionRequest/valid/wake.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentDataDeletionRequest/invalid/empty-name.json +5 -0
- package/fixtures/openapi/PersonalEnvironmentDataDeletionRequest/invalid/long-name.json +5 -0
- package/fixtures/openapi/PersonalEnvironmentDataDeletionRequest/invalid/missing-name.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentDataDeletionRequest/invalid/owner.json +6 -0
- package/fixtures/openapi/PersonalEnvironmentDataDeletionRequest/invalid/stale-version.json +5 -0
- package/fixtures/openapi/PersonalEnvironmentDataDeletionRequest/valid/confirmed.json +5 -0
- package/fixtures/openapi/PersonalEnvironmentDataExportRequest/invalid/assistantId.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentDataExportRequest/invalid/environmentVersion.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentDataExportRequest/invalid/ownerId.json +5 -0
- package/fixtures/openapi/PersonalEnvironmentDataExportRequest/valid/current.json +4 -0
- package/fixtures/openapi/PersonalEnvironmentEnvelope/invalid/missing-data.json +1 -0
- package/fixtures/openapi/PersonalEnvironmentEnvelope/valid/state.json +8 -0
- package/fixtures/openapi/PersonalEnvironmentQuota/invalid/cpu.json +7 -0
- package/fixtures/openapi/PersonalEnvironmentQuota/invalid/disk.json +7 -0
- package/fixtures/openapi/PersonalEnvironmentQuota/invalid/network.json +7 -0
- package/fixtures/openapi/PersonalEnvironmentQuota/invalid/processes.json +7 -0
- package/fixtures/openapi/PersonalEnvironmentQuota/valid/basic.json +7 -0
- package/fixtures/openapi/PersonalEnvironmentTemplate/invalid/mode.json +13 -0
- package/fixtures/openapi/PersonalEnvironmentTemplate/invalid/network.json +13 -0
- package/fixtures/openapi/PersonalEnvironmentTemplate/invalid/node.json +14 -0
- package/fixtures/openapi/PersonalEnvironmentTemplate/valid/template.json +13 -0
- package/fixtures/openapi/PersonalEnvironmentTemplateListEnvelope/invalid/missing.json +1 -0
- package/fixtures/openapi/PersonalEnvironmentTemplateListEnvelope/invalid/unbounded.json +1317 -0
- package/fixtures/openapi/PersonalEnvironmentTemplateListEnvelope/valid/choices.json +17 -0
- package/fixtures/openapi/PersonalEnvironmentTemplateListEnvelope/valid/empty.json +3 -0
- package/fixtures/openapi/PersonalEnvironmentUsage/invalid/negative.json +6 -0
- package/fixtures/openapi/PersonalEnvironmentUsage/valid/usage.json +6 -0
- package/fixtures/openapi/PersonalFeedFeedback/invalid/owner.json +4 -0
- package/fixtures/openapi/PersonalFeedFeedback/valid/liked.json +3 -0
- package/fixtures/openapi/PersonalFeedItem/invalid/no-source.json +9 -0
- package/fixtures/openapi/PersonalFeedItem/valid/post.json +15 -0
- package/fixtures/openapi/PersonalFeedSettings/invalid/owner.json +6 -0
- package/fixtures/openapi/PersonalFeedSettings/valid/default.json +5 -0
- package/fixtures/openapi/PersonalGuestPreparationInput/invalid/foreign-owner.json +5 -0
- package/fixtures/openapi/PersonalGuestPreparationInput/invalid/unsafe-counter.json +4 -0
- package/fixtures/openapi/PersonalGuestPreparationInput/valid/ed25519-csr.json +4 -0
- package/fixtures/openapi/PersonalGuestRuntimeEnvelope/invalid/minimal.json +10 -0
- package/fixtures/openapi/PersonalGuestRuntimeEnvelope/valid/minimal.json +9 -0
- package/fixtures/openapi/PersonalGuestRuntimeInput/invalid/minimal.json +6 -0
- package/fixtures/openapi/PersonalGuestRuntimeInput/valid/minimal.json +8 -0
- package/fixtures/openapi/PersonalGuestToolsInput/invalid/minimal.json +5 -0
- package/fixtures/openapi/PersonalGuestToolsInput/valid/minimal.json +4 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/invalid/device.json +15 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/invalid/fractional-size.json +15 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/invalid/network.json +15 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/invalid/owner.json +15 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/invalid/provider.json +15 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/invalid/unknown.json +16 -0
- package/fixtures/openapi/PersonalVMEnvironmentPolicy/valid/pve.json +15 -0
- package/fixtures/openapi/PersonalWorkspaceRuntime/invalid/shared.json +3 -0
- package/fixtures/openapi/PersonalWorkspaceRuntime/valid/shared.json +4 -0
- package/fixtures/openapi/PersonalWorkspaceRuntimeEnvelope/invalid/shared.json +5 -0
- package/fixtures/openapi/PersonalWorkspaceRuntimeEnvelope/valid/shared.json +6 -0
- package/fixtures/openapi/ResourceMonitoringPanel/invalid/unknown-quality.json +7 -0
- package/fixtures/openapi/ResourceMonitoringPanel/valid/not-collected.json +7 -0
- package/fixtures/openapi/ResourceMonitoringPoint/invalid/string-zero.json +4 -0
- package/fixtures/openapi/ResourceMonitoringPoint/valid/missing.json +4 -0
- package/fixtures/openapi/ResourceMonitoringPoint/valid/zero.json +4 -0
- package/fixtures/openapi/ResourceMonitoringView/invalid/raw-query.json +12 -0
- package/fixtures/openapi/ResourceMonitoringView/valid/unconfigured.json +12 -0
- package/fixtures/openapi/SecretGenerateSSHKeyRequest/invalid/task51.json +6 -0
- package/fixtures/openapi/SecretGenerateSSHKeyRequest/valid/task51.json +12 -0
- package/fixtures/openapi/SecretReferenceUsage/invalid/version.json +6 -0
- package/fixtures/openapi/SecretReferenceUsage/valid/version.json +8 -0
- package/fixtures/openapi/VMSSHCredentialRedemptionInput/invalid/task51.json +7 -0
- package/fixtures/openapi/VMSSHCredentialRedemptionInput/valid/task51.json +6 -0
- package/fixtures/openapi/VirtualMachineAccessBindingInput/invalid/task51.json +10 -0
- package/fixtures/openapi/VirtualMachineAccessBindingInput/valid/task51.json +10 -0
- package/fixtures/openapi/VirtualMachineActionInput/invalid/capacity-not-boolean.json +1 -0
- package/fixtures/openapi/VirtualMachineActionInput/valid/new-data-with-admission.json +1 -0
- package/fixtures/openapi/VirtualMachineCreateInput/valid/cloud-image.json +12 -0
- package/fixtures/openapi/VirtualMachineDiskChange/invalid/serial-config-injection.json +1 -0
- package/fixtures/openapi/VirtualMachineDiskChange/invalid/serial-existing-disk.json +1 -0
- package/fixtures/openapi/VirtualMachineDiskChange/invalid/serial-too-long.json +1 -0
- package/fixtures/openapi/VirtualMachineDiskChange/valid/personal-data.json +1 -0
- package/fixtures/openapi/VirtualMachineGuestAccessInput/invalid/task51.json +4 -0
- package/fixtures/openapi/VirtualMachineGuestAccessInput/valid/task51.json +6 -0
- package/fixtures/openapi/VirtualMachineSSHCommand/invalid/task51.json +9 -0
- package/fixtures/openapi/VirtualMachineSSHCommand/valid/task51.json +8 -0
- package/fixtures/openapi/VirtualMachineSSHCommandInput/invalid/task51.json +5 -0
- package/fixtures/openapi/VirtualMachineSSHCommandInput/valid/task51.json +5 -0
- package/fixtures/openapi/VirtualMachineSSHFrame/invalid/encoding.json +5 -0
- package/fixtures/openapi/VirtualMachineSSHFrame/invalid/task51.json +4 -0
- package/fixtures/openapi/VirtualMachineSSHFrame/valid/binary.json +5 -0
- package/fixtures/openapi/VirtualMachineSSHFrame/valid/task51.json +5 -0
- package/fixtures/openapi/VirtualMachineSSHSessionInput/invalid/task51.json +4 -0
- package/fixtures/openapi/VirtualMachineSSHSessionInput/valid/task51.json +5 -0
- package/fixtures/openapi/VirtualizationCapacityPolicyInput/invalid/task51.json +12 -0
- package/fixtures/openapi/VirtualizationCapacityPolicyInput/valid/task51.json +13 -0
- package/fixtures/openapi/VirtualizationImageInput/invalid/cloud-image-config-type.json +6 -0
- package/fixtures/openapi/VirtualizationImageInput/valid/cloud-image.json +11 -0
- package/fixtures/openapi/WorkbenchAssistantTask/invalid/kind.json +1 -0
- package/fixtures/openapi/WorkbenchAssistantTask/invalid/owner.json +1 -0
- package/fixtures/openapi/WorkbenchAssistantTask/valid/generate.json +1 -0
- package/fixtures/openapi/WorkbenchAssistantTask/valid/undo.json +1 -0
- package/fixtures/openapi/WorkbenchContextSelection/invalid/remote-image.json +1 -0
- package/fixtures/openapi/WorkbenchContextSelection/invalid/too-many-images.json +1 -0
- package/fixtures/openapi/WorkbenchContextSelection/valid/chat-image.json +9 -0
- package/fixtures/openapi/WorkbenchContextUsage/invalid/fractional-capacity.json +1 -0
- package/fixtures/openapi/WorkbenchContextUsage/invalid/negative.json +1 -0
- package/fixtures/openapi/WorkbenchContextUsage/valid/reported.json +1 -0
- package/fixtures/openapi/WorkbenchContextUsage/valid/unknown.json +1 -0
- package/fixtures/openapi/WorkbenchMainSessionRequest/invalid/owner.json +1 -0
- package/fixtures/openapi/WorkbenchMainSessionRequest/invalid/provider.json +1 -0
- package/fixtures/openapi/WorkbenchMainSessionRequest/valid/empty.json +1 -0
- package/fixtures/openapi/WorkbenchMainSessionRequest/valid/provider.json +1 -0
- package/fixtures/openapi/WorkbenchMessageSearchPage/invalid/role.json +12 -0
- package/fixtures/openapi/WorkbenchMessageSearchPage/valid/page.json +12 -0
- package/fixtures/openapi/WorkbenchMessageWindow/invalid/missing.json +1 -0
- package/fixtures/openapi/WorkbenchMessageWindow/valid/empty.json +3 -0
- package/fixtures/openapi/WorkbenchModelOption/invalid/zero-capacity.json +1 -0
- package/fixtures/openapi/WorkbenchModelOption/valid/capacity.json +1 -0
- package/fixtures/openapi/WorkbenchModelOption/valid/unknown.json +1 -0
- package/fixtures/openapi/WorkbenchProfessionalCapabilityInput/invalid/basic.json +7 -0
- package/fixtures/openapi/WorkbenchProfessionalCapabilityInput/valid/basic.json +11 -0
- package/fixtures/openapi/WorkbenchProfessionalCapabilityInput/valid/selected-profile.json +23 -0
- package/fixtures/openapi/WorkbenchSendMessageStreamRequest/invalid/missing-required.json +1 -0
- package/fixtures/openapi/WorkbenchSendMessageStreamRequest/valid/mixed-professional-task.json +22 -0
- package/fixtures/openapi/WorkbenchTaskIntent/invalid/basic.json +5 -0
- package/fixtures/openapi/WorkbenchTaskIntent/invalid/oversized-capability-source.json +3 -0
- package/fixtures/openapi/WorkbenchTaskIntent/valid/basic.json +9 -0
- package/fixtures/openapi/WorkbenchTaskIntent/valid/independent-sources.json +17 -0
- package/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/kubernetes_monitoring_test.go +67 -0
- package/gen/go/sohaapi/personal_environment_test.go +25 -0
- package/gen/go/sohaapi/types.go +3460 -433
- package/gen/go/sohaapi/vm_disk_test.go +21 -0
- package/gen/ts/sohaapi/index.ts +5454 -1397
- package/go.mod +61 -49
- package/go.sum +202 -176
- package/knowledge/connector-definition.schema.json +6 -1
- package/knowledge/source-import-policy.schema.json +32 -0
- package/memory/memory-record.schema.json +1 -1
- package/openapi/soha-api.json +24199 -16810
- package/openapi/soha-api.yaml +2537 -14
- package/openapi/spec_generated.go +3 -3
- package/openapi/spec_test.go +34 -0
- package/package.json +19 -3
- package/resource/agent_access.go +12 -0
- package/resource/agent_profiles.go +62 -0
- package/resource/agent_profiles_test.go +36 -0
- package/resource/kubernetes_kinds.go +73 -0
- package/resource/kubernetes_kinds_test.go +38 -0
- package/resource/models.go +23 -14
- package/resource/network_topology.go +166 -0
- package/resource/network_topology_projection.go +208 -0
- package/resource/network_topology_projection_test.go +53 -0
- package/resource/network_topology_test.go +51 -0
- package/resource/network_topology_validation.go +29 -0
- package/resource/node_drain.go +34 -0
- package/resource/resource_monitoring.go +99 -0
- package/resource/runtime/network_topology.go +232 -0
- package/resource/runtime/network_topology_test.go +62 -0
- package/resource/runtime/node_drain.go +124 -0
- package/resource/runtime/node_drain_test.go +95 -0
- package/resource/runtime/resource_edit.go +128 -0
- package/resource/runtime/resource_edit_test.go +183 -0
- package/resource/runtime/resource_monitoring.go +243 -0
- package/resource/runtime/resource_monitoring_test.go +88 -0
- /package/fixtures/openapi/DeliveryExecutionHistoryPage/{invalid-kind.json → invalid/invalid-kind.json} +0 -0
- /package/fixtures/openapi/DeliveryExecutionHistoryPage/{valid-build.json → valid/valid-build.json} +0 -0
- /package/fixtures/openapi/DeliveryExecutionHistoryPage/{valid-empty.json → valid/valid-empty.json} +0 -0
|
@@ -5,9 +5,9 @@ package openapi
|
|
|
5
5
|
import _ "embed"
|
|
6
6
|
|
|
7
7
|
const (
|
|
8
|
-
Version = "0.1.
|
|
9
|
-
YAMLSHA256 = "
|
|
10
|
-
JSONSHA256 = "
|
|
8
|
+
Version = "0.1.25"
|
|
9
|
+
YAMLSHA256 = "5f72e3a41fbf5edf22773a9b85d2841c87c99a0636ad704065b9b1333414bd02"
|
|
10
|
+
JSONSHA256 = "60341d8b2940687e94a3ed239363761e8e50cf36824fda11f344ba6363a17c04"
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
//go:embed soha-api.yaml
|
package/openapi/spec_test.go
CHANGED
|
@@ -4,6 +4,7 @@ import (
|
|
|
4
4
|
"crypto/sha256"
|
|
5
5
|
"encoding/json"
|
|
6
6
|
"fmt"
|
|
7
|
+
"strings"
|
|
7
8
|
"testing"
|
|
8
9
|
)
|
|
9
10
|
|
|
@@ -36,3 +37,36 @@ func TestEmbeddedSpecsMatchMetadata(t *testing.T) {
|
|
|
36
37
|
t.Fatalf("info.version = %q, want %q", document.Info.Version, Version)
|
|
37
38
|
}
|
|
38
39
|
}
|
|
40
|
+
|
|
41
|
+
func TestTopologySuccessResponsePreservesDescription(t *testing.T) {
|
|
42
|
+
var document struct {
|
|
43
|
+
Paths map[string]struct {
|
|
44
|
+
Get struct {
|
|
45
|
+
Responses map[string]map[string]json.RawMessage `json:"responses"`
|
|
46
|
+
} `json:"get"`
|
|
47
|
+
} `json:"paths"`
|
|
48
|
+
}
|
|
49
|
+
if err := json.Unmarshal(JSON(), &document); err != nil {
|
|
50
|
+
t.Fatal(err)
|
|
51
|
+
}
|
|
52
|
+
response := document.Paths["/clusters/{clusterID}/network/topology"].Get.Responses["200"]
|
|
53
|
+
if len(response) == 0 {
|
|
54
|
+
t.Fatal("missing topology success response")
|
|
55
|
+
}
|
|
56
|
+
for key := range response {
|
|
57
|
+
switch key {
|
|
58
|
+
case "description", "headers", "content", "links":
|
|
59
|
+
default:
|
|
60
|
+
if !strings.HasPrefix(key, "x-") {
|
|
61
|
+
t.Errorf("unexpected topology response field %q", key)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
var description string
|
|
66
|
+
if err := json.Unmarshal(response["description"], &description); err != nil {
|
|
67
|
+
t.Fatal(err)
|
|
68
|
+
}
|
|
69
|
+
if !strings.Contains(description, "Kubernetes, Gateway API, Traefik and APISIX topology,") {
|
|
70
|
+
t.Fatalf("topology response description was truncated: %q", description)
|
|
71
|
+
}
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opensoha/contracts",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Shared OpenSoha API, agent, MCP, skill, event, and auth contracts.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"check:permissions": "node scripts/generate-permission-catalog.mjs --check",
|
|
17
17
|
"check:version-sync": "node scripts/check-version-sync.mjs",
|
|
18
18
|
"check:consumers": "node scripts/check-consumers.mjs",
|
|
19
|
-
"validate": "node scripts/validate.mjs",
|
|
19
|
+
"validate": "node --test scripts/validate-fixtures.checks.mjs && node scripts/validate.mjs",
|
|
20
20
|
"lint:openapi": "node scripts/lint-openapi.mjs",
|
|
21
21
|
"check:openapi-breaking": "node scripts/check-openapi-breaking.mjs",
|
|
22
22
|
"check:openapi-loose-boundaries": "node scripts/check-openapi-loose-boundaries.mjs",
|
|
@@ -89,7 +89,23 @@
|
|
|
89
89
|
"./evaluation/gate-decision.schema.json": "./evaluation/gate-decision.schema.json",
|
|
90
90
|
"./evaluation/feedback-sample.schema.json": "./evaluation/feedback-sample.schema.json",
|
|
91
91
|
"./memory/memory-record.schema.json": "./memory/memory-record.schema.json",
|
|
92
|
-
"./memory/memory-policy.schema.json": "./memory/memory-policy.schema.json"
|
|
92
|
+
"./memory/memory-policy.schema.json": "./memory/memory-policy.schema.json",
|
|
93
|
+
"./agent/personal-environment-request.schema.json": "./agent/personal-environment-request.schema.json",
|
|
94
|
+
"./agent/personal-environment-result.schema.json": "./agent/personal-environment-result.schema.json",
|
|
95
|
+
"./agent/personal-environment-preflight-request.schema.json": "./agent/personal-environment-preflight-request.schema.json",
|
|
96
|
+
"./agent/personal-environment-preflight-result.schema.json": "./agent/personal-environment-preflight-result.schema.json",
|
|
97
|
+
"./agent/personal-guest-binding.schema.json": "./agent/personal-guest-binding.schema.json",
|
|
98
|
+
"./agent/personal-guest-enrollment.schema.json": "./agent/personal-guest-enrollment.schema.json",
|
|
99
|
+
"./agent/personal-guest-heartbeat.schema.json": "./agent/personal-guest-heartbeat.schema.json",
|
|
100
|
+
"./connectors/connector-action.schema.json": "./connectors/connector-action.schema.json",
|
|
101
|
+
"./agent/personal-guest-renewal.schema.json": "./agent/personal-guest-renewal.schema.json",
|
|
102
|
+
"./agent/personal-guest-data-plan.schema.json": "./agent/personal-guest-data-plan.schema.json",
|
|
103
|
+
"./agent/personal-guest-provisioning.schema.json": "./agent/personal-guest-provisioning.schema.json",
|
|
104
|
+
"./agent/personal-guest-runtime.schema.json": "./agent/personal-guest-runtime.schema.json",
|
|
105
|
+
"./agent/personal-guest-runtime-result.schema.json": "./agent/personal-guest-runtime-result.schema.json",
|
|
106
|
+
"./agent/personal-guest-tools.schema.json": "./agent/personal-guest-tools.schema.json",
|
|
107
|
+
"./agent/personal-browser-network-request.schema.json": "./agent/personal-browser-network-request.schema.json",
|
|
108
|
+
"./agent/personal-browser-network-response.schema.json": "./agent/personal-browser-network-response.schema.json"
|
|
93
109
|
},
|
|
94
110
|
"files": [
|
|
95
111
|
"delivery",
|
package/resource/agent_access.go
CHANGED
|
@@ -21,3 +21,15 @@ type PrometheusQuery struct {
|
|
|
21
21
|
End int64 `json:"end,omitempty"`
|
|
22
22
|
Step int64 `json:"step,omitempty"`
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
// AgentActionCheck separates binary support, authenticated action policy, and Kubernetes authorization.
|
|
26
|
+
// RBAC scope is cluster-wide; target-specific checks and mutations remain authoritative.
|
|
27
|
+
type AgentActionCheck struct {
|
|
28
|
+
Action string `json:"action"`
|
|
29
|
+
Implementation string `json:"implementation"`
|
|
30
|
+
Configured string `json:"configured"`
|
|
31
|
+
KubernetesRBAC string `json:"kubernetesRBAC"`
|
|
32
|
+
CheckedAt string `json:"checkedAt,omitempty"`
|
|
33
|
+
ReasonCode string `json:"reasonCode,omitempty"`
|
|
34
|
+
Scope string `json:"scope,omitempty"`
|
|
35
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
package resource
|
|
2
|
+
|
|
3
|
+
import "fmt"
|
|
4
|
+
|
|
5
|
+
// KubernetesAgentProfileActions is an installation preset, never a runtime permission bypass.
|
|
6
|
+
// Legacy preserves installations generated before the workbench profile was introduced.
|
|
7
|
+
func KubernetesAgentProfileActions(profile string) ([]string, error) {
|
|
8
|
+
switch profile {
|
|
9
|
+
case "read-only":
|
|
10
|
+
return []string{"platform.custom_resources.list"}, nil
|
|
11
|
+
case "workbench":
|
|
12
|
+
return append([]string(nil), kubernetesWorkbenchActions[:]...), nil
|
|
13
|
+
case "legacy":
|
|
14
|
+
actions := make([]string, 0, len(kubernetesWorkbenchActions))
|
|
15
|
+
for _, action := range kubernetesWorkbenchActions {
|
|
16
|
+
if action != "platform.helm_releases.install" && action != "platform.helm_releases.values_update" && action != "platform.helm_releases.delete" && action != "platform.helm_releases.rollback" {
|
|
17
|
+
actions = append(actions, action)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return actions, nil
|
|
21
|
+
default:
|
|
22
|
+
return nil, fmt.Errorf("unknown Kubernetes Agent action profile")
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// KubernetesAgentActions lists implemented platform actions, including separately opted-in CRD deletion.
|
|
27
|
+
func KubernetesAgentActions() []string {
|
|
28
|
+
actions := make([]string, 0, len(kubernetesWorkbenchActions))
|
|
29
|
+
for _, action := range kubernetesWorkbenchActions {
|
|
30
|
+
if action != "runtime.execution_tasks.cancel" {
|
|
31
|
+
actions = append(actions, action)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return append(actions, "platform.crds.delete")
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
var kubernetesWorkbenchActions = [...]string{
|
|
38
|
+
"platform.nodes.drain",
|
|
39
|
+
"platform.pods.exec",
|
|
40
|
+
"platform.deployments.restart",
|
|
41
|
+
"platform.deployments.scale",
|
|
42
|
+
"platform.deployments.image",
|
|
43
|
+
"platform.deployments.rollback",
|
|
44
|
+
"platform.statefulsets.restart",
|
|
45
|
+
"platform.statefulsets.scale",
|
|
46
|
+
"platform.daemonsets.restart",
|
|
47
|
+
"platform.resources.apply",
|
|
48
|
+
"platform.resources.create",
|
|
49
|
+
"platform.resources.delete",
|
|
50
|
+
"platform.custom_resources.list",
|
|
51
|
+
"platform.custom_resources.create",
|
|
52
|
+
"platform.custom_resources.apply",
|
|
53
|
+
"platform.custom_resources.delete",
|
|
54
|
+
"platform.port_forwards.create",
|
|
55
|
+
"platform.port_forwards.tunnel",
|
|
56
|
+
"platform.port_forwards.delete",
|
|
57
|
+
"platform.helm_releases.install",
|
|
58
|
+
"platform.helm_releases.values_update",
|
|
59
|
+
"platform.helm_releases.delete",
|
|
60
|
+
"platform.helm_releases.rollback",
|
|
61
|
+
"runtime.execution_tasks.cancel",
|
|
62
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package resource
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"slices"
|
|
5
|
+
"testing"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
func TestKubernetesAgentProfilesKeepPermissionsExplicit(t *testing.T) {
|
|
9
|
+
workbench, err := KubernetesAgentProfileActions("workbench")
|
|
10
|
+
if err != nil {
|
|
11
|
+
t.Fatal(err)
|
|
12
|
+
}
|
|
13
|
+
for _, action := range []string{"platform.nodes.drain", "platform.resources.apply", "platform.resources.create", "platform.resources.delete", "platform.helm_releases.rollback", "platform.port_forwards.tunnel"} {
|
|
14
|
+
if !slices.Contains(workbench, action) {
|
|
15
|
+
t.Fatalf("missing workbench action %s", action)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if slices.Contains(workbench, "*") || slices.Contains(workbench, "platform.crds.delete") {
|
|
19
|
+
t.Fatal("workbench must not opt into unrestricted or CRD deletion actions")
|
|
20
|
+
}
|
|
21
|
+
legacy, _ := KubernetesAgentProfileActions("legacy")
|
|
22
|
+
if slices.Contains(legacy, "platform.helm_releases.install") {
|
|
23
|
+
t.Fatal("legacy installation permissions expanded")
|
|
24
|
+
}
|
|
25
|
+
readOnly, _ := KubernetesAgentProfileActions("read-only")
|
|
26
|
+
if !slices.Equal(readOnly, []string{"platform.custom_resources.list"}) {
|
|
27
|
+
t.Fatalf("read-only contains writes: %v", readOnly)
|
|
28
|
+
}
|
|
29
|
+
if _, err := KubernetesAgentProfileActions("unknown"); err == nil {
|
|
30
|
+
t.Fatal("unknown profile accepted")
|
|
31
|
+
}
|
|
32
|
+
workbench[0] = "changed"
|
|
33
|
+
if next, _ := KubernetesAgentProfileActions("workbench"); next[0] == "changed" {
|
|
34
|
+
t.Fatal("profile leaked mutable storage")
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
package resource
|
|
2
|
+
|
|
3
|
+
import "strings"
|
|
4
|
+
|
|
5
|
+
// KubernetesResourceKind describes the fixed resource surface shared by both transports.
|
|
6
|
+
// GenericYAML excludes resources whose dedicated lifecycle has stronger authorization.
|
|
7
|
+
type KubernetesResourceKind struct {
|
|
8
|
+
Kind string
|
|
9
|
+
Group string
|
|
10
|
+
Version string
|
|
11
|
+
Resource string
|
|
12
|
+
Namespaced bool
|
|
13
|
+
GenericYAML bool
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var kubernetesResourceKinds = [...]KubernetesResourceKind{
|
|
17
|
+
{Kind: "Namespace", Group: "", Version: "v1", Resource: "namespaces", Namespaced: false, GenericYAML: false},
|
|
18
|
+
{Kind: "Pod", Group: "", Version: "v1", Resource: "pods", Namespaced: true, GenericYAML: true},
|
|
19
|
+
{Kind: "Node", Group: "", Version: "v1", Resource: "nodes", Namespaced: false, GenericYAML: true},
|
|
20
|
+
{Kind: "Deployment", Group: "apps", Version: "v1", Resource: "deployments", Namespaced: true, GenericYAML: true},
|
|
21
|
+
{Kind: "StatefulSet", Group: "apps", Version: "v1", Resource: "statefulsets", Namespaced: true, GenericYAML: true},
|
|
22
|
+
{Kind: "DaemonSet", Group: "apps", Version: "v1", Resource: "daemonsets", Namespaced: true, GenericYAML: true},
|
|
23
|
+
{Kind: "ReplicaSet", Group: "apps", Version: "v1", Resource: "replicasets", Namespaced: true, GenericYAML: true},
|
|
24
|
+
{Kind: "Job", Group: "batch", Version: "v1", Resource: "jobs", Namespaced: true, GenericYAML: true},
|
|
25
|
+
{Kind: "CronJob", Group: "batch", Version: "v1", Resource: "cronjobs", Namespaced: true, GenericYAML: true},
|
|
26
|
+
{Kind: "ConfigMap", Group: "", Version: "v1", Resource: "configmaps", Namespaced: true, GenericYAML: true},
|
|
27
|
+
{Kind: "Secret", Group: "", Version: "v1", Resource: "secrets", Namespaced: true, GenericYAML: true},
|
|
28
|
+
{Kind: "ServiceAccount", Group: "", Version: "v1", Resource: "serviceaccounts", Namespaced: true, GenericYAML: true},
|
|
29
|
+
{Kind: "ReplicationController", Group: "", Version: "v1", Resource: "replicationcontrollers", Namespaced: true, GenericYAML: true},
|
|
30
|
+
{Kind: "Service", Group: "", Version: "v1", Resource: "services", Namespaced: true, GenericYAML: true},
|
|
31
|
+
{Kind: "PersistentVolumeClaim", Group: "", Version: "v1", Resource: "persistentvolumeclaims", Namespaced: true, GenericYAML: true},
|
|
32
|
+
{Kind: "PersistentVolume", Group: "", Version: "v1", Resource: "persistentvolumes", Namespaced: false, GenericYAML: true},
|
|
33
|
+
{Kind: "StorageClass", Group: "storage.k8s.io", Version: "v1", Resource: "storageclasses", Namespaced: false, GenericYAML: true},
|
|
34
|
+
{Kind: "Role", Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "roles", Namespaced: true, GenericYAML: true},
|
|
35
|
+
{Kind: "RoleBinding", Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "rolebindings", Namespaced: true, GenericYAML: true},
|
|
36
|
+
{Kind: "ResourceQuota", Group: "", Version: "v1", Resource: "resourcequotas", Namespaced: true, GenericYAML: true},
|
|
37
|
+
{Kind: "LimitRange", Group: "", Version: "v1", Resource: "limitranges", Namespaced: true, GenericYAML: true},
|
|
38
|
+
{Kind: "Lease", Group: "coordination.k8s.io", Version: "v1", Resource: "leases", Namespaced: true, GenericYAML: true},
|
|
39
|
+
{Kind: "HorizontalPodAutoscaler", Group: "autoscaling", Version: "v2", Resource: "horizontalpodautoscalers", Namespaced: true, GenericYAML: true},
|
|
40
|
+
{Kind: "PodDisruptionBudget", Group: "policy", Version: "v1", Resource: "poddisruptionbudgets", Namespaced: true, GenericYAML: true},
|
|
41
|
+
{Kind: "Ingress", Group: "networking.k8s.io", Version: "v1", Resource: "ingresses", Namespaced: true, GenericYAML: true},
|
|
42
|
+
{Kind: "EndpointSlice", Group: "discovery.k8s.io", Version: "v1", Resource: "endpointslices", Namespaced: true, GenericYAML: true},
|
|
43
|
+
{Kind: "NetworkPolicy", Group: "networking.k8s.io", Version: "v1", Resource: "networkpolicies", Namespaced: true, GenericYAML: true},
|
|
44
|
+
{Kind: "IngressClass", Group: "networking.k8s.io", Version: "v1", Resource: "ingressclasses", Namespaced: false, GenericYAML: true},
|
|
45
|
+
{Kind: "GatewayClass", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "gatewayclasses", Namespaced: false, GenericYAML: true},
|
|
46
|
+
{Kind: "Gateway", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "gateways", Namespaced: true, GenericYAML: true},
|
|
47
|
+
{Kind: "HTTPRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "httproutes", Namespaced: true, GenericYAML: true},
|
|
48
|
+
{Kind: "BackendTLSPolicy", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "backendtlspolicies", Namespaced: true, GenericYAML: true},
|
|
49
|
+
{Kind: "GRPCRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "grpcroutes", Namespaced: true, GenericYAML: true},
|
|
50
|
+
{Kind: "ReferenceGrant", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "referencegrants", Namespaced: true, GenericYAML: true},
|
|
51
|
+
{Kind: "PriorityClass", Group: "scheduling.k8s.io", Version: "v1", Resource: "priorityclasses", Namespaced: false, GenericYAML: true},
|
|
52
|
+
{Kind: "RuntimeClass", Group: "node.k8s.io", Version: "v1", Resource: "runtimeclasses", Namespaced: false, GenericYAML: true},
|
|
53
|
+
{Kind: "ClusterRole", Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterroles", Namespaced: false, GenericYAML: true},
|
|
54
|
+
{Kind: "ClusterRoleBinding", Group: "rbac.authorization.k8s.io", Version: "v1", Resource: "clusterrolebindings", Namespaced: false, GenericYAML: true},
|
|
55
|
+
{Kind: "CustomResourceDefinition", Group: "apiextensions.k8s.io", Version: "v1", Resource: "customresourcedefinitions", Namespaced: false, GenericYAML: false},
|
|
56
|
+
{Kind: "WorkloadCronJob", Group: "workloads.soha.io", Version: "v1alpha1", Resource: "workloadcronjobs", Namespaced: true, GenericYAML: false},
|
|
57
|
+
{Kind: "MutatingWebhookConfiguration", Group: "admissionregistration.k8s.io", Version: "v1", Resource: "mutatingwebhookconfigurations", Namespaced: false, GenericYAML: true},
|
|
58
|
+
{Kind: "ValidatingWebhookConfiguration", Group: "admissionregistration.k8s.io", Version: "v1", Resource: "validatingwebhookconfigurations", Namespaced: false, GenericYAML: true},
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// KubernetesResourceKinds returns a copy so callers cannot alter the shared surface.
|
|
62
|
+
func KubernetesResourceKinds() []KubernetesResourceKind {
|
|
63
|
+
return append([]KubernetesResourceKind(nil), kubernetesResourceKinds[:]...)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
func LookupKubernetesResourceKind(kind string) (KubernetesResourceKind, bool) {
|
|
67
|
+
for _, definition := range kubernetesResourceKinds {
|
|
68
|
+
if strings.EqualFold(strings.TrimSpace(kind), definition.Kind) {
|
|
69
|
+
return definition, true
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return KubernetesResourceKind{}, false
|
|
73
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
package resource
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"strings"
|
|
5
|
+
"testing"
|
|
6
|
+
)
|
|
7
|
+
|
|
8
|
+
func TestKubernetesResourceKindsAreUniqueAndKeepDedicatedLifecycles(t *testing.T) {
|
|
9
|
+
seen := map[string]bool{}
|
|
10
|
+
for _, definition := range KubernetesResourceKinds() {
|
|
11
|
+
key := strings.ToLower(definition.Kind)
|
|
12
|
+
if seen[key] || definition.Version == "" || definition.Resource == "" {
|
|
13
|
+
t.Fatalf("invalid definition: %+v", definition)
|
|
14
|
+
}
|
|
15
|
+
seen[key] = true
|
|
16
|
+
if got, ok := LookupKubernetesResourceKind(" " + key + " "); !ok || got != definition {
|
|
17
|
+
t.Fatalf("lookup: %+v %v", got, ok)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
for _, kind := range []string{"Namespace", "CustomResourceDefinition", "WorkloadCronJob"} {
|
|
21
|
+
if definition, ok := LookupKubernetesResourceKind(kind); !ok || definition.GenericYAML {
|
|
22
|
+
t.Fatalf("%s must retain its dedicated lifecycle", kind)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
for _, kind := range []string{"HorizontalPodAutoscaler", "PodDisruptionBudget"} {
|
|
26
|
+
if definition, ok := LookupKubernetesResourceKind(kind); !ok || !definition.GenericYAML || !definition.Namespaced {
|
|
27
|
+
t.Fatalf("missing namespaced YAML surface: %s", kind)
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if _, ok := LookupKubernetesResourceKind("Unknown"); ok {
|
|
31
|
+
t.Fatal("unknown kind accepted")
|
|
32
|
+
}
|
|
33
|
+
definitions := KubernetesResourceKinds()
|
|
34
|
+
definitions[0].Kind = "changed"
|
|
35
|
+
if KubernetesResourceKinds()[0].Kind == "changed" {
|
|
36
|
+
t.Fatal("caller changed the shared registry")
|
|
37
|
+
}
|
|
38
|
+
}
|
package/resource/models.go
CHANGED
|
@@ -14,13 +14,14 @@ const (
|
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
type ResourceRef struct {
|
|
17
|
-
ClusterID
|
|
18
|
-
APIVersion
|
|
19
|
-
Kind
|
|
20
|
-
Name
|
|
21
|
-
Namespace
|
|
22
|
-
ScopeMode
|
|
23
|
-
UID
|
|
17
|
+
ClusterID string `json:"clusterId"`
|
|
18
|
+
APIVersion string `json:"apiVersion"`
|
|
19
|
+
Kind string `json:"kind"`
|
|
20
|
+
Name string `json:"name"`
|
|
21
|
+
Namespace string `json:"namespace,omitempty"`
|
|
22
|
+
ScopeMode ResourceScopeMode `json:"scopeMode"`
|
|
23
|
+
UID string `json:"uid,omitempty"`
|
|
24
|
+
ResourceVersion string `json:"resourceVersion,omitempty"`
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
type ResourceSearchItem struct {
|
|
@@ -897,19 +898,27 @@ type NetworkTopologyTraceView struct {
|
|
|
897
898
|
}
|
|
898
899
|
|
|
899
900
|
type NetworkTopologyView struct {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
901
|
+
GraphVersion string `json:"graphVersion,omitempty"`
|
|
902
|
+
Nodes []NetworkTopologyGraphNode `json:"nodes,omitempty"`
|
|
903
|
+
Edges []NetworkTopologyGraphEdge `json:"edges,omitempty"`
|
|
904
|
+
Coverage []NetworkTopologyCoverage `json:"coverage,omitempty"`
|
|
905
|
+
ObservedAt string `json:"observedAt,omitempty"`
|
|
906
|
+
Truncated bool `json:"truncated,omitempty"`
|
|
907
|
+
ClusterID string `json:"clusterId"`
|
|
908
|
+
Namespace string `json:"namespace,omitempty"`
|
|
909
|
+
Source string `json:"source"`
|
|
910
|
+
GeneratedAt string `json:"generatedAt"`
|
|
911
|
+
Summary NetworkTopologySummaryView `json:"summary"`
|
|
912
|
+
Traces []NetworkTopologyTraceView `json:"traces,omitempty"`
|
|
913
|
+
Warnings []string `json:"warnings,omitempty"`
|
|
907
914
|
}
|
|
908
915
|
|
|
909
916
|
type NodeView struct {
|
|
910
917
|
Name string `json:"name"`
|
|
911
918
|
Status string `json:"status"`
|
|
912
919
|
Unschedulable bool `json:"unschedulable"`
|
|
920
|
+
Taints []NodeTaintView `json:"taints"`
|
|
921
|
+
Conditions []WorkloadConditionView `json:"conditions"`
|
|
913
922
|
Roles []string `json:"roles,omitempty"`
|
|
914
923
|
Version string `json:"version,omitempty"`
|
|
915
924
|
InternalIP string `json:"internalIp,omitempty"`
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
package resource
|
|
2
|
+
|
|
3
|
+
const (
|
|
4
|
+
NetworkTopologySnapshotFeature = "network.topology.snapshot.v1"
|
|
5
|
+
NetworkTopologyGatewayL4Feature = "network.topology.gateway-l4.v1"
|
|
6
|
+
NetworkTopologyMaxQueries = 64
|
|
7
|
+
NetworkTopologyMaxSourceItems = 200
|
|
8
|
+
NetworkTopologyMaxSourceBytes = 1 << 20
|
|
9
|
+
NetworkTopologyMaxTotalBytes = 4 << 20
|
|
10
|
+
NetworkTopologyMaxObjectBytes = 64 << 10
|
|
11
|
+
NetworkTopologyDefaultNodes = 200
|
|
12
|
+
NetworkTopologyDefaultEdges = 400
|
|
13
|
+
NetworkTopologyMaxNodes = 500
|
|
14
|
+
NetworkTopologyMaxEdges = 1000
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
type NetworkTopologyGraphNode struct {
|
|
18
|
+
ID string `json:"id"`
|
|
19
|
+
Type string `json:"type"`
|
|
20
|
+
Label string `json:"label"`
|
|
21
|
+
Provider string `json:"provider"`
|
|
22
|
+
Protocol string `json:"protocol,omitempty"`
|
|
23
|
+
ResolutionState string `json:"resolutionState"`
|
|
24
|
+
Resource *ResourceRef `json:"resource,omitempty"`
|
|
25
|
+
Rule *NetworkTopologyRule `json:"rule,omitempty"`
|
|
26
|
+
Properties []NetworkTopologyProperty `json:"properties,omitempty"`
|
|
27
|
+
Conditions []NetworkTopologyCondition `json:"conditions,omitempty"`
|
|
28
|
+
Generation int64 `json:"generation,omitempty"`
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type NetworkTopologyGraphEdge struct {
|
|
32
|
+
ID string `json:"id"`
|
|
33
|
+
Source string `json:"source"`
|
|
34
|
+
Target string `json:"target"`
|
|
35
|
+
Relation string `json:"relation"`
|
|
36
|
+
ResolutionState string `json:"resolutionState"`
|
|
37
|
+
Protocol string `json:"protocol,omitempty"`
|
|
38
|
+
Port string `json:"port,omitempty"`
|
|
39
|
+
Weight *int64 `json:"weight,omitempty"`
|
|
40
|
+
TotalWeight *int64 `json:"totalWeight,omitempty"`
|
|
41
|
+
MirrorPercent *float64 `json:"mirrorPercent,omitempty"`
|
|
42
|
+
RuleRef string `json:"ruleRef,omitempty"`
|
|
43
|
+
SourceRef *ResourceRef `json:"sourceRef,omitempty"`
|
|
44
|
+
Note string `json:"note,omitempty"`
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type NetworkTopologyRule struct {
|
|
48
|
+
Name string `json:"name,omitempty"`
|
|
49
|
+
Index int `json:"index"`
|
|
50
|
+
MatchGroups [][]NetworkTopologyMatch `json:"matchGroups,omitempty"`
|
|
51
|
+
MatchSummary string `json:"matchSummary,omitempty"`
|
|
52
|
+
Priority *int64 `json:"priority,omitempty"`
|
|
53
|
+
TLSMode string `json:"tlsMode,omitempty"`
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type NetworkTopologyMatch struct {
|
|
57
|
+
Type string `json:"type"`
|
|
58
|
+
Name string `json:"name,omitempty"`
|
|
59
|
+
Operator string `json:"operator,omitempty"`
|
|
60
|
+
Value string `json:"value,omitempty"`
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
type NetworkTopologyProperty struct {
|
|
64
|
+
Name string `json:"name"`
|
|
65
|
+
Value string `json:"value"`
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
type NetworkTopologyCondition struct {
|
|
69
|
+
Type string `json:"type"`
|
|
70
|
+
Status string `json:"status"`
|
|
71
|
+
Reason string `json:"reason,omitempty"`
|
|
72
|
+
ObservedGeneration *int64 `json:"observedGeneration,omitempty"`
|
|
73
|
+
LastTransitionTime string `json:"lastTransitionTime,omitempty"`
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
type NetworkTopologyCoverage struct {
|
|
77
|
+
Provider string `json:"provider"`
|
|
78
|
+
SourceID string `json:"sourceId"`
|
|
79
|
+
State string `json:"state"`
|
|
80
|
+
Namespace string `json:"namespace,omitempty"`
|
|
81
|
+
SupportedKinds []string `json:"supportedKinds,omitempty"`
|
|
82
|
+
ReasonCode string `json:"reasonCode,omitempty"`
|
|
83
|
+
CheckedAt string `json:"checkedAt,omitempty"`
|
|
84
|
+
ObservedAt string `json:"observedAt,omitempty"`
|
|
85
|
+
Truncated bool `json:"truncated,omitempty"`
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Snapshot queries name a fixed source, never a caller-supplied GVR or field path.
|
|
89
|
+
type NetworkTopologySourceQuery struct {
|
|
90
|
+
SourceID string `json:"sourceId"`
|
|
91
|
+
Namespace string `json:"namespace,omitempty"`
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
type NetworkTopologySnapshotRequest struct {
|
|
95
|
+
Queries []NetworkTopologySourceQuery `json:"queries"`
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
type NetworkTopologySourceObject struct {
|
|
99
|
+
Resource ResourceRef `json:"resource"`
|
|
100
|
+
Generation int64 `json:"generation,omitempty"`
|
|
101
|
+
// Content contains only the source's contract-allowlisted projection, not an original manifest.
|
|
102
|
+
Content string `json:"content"`
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
type NetworkTopologySourceResult struct {
|
|
106
|
+
Coverage NetworkTopologyCoverage `json:"coverage"`
|
|
107
|
+
Objects []NetworkTopologySourceObject `json:"objects"`
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type NetworkTopologySnapshot struct {
|
|
111
|
+
Version string `json:"version"`
|
|
112
|
+
Sources []NetworkTopologySourceResult `json:"sources"`
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
type NetworkTopologySourceDefinition struct {
|
|
116
|
+
ID string
|
|
117
|
+
Provider string
|
|
118
|
+
FallbackVersion string
|
|
119
|
+
CRDResourceDefinition
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
var networkTopologySources = [...]NetworkTopologySourceDefinition{
|
|
123
|
+
{ID: "kubernetes.services", Provider: "kubernetes", CRDResourceDefinition: CRDResourceDefinition{Kind: "Service", Version: "v1", Resource: "services", Namespaced: true}},
|
|
124
|
+
{ID: "kubernetes.pods", Provider: "kubernetes", CRDResourceDefinition: CRDResourceDefinition{Kind: "Pod", Version: "v1", Resource: "pods", Namespaced: true}},
|
|
125
|
+
{ID: "kubernetes.endpointslices", Provider: "kubernetes", CRDResourceDefinition: CRDResourceDefinition{Kind: "EndpointSlice", Group: "discovery.k8s.io", Version: "v1", Resource: "endpointslices", Namespaced: true}},
|
|
126
|
+
{ID: "kubernetes.ingresses", Provider: "kubernetes", CRDResourceDefinition: CRDResourceDefinition{Kind: "Ingress", Group: "networking.k8s.io", Version: "v1", Resource: "ingresses", Namespaced: true}},
|
|
127
|
+
{ID: "kubernetes.ingressclasses", Provider: "kubernetes", CRDResourceDefinition: CRDResourceDefinition{Kind: "IngressClass", Group: "networking.k8s.io", Version: "v1", Resource: "ingressclasses"}},
|
|
128
|
+
{ID: "gateway.gateways", Provider: "gateway", CRDResourceDefinition: CRDResourceDefinition{Kind: "Gateway", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "gateways", Namespaced: true}},
|
|
129
|
+
{ID: "gateway.gatewayclasses", Provider: "gateway", CRDResourceDefinition: CRDResourceDefinition{Kind: "GatewayClass", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "gatewayclasses"}},
|
|
130
|
+
{ID: "gateway.httproutes", Provider: "gateway", CRDResourceDefinition: CRDResourceDefinition{Kind: "HTTPRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "httproutes", Namespaced: true}},
|
|
131
|
+
{ID: "gateway.grpcroutes", Provider: "gateway", CRDResourceDefinition: CRDResourceDefinition{Kind: "GRPCRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "grpcroutes", Namespaced: true}},
|
|
132
|
+
{ID: "gateway.tcproutes", Provider: "gateway", FallbackVersion: "v1alpha2", CRDResourceDefinition: CRDResourceDefinition{Kind: "TCPRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "tcproutes", Namespaced: true}},
|
|
133
|
+
{ID: "gateway.tlsroutes", Provider: "gateway", FallbackVersion: "v1alpha2", CRDResourceDefinition: CRDResourceDefinition{Kind: "TLSRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "tlsroutes", Namespaced: true}},
|
|
134
|
+
{ID: "gateway.udproutes", Provider: "gateway", FallbackVersion: "v1alpha2", CRDResourceDefinition: CRDResourceDefinition{Kind: "UDPRoute", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "udproutes", Namespaced: true}},
|
|
135
|
+
{ID: "gateway.referencegrants", Provider: "gateway", FallbackVersion: "v1beta1", CRDResourceDefinition: CRDResourceDefinition{Kind: "ReferenceGrant", Group: "gateway.networking.k8s.io", Version: "v1", Resource: "referencegrants", Namespaced: true}},
|
|
136
|
+
{ID: "traefik.ingressroutes", Provider: "traefik", CRDResourceDefinition: CRDResourceDefinition{Kind: "IngressRoute", Group: "traefik.io", Version: "v1alpha1", Resource: "ingressroutes", Namespaced: true}},
|
|
137
|
+
{ID: "traefik.ingressroutetcps", Provider: "traefik", CRDResourceDefinition: CRDResourceDefinition{Kind: "IngressRouteTCP", Group: "traefik.io", Version: "v1alpha1", Resource: "ingressroutetcps", Namespaced: true}},
|
|
138
|
+
{ID: "traefik.ingressrouteudps", Provider: "traefik", CRDResourceDefinition: CRDResourceDefinition{Kind: "IngressRouteUDP", Group: "traefik.io", Version: "v1alpha1", Resource: "ingressrouteudps", Namespaced: true}},
|
|
139
|
+
{ID: "traefik.traefikservices", Provider: "traefik", CRDResourceDefinition: CRDResourceDefinition{Kind: "TraefikService", Group: "traefik.io", Version: "v1alpha1", Resource: "traefikservices", Namespaced: true}},
|
|
140
|
+
{ID: "traefik.middlewares", Provider: "traefik", CRDResourceDefinition: CRDResourceDefinition{Kind: "Middleware", Group: "traefik.io", Version: "v1alpha1", Resource: "middlewares", Namespaced: true}},
|
|
141
|
+
{ID: "traefik.middlewaretcps", Provider: "traefik", CRDResourceDefinition: CRDResourceDefinition{Kind: "MiddlewareTCP", Group: "traefik.io", Version: "v1alpha1", Resource: "middlewaretcps", Namespaced: true}},
|
|
142
|
+
{ID: "apisix.apisixroutes", Provider: "apisix", CRDResourceDefinition: CRDResourceDefinition{Kind: "ApisixRoute", Group: "apisix.apache.org", Version: "v2", Resource: "apisixroutes", Namespaced: true}},
|
|
143
|
+
{ID: "apisix.apisixupstreams", Provider: "apisix", CRDResourceDefinition: CRDResourceDefinition{Kind: "ApisixUpstream", Group: "apisix.apache.org", Version: "v2", Resource: "apisixupstreams", Namespaced: true}},
|
|
144
|
+
{ID: "apisix.apisixtls", Provider: "apisix", CRDResourceDefinition: CRDResourceDefinition{Kind: "ApisixTls", Group: "apisix.apache.org", Version: "v2", Resource: "apisixtls", Namespaced: true}},
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
func NetworkTopologySources() []NetworkTopologySourceDefinition {
|
|
148
|
+
return append([]NetworkTopologySourceDefinition(nil), networkTopologySources[:]...)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
func IsGatewayL4TopologySource(id string) bool {
|
|
152
|
+
return id == "gateway.tcproutes" || id == "gateway.tlsroutes" || id == "gateway.udproutes"
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
func (d NetworkTopologySourceDefinition) RequiresCustomResourceAccess() bool {
|
|
156
|
+
return d.Provider == "traefik" || d.Provider == "apisix" || IsGatewayL4TopologySource(d.ID)
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
func LookupNetworkTopologySource(id string) (NetworkTopologySourceDefinition, bool) {
|
|
160
|
+
for _, definition := range networkTopologySources {
|
|
161
|
+
if definition.ID == id {
|
|
162
|
+
return definition, true
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
return NetworkTopologySourceDefinition{}, false
|
|
166
|
+
}
|