@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.
Files changed (137) hide show
  1. package/COMPATIBILITY.md +24 -0
  2. package/README.md +1 -1
  3. package/agent/environment/export.go +1 -0
  4. package/agent/environment/protocol_test.go +1 -1
  5. package/agent/guest/protocol_test.go +2 -2
  6. package/auth/catalog_generated.go +2 -2
  7. package/auth/gateway_permissions_test.go +48 -0
  8. package/auth/permission-catalog.json +300 -1
  9. package/compat/consumer-revisions.json +1 -1
  10. package/compat/json-schema-ecosystem-0.1.0.json +1 -1
  11. package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
  12. package/delivery/document.schema.json +127 -9
  13. package/examples/relations_compat_test.go +18 -0
  14. package/fixtures/openapi/DeliveryDocument/invalid/migration-missing-guide-build-template.json +30 -0
  15. package/fixtures/openapi/DeliveryDocument/invalid/migration-missing-guide-deployment-template.json +30 -0
  16. package/fixtures/openapi/DeliveryDocument/invalid/migration-missing-guide-workflow-template.json +27 -0
  17. package/fixtures/openapi/DeliveryDocument/valid/migration-build-template.json +31 -0
  18. package/fixtures/openapi/DeliveryDocument/valid/migration-deployment-template.json +31 -0
  19. package/fixtures/openapi/DeliveryDocument/valid/migration-workflow-template.json +28 -0
  20. package/fixtures/openapi/DeliveryPlanInput/invalid/manual-plan.json +7 -0
  21. package/fixtures/openapi/DeliveryPlanInput/valid/manual-plan.json +6 -0
  22. package/fixtures/openapi/DeliveryTargetInput/invalid/candidate-on-runtime-deploy.json +9 -0
  23. package/fixtures/openapi/DeliveryTargetInput/invalid/config-update-missing-service.json +7 -0
  24. package/fixtures/openapi/DeliveryTargetInput/valid/template-configuration-only.json +8 -0
  25. package/fixtures/openapi/DeliveryTargetInput/valid/template-configuration-without-runtime-environment.json +1 -0
  26. package/fixtures/openapi/KubernetesAgentActionCheck/invalid/unproven-state.json +6 -0
  27. package/fixtures/openapi/KubernetesAgentActionCheck/valid/configured-denied.json +9 -0
  28. package/fixtures/openapi/KubernetesAgentActionProfile/invalid/wildcard.json +1 -0
  29. package/fixtures/openapi/KubernetesAgentActionProfile/valid/workbench.json +1 -0
  30. package/fixtures/openapi/KubernetesClusterRegistrationRequest/invalid/action-profile.json +3 -0
  31. package/fixtures/openapi/KubernetesClusterRegistrationRequest/valid/action-profile.json +5 -0
  32. package/fixtures/openapi/KubernetesImportCandidateListEnvelope/invalid/source-with-spec.json +33 -0
  33. package/fixtures/openapi/KubernetesImportCandidateListEnvelope/invalid/source-without-uid.json +29 -0
  34. package/fixtures/openapi/KubernetesImportCandidateListEnvelope/valid/stable-source.json +30 -0
  35. package/fixtures/openapi/KubernetesNodeListEnvelope/invalid/condition-status-boolean.json +17 -0
  36. package/fixtures/openapi/KubernetesNodeListEnvelope/invalid/taint-effect-missing.json +16 -0
  37. package/fixtures/openapi/KubernetesNodeListEnvelope/valid/legacy-fields-absent.json +11 -0
  38. package/fixtures/openapi/KubernetesNodeListEnvelope/valid/no-taints.json +13 -0
  39. package/fixtures/openapi/KubernetesNodeListEnvelope/valid/ready-cordoned-tainted.json +28 -0
  40. package/fixtures/openapi/KubernetesNodeListEnvelope/valid/unknown-fields-null.json +13 -0
  41. package/fixtures/openapi/KubernetesPod/invalid/pod-uid.json +9 -0
  42. package/fixtures/openapi/KubernetesPod/valid/pod-uid.json +9 -0
  43. package/fixtures/openapi/KubernetesPodDetail/invalid/pod-uid.json +6 -0
  44. package/fixtures/openapi/KubernetesPodDetail/valid/pod-uid.json +6 -0
  45. package/fixtures/openapi/KubernetesServiceImportRequest/invalid/empty-source-uid.json +48 -0
  46. package/fixtures/openapi/KubernetesServiceImportRequest/valid/pinned-workloads-and-cr.json +48 -0
  47. package/fixtures/openapi/KubernetesTopologyCoverage/invalid/empty-as-success.json +5 -0
  48. package/fixtures/openapi/KubernetesTopologyCoverage/valid/not-installed.json +6 -0
  49. package/fixtures/openapi/KubernetesTopologyGraphEdge/invalid/negative-weight.json +8 -0
  50. package/fixtures/openapi/KubernetesTopologyGraphEdge/valid/zero-weight.json +20 -0
  51. package/fixtures/openapi/KubernetesTopologyGraphNode/invalid/fake-flow-kind.json +42 -0
  52. package/fixtures/openapi/KubernetesTopologyGraphNode/valid/rule.json +42 -0
  53. package/fixtures/openapi/KubernetesTopologySnapshot/invalid/raw-source-field.json +33 -0
  54. package/fixtures/openapi/KubernetesTopologySnapshot/valid/projected-source.json +32 -0
  55. package/fixtures/openapi/KubernetesTopologySnapshotRequest/invalid/arbitrary-gvr.json +8 -0
  56. package/fixtures/openapi/KubernetesTopologySnapshotRequest/valid/bounded-sources.json +11 -0
  57. package/fixtures/openapi/KubernetesTopologySourceQuery/invalid/cluster-namespace.json +4 -0
  58. package/fixtures/openapi/KubernetesTopologySourceQuery/valid/all-namespaces.json +4 -0
  59. package/fixtures/openapi/ManifestExecutionTaskPayload/invalid/initialization.json +7 -0
  60. package/fixtures/openapi/ManifestExecutionTaskPayload/valid/initialization.json +7 -0
  61. package/fixtures/openapi/ManifestRootResource/invalid/root.json +1 -0
  62. package/fixtures/openapi/ManifestRootResource/valid/root.json +1 -0
  63. package/fixtures/openapi/ResourceMonitoringPanel/invalid/unknown-quality.json +7 -0
  64. package/fixtures/openapi/ResourceMonitoringPanel/valid/not-collected.json +7 -0
  65. package/fixtures/openapi/ResourceMonitoringPoint/invalid/string-zero.json +4 -0
  66. package/fixtures/openapi/ResourceMonitoringPoint/valid/missing.json +4 -0
  67. package/fixtures/openapi/ResourceMonitoringPoint/valid/zero.json +4 -0
  68. package/fixtures/openapi/ResourceMonitoringView/invalid/raw-query.json +12 -0
  69. package/fixtures/openapi/ResourceMonitoringView/valid/unconfigured.json +12 -0
  70. package/fixtures/openapi/ResourceRelationConfig/invalid/executable-rule.json +17 -0
  71. package/fixtures/openapi/ResourceRelationConfig/valid/unknown-kind.json +13 -0
  72. package/fixtures/openapi/ServiceDeploymentTemplateInput/invalid/migration-missing-guide-valid-yaml.json +38 -0
  73. package/fixtures/openapi/ServiceDeploymentTemplateInput/valid/migration-valid-yaml.json +39 -0
  74. package/fixtures/openapi/TemplateMigrationAssessment/invalid/initialization.json +9 -0
  75. package/fixtures/openapi/TemplateMigrationAssessment/valid/initialization.json +9 -0
  76. package/fixtures/openapi/TemplateMigrationPolicy/invalid/blank-guide.json +5 -0
  77. package/fixtures/openapi/TemplateMigrationPolicy/invalid/missing-guide.json +4 -0
  78. package/fixtures/openapi/TemplateMigrationPolicy/invalid/unknown-escape-hatch.json +6 -0
  79. package/fixtures/openapi/TemplateMigrationPolicy/valid/legacy-safe.json +4 -0
  80. package/fixtures/openapi/TemplateMigrationPolicy/valid/ordered-data-change.json +5 -0
  81. package/fixtures/openapi/TemplateUpdateBatchInput/invalid/duplicate-candidates.json +11 -0
  82. package/fixtures/openapi/TemplateUpdateBatchInput/invalid/empty-identities.json +10 -0
  83. package/fixtures/openapi/TemplateUpdateBatchInput/valid/staged-adoption.json +10 -0
  84. package/fixtures/openapi/TemplateUpdatePolicyInput/invalid/unknown-mode.json +8 -0
  85. package/fixtures/openapi/TemplateUpdatePolicyInput/valid/explicit-automatic.json +8 -0
  86. package/fixtures/openapi/TemplateUpdatePreviewInput/invalid/empty-identities.json +10 -0
  87. package/fixtures/openapi/TemplateUpdatePreviewInput/invalid/empty-targets.json +6 -0
  88. package/fixtures/openapi/TemplateUpdatePreviewInput/valid/cross-version-manual.json +14 -0
  89. package/gen/go/sohaapi/client.go +1 -1
  90. package/gen/go/sohaapi/client_test.go +2 -2
  91. package/gen/go/sohaapi/import_source_compat_test.go +12 -0
  92. package/gen/go/sohaapi/kubernetes_monitoring_test.go +67 -0
  93. package/gen/go/sohaapi/types.go +2210 -387
  94. package/gen/ts/sohaapi/index.ts +1862 -5
  95. package/go.mod +2 -2
  96. package/helmrelease/delivery.go +4 -1
  97. package/helmrelease/initialization.go +10 -0
  98. package/helmrelease/runtime/delivery.go +40 -10
  99. package/helmrelease/runtime/delivery_test.go +4 -0
  100. package/helmrelease/runtime/initialization.go +186 -0
  101. package/helmrelease/runtime/initialization_test.go +203 -0
  102. package/openapi/soha-api.json +5514 -1179
  103. package/openapi/soha-api.yaml +1080 -11
  104. package/openapi/spec_generated.go +3 -3
  105. package/openapi/spec_test.go +76 -0
  106. package/package.json +1 -1
  107. package/resource/agent_access.go +12 -0
  108. package/resource/agent_profiles.go +62 -0
  109. package/resource/agent_profiles_test.go +36 -0
  110. package/resource/kubernetes_kinds.go +73 -0
  111. package/resource/kubernetes_kinds_test.go +38 -0
  112. package/resource/models.go +25 -14
  113. package/resource/network_topology.go +166 -0
  114. package/resource/network_topology_projection.go +208 -0
  115. package/resource/network_topology_projection_test.go +53 -0
  116. package/resource/network_topology_test.go +51 -0
  117. package/resource/network_topology_validation.go +29 -0
  118. package/resource/node_drain.go +34 -0
  119. package/resource/relations.go +225 -0
  120. package/resource/relations_test.go +47 -0
  121. package/resource/resource_monitoring.go +99 -0
  122. package/resource/root_cr.go +38 -0
  123. package/resource/runtime/argocd_integration_test.go +1 -1
  124. package/resource/runtime/initialization.go +66 -0
  125. package/resource/runtime/initialization_test.go +80 -0
  126. package/resource/runtime/network_topology.go +232 -0
  127. package/resource/runtime/network_topology_test.go +62 -0
  128. package/resource/runtime/node_drain.go +124 -0
  129. package/resource/runtime/node_drain_test.go +95 -0
  130. package/resource/runtime/relations.go +161 -0
  131. package/resource/runtime/relations_test.go +100 -0
  132. package/resource/runtime/resource_edit.go +128 -0
  133. package/resource/runtime/resource_edit_test.go +183 -0
  134. package/resource/runtime/resource_monitoring.go +243 -0
  135. package/resource/runtime/resource_monitoring_test.go +88 -0
  136. package/resource/runtime/root_cr.go +79 -0
  137. package/resource/runtime/root_cr_test.go +118 -0
