@opensoha/contracts 0.1.24 → 0.1.26
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 +24 -0
- package/README.md +1 -1
- package/agent/environment/export.go +1 -0
- package/agent/environment/protocol_test.go +1 -1
- package/agent/guest/protocol_test.go +2 -2
- package/auth/catalog_generated.go +2 -2
- package/auth/gateway_permissions_test.go +48 -0
- package/auth/permission-catalog.json +300 -1
- package/compat/consumer-revisions.json +1 -1
- package/compat/json-schema-ecosystem-0.1.0.json +1 -1
- package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
- package/delivery/document.schema.json +127 -9
- package/examples/relations_compat_test.go +18 -0
- package/fixtures/openapi/DeliveryDocument/invalid/migration-missing-guide-build-template.json +30 -0
- package/fixtures/openapi/DeliveryDocument/invalid/migration-missing-guide-deployment-template.json +30 -0
- package/fixtures/openapi/DeliveryDocument/invalid/migration-missing-guide-workflow-template.json +27 -0
- package/fixtures/openapi/DeliveryDocument/valid/migration-build-template.json +31 -0
- package/fixtures/openapi/DeliveryDocument/valid/migration-deployment-template.json +31 -0
- package/fixtures/openapi/DeliveryDocument/valid/migration-workflow-template.json +28 -0
- package/fixtures/openapi/DeliveryPlanInput/invalid/manual-plan.json +7 -0
- package/fixtures/openapi/DeliveryPlanInput/valid/manual-plan.json +6 -0
- package/fixtures/openapi/DeliveryTargetInput/invalid/candidate-on-runtime-deploy.json +9 -0
- package/fixtures/openapi/DeliveryTargetInput/invalid/config-update-missing-service.json +7 -0
- package/fixtures/openapi/DeliveryTargetInput/valid/template-configuration-only.json +8 -0
- package/fixtures/openapi/DeliveryTargetInput/valid/template-configuration-without-runtime-environment.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/KubernetesImportCandidateListEnvelope/invalid/source-with-spec.json +33 -0
- package/fixtures/openapi/KubernetesImportCandidateListEnvelope/invalid/source-without-uid.json +29 -0
- package/fixtures/openapi/KubernetesImportCandidateListEnvelope/valid/stable-source.json +30 -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/KubernetesPod/invalid/pod-uid.json +9 -0
- package/fixtures/openapi/KubernetesPod/valid/pod-uid.json +9 -0
- package/fixtures/openapi/KubernetesPodDetail/invalid/pod-uid.json +6 -0
- package/fixtures/openapi/KubernetesPodDetail/valid/pod-uid.json +6 -0
- package/fixtures/openapi/KubernetesServiceImportRequest/invalid/empty-source-uid.json +48 -0
- package/fixtures/openapi/KubernetesServiceImportRequest/valid/pinned-workloads-and-cr.json +48 -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/ManifestExecutionTaskPayload/invalid/initialization.json +7 -0
- package/fixtures/openapi/ManifestExecutionTaskPayload/valid/initialization.json +7 -0
- package/fixtures/openapi/ManifestRootResource/invalid/root.json +1 -0
- package/fixtures/openapi/ManifestRootResource/valid/root.json +1 -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/ResourceRelationConfig/invalid/executable-rule.json +17 -0
- package/fixtures/openapi/ResourceRelationConfig/valid/unknown-kind.json +13 -0
- package/fixtures/openapi/ServiceDeploymentTemplateInput/invalid/migration-missing-guide-valid-yaml.json +38 -0
- package/fixtures/openapi/ServiceDeploymentTemplateInput/valid/migration-valid-yaml.json +39 -0
- package/fixtures/openapi/TemplateMigrationAssessment/invalid/initialization.json +9 -0
- package/fixtures/openapi/TemplateMigrationAssessment/valid/initialization.json +9 -0
- package/fixtures/openapi/TemplateMigrationPolicy/invalid/blank-guide.json +5 -0
- package/fixtures/openapi/TemplateMigrationPolicy/invalid/missing-guide.json +4 -0
- package/fixtures/openapi/TemplateMigrationPolicy/invalid/unknown-escape-hatch.json +6 -0
- package/fixtures/openapi/TemplateMigrationPolicy/valid/legacy-safe.json +4 -0
- package/fixtures/openapi/TemplateMigrationPolicy/valid/ordered-data-change.json +5 -0
- package/fixtures/openapi/TemplateUpdateBatchInput/invalid/duplicate-candidates.json +11 -0
- package/fixtures/openapi/TemplateUpdateBatchInput/invalid/empty-identities.json +10 -0
- package/fixtures/openapi/TemplateUpdateBatchInput/valid/staged-adoption.json +10 -0
- package/fixtures/openapi/TemplateUpdatePolicyInput/invalid/unknown-mode.json +8 -0
- package/fixtures/openapi/TemplateUpdatePolicyInput/valid/explicit-automatic.json +8 -0
- package/fixtures/openapi/TemplateUpdatePreviewInput/invalid/empty-identities.json +10 -0
- package/fixtures/openapi/TemplateUpdatePreviewInput/invalid/empty-targets.json +6 -0
- package/fixtures/openapi/TemplateUpdatePreviewInput/valid/cross-version-manual.json +14 -0
- package/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/client_test.go +2 -2
- package/gen/go/sohaapi/import_source_compat_test.go +12 -0
- package/gen/go/sohaapi/kubernetes_monitoring_test.go +67 -0
- package/gen/go/sohaapi/types.go +2210 -387
- package/gen/ts/sohaapi/index.ts +1862 -5
- package/go.mod +2 -2
- package/helmrelease/delivery.go +4 -1
- package/helmrelease/initialization.go +10 -0
- package/helmrelease/runtime/delivery.go +40 -10
- package/helmrelease/runtime/delivery_test.go +4 -0
- package/helmrelease/runtime/initialization.go +186 -0
- package/helmrelease/runtime/initialization_test.go +203 -0
- package/openapi/soha-api.json +5514 -1179
- package/openapi/soha-api.yaml +1080 -11
- package/openapi/spec_generated.go +3 -3
- package/openapi/spec_test.go +76 -0
- package/package.json +1 -1
- 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 +25 -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/relations.go +225 -0
- package/resource/relations_test.go +47 -0
- package/resource/resource_monitoring.go +99 -0
- package/resource/root_cr.go +38 -0
- package/resource/runtime/argocd_integration_test.go +1 -1
- package/resource/runtime/initialization.go +66 -0
- package/resource/runtime/initialization_test.go +80 -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/relations.go +161 -0
- package/resource/runtime/relations_test.go +100 -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/resource/runtime/root_cr.go +79 -0
- package/resource/runtime/root_cr_test.go +118 -0
package/gen/go/sohaapi/client.go
CHANGED
|
@@ -1622,7 +1622,7 @@ func TestCreateServiceAccountTokenEscapesPathPostsBodyAndDecodesData(t *testing.
|
|
|
1622
1622
|
writeJSON(t, w, map[string]any{
|
|
1623
1623
|
"data": map[string]any{
|
|
1624
1624
|
"value": "soha_sat_secret",
|
|
1625
|
-
"token": map[string]any{
|
|
1625
|
+
"token": map[string]any{ // #nosec G101 -- Synthetic token metadata in an httptest response, not a usable credential.
|
|
1626
1626
|
"id": "sat-2",
|
|
1627
1627
|
"serviceAccountId": "svc/1",
|
|
1628
1628
|
"name": "deploy token",
|
|
@@ -1682,7 +1682,7 @@ func TestRotateServiceAccountTokenEscapesPathPostsBodyAndDecodesData(t *testing.
|
|
|
1682
1682
|
writeJSON(t, w, map[string]any{
|
|
1683
1683
|
"data": map[string]any{
|
|
1684
1684
|
"value": "soha_sat_rotated",
|
|
1685
|
-
"token": map[string]any{
|
|
1685
|
+
"token": map[string]any{ // #nosec G101 -- Synthetic token metadata in an httptest response, not a usable credential.
|
|
1686
1686
|
"id": "sat-rotated",
|
|
1687
1687
|
"serviceAccountId": "svc-1",
|
|
1688
1688
|
"name": "rotated service token",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package sohaapi
|
|
2
|
+
|
|
3
|
+
import "testing"
|
|
4
|
+
|
|
5
|
+
func TestDeliveryServiceKindPublishedNamesRemainUsable(t *testing.T) {
|
|
6
|
+
values := []DeliveryDraftServiceServiceKind{ExternalService, HelmRelease, Job, KubernetesWorkload}
|
|
7
|
+
for _, value := range values {
|
|
8
|
+
if !value.Valid() {
|
|
9
|
+
t.Errorf("published service kind %q is invalid", value)
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
package sohaapi
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"encoding/json"
|
|
5
|
+
"strings"
|
|
6
|
+
"testing"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
func TestMonitoringDTOsKeepNullAndZeroDistinct(t *testing.T) {
|
|
10
|
+
var nullPoint, zeroPoint ResourceMonitoringPoint
|
|
11
|
+
if err := json.Unmarshal([]byte(`{"value":null}`), &nullPoint); err != nil {
|
|
12
|
+
t.Fatal(err)
|
|
13
|
+
}
|
|
14
|
+
if err := json.Unmarshal([]byte(`{"value":0}`), &zeroPoint); err != nil {
|
|
15
|
+
t.Fatal(err)
|
|
16
|
+
}
|
|
17
|
+
if nullPoint.Value != nil || zeroPoint.Value == nil || *zeroPoint.Value != 0 {
|
|
18
|
+
t.Fatal("null sample became zero")
|
|
19
|
+
}
|
|
20
|
+
var quantity ResourceMonitoringQuantity
|
|
21
|
+
if err := json.Unmarshal([]byte(`{"cpuCores":null,"memoryBytes":0,"podSlots":null}`), &quantity); err != nil {
|
|
22
|
+
t.Fatal(err)
|
|
23
|
+
}
|
|
24
|
+
if quantity.CPUCores != nil || quantity.MemoryBytes == nil || *quantity.MemoryBytes != 0 {
|
|
25
|
+
t.Fatal("nullable capacity lost")
|
|
26
|
+
}
|
|
27
|
+
zero := int64(0)
|
|
28
|
+
edge := KubernetesTopologyGraphEdge{Weight: &zero}
|
|
29
|
+
raw, err := json.Marshal(edge)
|
|
30
|
+
if err != nil || !strings.Contains(string(raw), `"weight":0`) {
|
|
31
|
+
t.Fatalf("zero weight omitted: %s %v", raw, err)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
func TestPublishedCacheEnumNamesRemainSourceCompatible(t *testing.T) {
|
|
35
|
+
values := []string{
|
|
36
|
+
string(LLMCallLogCacheStatusBypass), string(LLMCallLogCacheStatusHit), string(LLMCallLogCacheStatusMiss), string(LLMCallLogCacheStatusStaleHit), string(LLMCallLogCacheStatusWrite), string(LLMCallLogCacheStatusWriteSkipped),
|
|
37
|
+
string(CreateAIGatewayAnthropicMessageParamsXSohaCacheModeBypass),
|
|
38
|
+
string(CreateAIGatewayCohereRerankParamsXSohaCacheModeBypass),
|
|
39
|
+
string(CreateAIGatewayGeminiGenerateContentParamsXSohaCacheModeBypass),
|
|
40
|
+
string(CreateAIGatewayGeminiInteractionsParamsXSohaCacheModeBypass),
|
|
41
|
+
string(CreateAIGatewayGeminiStreamGenerateContentParamsXSohaCacheModeBypass),
|
|
42
|
+
string(CreateAIGatewayOpenAIAudioSpeechParamsXSohaCacheModeBypass),
|
|
43
|
+
string(CreateAIGatewayOpenAIAudioTranscriptionParamsXSohaCacheModeBypass),
|
|
44
|
+
string(CreateAIGatewayOpenAIAudioTranslationParamsXSohaCacheModeBypass),
|
|
45
|
+
string(CreateAIGatewayOpenAIChatCompletionParamsXSohaCacheModeBypass),
|
|
46
|
+
string(CreateAIGatewayOpenAICompatibleProviderAudioSpeechParamsXSohaCacheModeBypass),
|
|
47
|
+
string(CreateAIGatewayOpenAICompatibleProviderAudioTranscriptionParamsXSohaCacheModeBypass),
|
|
48
|
+
string(CreateAIGatewayOpenAICompatibleProviderAudioTranslationParamsXSohaCacheModeBypass),
|
|
49
|
+
string(CreateAIGatewayOpenAICompatibleProviderChatCompletionParamsXSohaCacheModeBypass),
|
|
50
|
+
string(CreateAIGatewayOpenAICompatibleProviderEmbeddingParamsXSohaCacheModeBypass),
|
|
51
|
+
string(CreateAIGatewayOpenAICompatibleProviderImageEditParamsXSohaCacheModeBypass),
|
|
52
|
+
string(CreateAIGatewayOpenAICompatibleProviderImageGenerationParamsXSohaCacheModeBypass),
|
|
53
|
+
string(CreateAIGatewayOpenAICompatibleProviderImageVariationParamsXSohaCacheModeBypass),
|
|
54
|
+
string(CreateAIGatewayOpenAICompatibleProviderResponseParamsXSohaCacheModeBypass),
|
|
55
|
+
string(CreateAIGatewayOpenAIEmbeddingParamsXSohaCacheModeBypass),
|
|
56
|
+
string(CreateAIGatewayOpenAIImageEditParamsXSohaCacheModeBypass),
|
|
57
|
+
string(CreateAIGatewayOpenAIImageGenerationParamsXSohaCacheModeBypass),
|
|
58
|
+
string(CreateAIGatewayOpenAIImageVariationParamsXSohaCacheModeBypass),
|
|
59
|
+
string(CreateAIGatewayOpenAIResponseParamsXSohaCacheModeBypass),
|
|
60
|
+
string(SohaCacheModeHeaderBypass),
|
|
61
|
+
}
|
|
62
|
+
for _, value := range values {
|
|
63
|
+
if value == "" {
|
|
64
|
+
t.Fatal("empty published enum")
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|