@opensoha/contracts 0.1.24 → 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/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/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/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/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/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/kubernetes_monitoring_test.go +67 -0
- package/gen/go/sohaapi/types.go +1265 -228
- package/gen/ts/sohaapi/index.ts +1116 -1
- package/openapi/soha-api.json +2497 -302
- package/openapi/soha-api.yaml +732 -3
- package/openapi/spec_generated.go +3 -3
- package/openapi/spec_test.go +34 -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 +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
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "rule:route-uid:0",
|
|
3
|
+
"type": "rule",
|
|
4
|
+
"label": "api /",
|
|
5
|
+
"provider": "traefik",
|
|
6
|
+
"protocol": "HTTP",
|
|
7
|
+
"resolutionState": "resolved",
|
|
8
|
+
"resource": {
|
|
9
|
+
"clusterId": "cluster-a",
|
|
10
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
11
|
+
"kind": "IngressRoute",
|
|
12
|
+
"name": "api",
|
|
13
|
+
"namespace": "team-a",
|
|
14
|
+
"scopeMode": "namespace",
|
|
15
|
+
"uid": "route-uid",
|
|
16
|
+
"resourceVersion": "7"
|
|
17
|
+
},
|
|
18
|
+
"rule": {
|
|
19
|
+
"index": 0,
|
|
20
|
+
"matchGroups": [
|
|
21
|
+
[
|
|
22
|
+
{
|
|
23
|
+
"type": "host",
|
|
24
|
+
"operator": "exact",
|
|
25
|
+
"value": "api.example.test"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"type": "path",
|
|
29
|
+
"operator": "prefix",
|
|
30
|
+
"value": "/"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
],
|
|
34
|
+
"tlsMode": "terminate"
|
|
35
|
+
},
|
|
36
|
+
"properties": [
|
|
37
|
+
{
|
|
38
|
+
"name": "source",
|
|
39
|
+
"value": "configuration"
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "v1",
|
|
3
|
+
"sources": [
|
|
4
|
+
{
|
|
5
|
+
"coverage": {
|
|
6
|
+
"provider": "traefik",
|
|
7
|
+
"sourceId": "traefik.ingressroutes",
|
|
8
|
+
"state": "available",
|
|
9
|
+
"namespace": "team-a",
|
|
10
|
+
"supportedKinds": [
|
|
11
|
+
"IngressRoute"
|
|
12
|
+
],
|
|
13
|
+
"observedAt": "2026-10-19T02:00:00Z"
|
|
14
|
+
},
|
|
15
|
+
"objects": [
|
|
16
|
+
{
|
|
17
|
+
"resource": {
|
|
18
|
+
"clusterId": "cluster-a",
|
|
19
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
20
|
+
"kind": "IngressRoute",
|
|
21
|
+
"name": "api",
|
|
22
|
+
"namespace": "team-a",
|
|
23
|
+
"scopeMode": "namespace",
|
|
24
|
+
"uid": "route-uid",
|
|
25
|
+
"resourceVersion": "7"
|
|
26
|
+
},
|
|
27
|
+
"content": "{}",
|
|
28
|
+
"originalManifest": "secret configuration must not cross the snapshot contract"
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "v1",
|
|
3
|
+
"sources": [
|
|
4
|
+
{
|
|
5
|
+
"coverage": {
|
|
6
|
+
"provider": "traefik",
|
|
7
|
+
"sourceId": "traefik.ingressroutes",
|
|
8
|
+
"state": "available",
|
|
9
|
+
"namespace": "team-a",
|
|
10
|
+
"supportedKinds": [
|
|
11
|
+
"IngressRoute"
|
|
12
|
+
],
|
|
13
|
+
"observedAt": "2026-10-19T02:00:00Z"
|
|
14
|
+
},
|
|
15
|
+
"objects": [
|
|
16
|
+
{
|
|
17
|
+
"resource": {
|
|
18
|
+
"clusterId": "cluster-a",
|
|
19
|
+
"apiVersion": "traefik.io/v1alpha1",
|
|
20
|
+
"kind": "IngressRoute",
|
|
21
|
+
"name": "api",
|
|
22
|
+
"namespace": "team-a",
|
|
23
|
+
"scopeMode": "namespace",
|
|
24
|
+
"uid": "route-uid",
|
|
25
|
+
"resourceVersion": "7"
|
|
26
|
+
},
|
|
27
|
+
"content": "{\"spec\": {\"routes\": [{\"match\": \"Host(`api.example.test`)\", \"services\": [{\"name\": \"api\", \"port\": 80}]}]}}"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"clusterId": "c",
|
|
3
|
+
"view": "raw",
|
|
4
|
+
"from": "2026-10-18T23:00:00Z",
|
|
5
|
+
"to": "2026-10-19T00:00:00Z",
|
|
6
|
+
"stepSeconds": 60,
|
|
7
|
+
"generatedAt": "2026-10-19T00:00:00Z",
|
|
8
|
+
"snapshotQuality": "partial",
|
|
9
|
+
"unscheduledPendingPods": null,
|
|
10
|
+
"nodes": [],
|
|
11
|
+
"panels": []
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"clusterId": "c",
|
|
3
|
+
"view": "overview",
|
|
4
|
+
"from": "2026-10-18T23:00:00Z",
|
|
5
|
+
"to": "2026-10-19T00:00:00Z",
|
|
6
|
+
"stepSeconds": 60,
|
|
7
|
+
"generatedAt": "2026-10-19T00:00:00Z",
|
|
8
|
+
"snapshotQuality": "partial",
|
|
9
|
+
"unscheduledPendingPods": null,
|
|
10
|
+
"nodes": [],
|
|
11
|
+
"panels": []
|
|
12
|
+
}
|
package/gen/go/sohaapi/client.go
CHANGED
|
@@ -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
|
+
}
|