@@ -0,0 +1,10 @@
1
+ {
2
+ "previewDigest": "sha256:abc",
3
+ "candidateIds": [
4
+ "candidate-1"
5
+ ],
6
+ "waveSize": 2,
7
+ "stopOnFailure": true,
8
+ "acknowledgeHistoryGaps": false,
9
+ "idempotencyKey": "manual-1"
10
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "kind": "deployment",
3
+ "templateId": "web-template",
4
+ "targetId": "binding-test",
5
+ "mode": "latest",
6
+ "paused": false,
7
+ "expectedVersion": 0
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "kind": "deployment",
3
+ "templateId": "web-template",
4
+ "targetId": "binding-test",
5
+ "mode": "automatic",
6
+ "paused": false,
7
+ "expectedVersion": 0
8
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "kind": "deployment",
3
+ "templateId": "",
4
+ "toVersion": 4,
5
+ "targets": [
6
+ {
7
+ "targetId": ""
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "kind": "deployment",
3
+ "templateId": "web-template",
4
+ "toVersion": 4,
5
+ "targets": []
6
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "kind": "deployment",
3
+ "templateId": "web-template",
4
+ "toVersion": 4,
5
+ "targets": [
6
+ {
7
+ "targetId": "binding-test",
8
+ "wave": 0,
9
+ "useNewDefaults": [
10
+ "replicas"
11
+ ]
12
+ }
13
+ ]
14
+ }
@@ -16,7 +16,7 @@ import (
16
16
  "time"
17
17
  )
18
18
 
19
- const defaultUserAgent = "opensoha-contracts/0.1.24"
19
+ const defaultUserAgent = "opensoha-contracts/0.1.26"
20
20
 
21
21
  type Client struct {
22
22
  BaseURL string
@@ -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
+ }