@opensoha/contracts 0.1.19 → 0.1.21
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/permission-catalog.json +81 -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/json-schema/network-ingest-event/invalid/proxy-runtime-negative-total.json +19 -0
- package/fixtures/json-schema/network-ingest-event/valid/proxy-runtime-sample.json +20 -0
- package/fixtures/json-schema/proxy-runtime/invalid/v2ray-connection-snapshot.json +10 -0
- package/fixtures/json-schema/proxy-runtime/valid/mihomo-observation.json +16 -0
- package/fixtures/openapi/AgentPrometheusQueryRequest/invalid/basic.json +5 -0
- package/fixtures/openapi/AgentPrometheusQueryRequest/invalid/missing-range-fields.json +5 -0
- package/fixtures/openapi/AgentPrometheusQueryRequest/invalid/zero-start.json +8 -0
- package/fixtures/openapi/AgentPrometheusQueryRequest/valid/basic.json +8 -0
- package/fixtures/openapi/AgentPrometheusQueryRequest/valid/instant.json +5 -0
- package/fixtures/openapi/ClusterAgentUpgradeInput/invalid/image.json +1 -0
- package/fixtures/openapi/ClusterAgentUpgradeInput/invalid/missing.json +1 -0
- package/fixtures/openapi/ClusterAgentUpgradeInput/invalid/mutable-tag.json +1 -0
- package/fixtures/openapi/ClusterAgentUpgradeInput/valid/stable.json +1 -0
- package/fixtures/openapi/ClusterAgentUpgradeInput/valid/unprefixed.json +1 -0
- package/fixtures/openapi/KubernetesAgentCustomResourceRule/invalid/basic.json +9 -0
- package/fixtures/openapi/KubernetesAgentCustomResourceRule/valid/basic.json +14 -0
- package/fixtures/openapi/KubernetesAgentCustomResourceRule/valid/dns-names.json +1 -0
- package/fixtures/openapi/KubernetesClusterRegistrationRequest/invalid/basic.json +4 -0
- package/fixtures/openapi/KubernetesClusterRegistrationRequest/valid/basic.json +6 -0
- package/fixtures/openapi/KubernetesConfigMapDataInput/invalid/basic.json +5 -0
- package/fixtures/openapi/KubernetesConfigMapDataInput/valid/basic.json +8 -0
- package/fixtures/openapi/KubernetesCronJobSuspendInput/invalid/basic.json +3 -0
- package/fixtures/openapi/KubernetesCronJobSuspendInput/valid/basic.json +3 -0
- package/fixtures/openapi/KubernetesCustomResourceAccess/invalid/basic.json +5 -0
- package/fixtures/openapi/KubernetesCustomResourceAccess/valid/basic.json +6 -0
- package/fixtures/openapi/KubernetesCustomResourceDefinition/invalid/empty-uid.json +1 -0
- package/fixtures/openapi/KubernetesCustomResourceDefinition/valid/deleting-definition.json +1 -0
- package/fixtures/openapi/KubernetesNamespaceCreateInput/invalid/basic.json +1 -0
- package/fixtures/openapi/KubernetesNamespaceCreateInput/valid/basic.json +1 -0
- package/fixtures/openapi/KubernetesNodeDrainInput/invalid/basic.json +3 -0
- package/fixtures/openapi/KubernetesNodeDrainInput/valid/basic.json +3 -0
- package/fixtures/openapi/KubernetesNodeSchedulabilityInput/invalid/basic.json +1 -0
- package/fixtures/openapi/KubernetesNodeSchedulabilityInput/valid/basic.json +3 -0
- package/fixtures/openapi/KubernetesResourceUpdatePlanRequest/valid/range-kind.json +5 -0
- package/fixtures/openapi/KubernetesResourceYaml/valid/range-kind.json +5 -0
- package/fixtures/openapi/KubernetesSecretDataInput/invalid/basic.json +5 -0
- package/fixtures/openapi/KubernetesSecretDataInput/valid/basic.json +5 -0
- package/fixtures/openapi/NetworkProxyConfigurationInput/invalid/empty-content.json +1 -0
- package/fixtures/openapi/NetworkProxyConfigurationInput/valid/enabled.json +1 -0
- package/fixtures/openapi/NetworkProxyInstanceInput/invalid/unknown-engine.json +1 -0
- package/fixtures/openapi/NetworkProxyInstanceInput/valid/mihomo.json +1 -0
- package/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/client_test.go +25 -0
- package/gen/go/sohaapi/types.go +122 -24
- package/gen/ts/sohaapi/index.ts +266 -1
- package/go.mod +4 -4
- package/go.sum +4 -4
- package/network/README.md +12 -0
- package/network/network-ingest-event.schema.json +21 -3
- package/network/network-runtime-protocol.schema.json +2 -2
- package/network/proxy-runtime.schema.json +113 -0
- package/network/schema.go +7 -0
- package/openapi/soha-api.json +938 -4
- package/openapi/soha-api.yaml +389 -3
- package/openapi/spec_generated.go +3 -3
- package/package.json +2 -1
- package/resource/agent_access.go +23 -0
- package/resource/models.go +2 -0
|
@@ -6,8 +6,8 @@ import _ "embed"
|
|
|
6
6
|
|
|
7
7
|
const (
|
|
8
8
|
PermissionCatalogVersion = "2.0.0"
|
|
9
|
-
PermissionCatalogContentSHA256 = "
|
|
10
|
-
PermissionCatalogSHA256 = "
|
|
9
|
+
PermissionCatalogContentSHA256 = "be2c1caf05e680f75b40e6ce017e55f1c35f7977cf045ca3ec562adbd6cb37dc"
|
|
10
|
+
PermissionCatalogSHA256 = "2822fab5a3963270e806884ce46402bb42f3384d5530e6ae0acc8bf253811de5"
|
|
11
11
|
)
|
|
12
12
|
|
|
13
13
|
//go:embed permission-catalog.json
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": "authorization.opensoha.io/v1",
|
|
3
3
|
"catalogVersion": "2.0.0",
|
|
4
|
-
"contentHash": "sha256:
|
|
4
|
+
"contentHash": "sha256:be2c1caf05e680f75b40e6ce017e55f1c35f7977cf045ca3ec562adbd6cb37dc",
|
|
5
5
|
"permissions": [
|
|
6
6
|
{
|
|
7
7
|
"key": "access.directory.create",
|
|
@@ -4998,6 +4998,86 @@
|
|
|
4998
4998
|
"status": "active",
|
|
4999
4999
|
"assignable": true
|
|
5000
5000
|
},
|
|
5001
|
+
{
|
|
5002
|
+
"key": "network_access.proxy_connections.close",
|
|
5003
|
+
"domain": "network_access",
|
|
5004
|
+
"resource": "proxy_connections",
|
|
5005
|
+
"action": "close",
|
|
5006
|
+
"displayName": "断开代理连接",
|
|
5007
|
+
"riskLevel": "high",
|
|
5008
|
+
"scopeKinds": [
|
|
5009
|
+
"tenant",
|
|
5010
|
+
"workspace",
|
|
5011
|
+
"resource"
|
|
5012
|
+
],
|
|
5013
|
+
"approvalPolicy": "eligible",
|
|
5014
|
+
"status": "active",
|
|
5015
|
+
"assignable": true
|
|
5016
|
+
},
|
|
5017
|
+
{
|
|
5018
|
+
"key": "network_access.proxy_connections.view",
|
|
5019
|
+
"domain": "network_access",
|
|
5020
|
+
"resource": "proxy_connections",
|
|
5021
|
+
"action": "view",
|
|
5022
|
+
"displayName": "查看代理连接详情",
|
|
5023
|
+
"riskLevel": "read",
|
|
5024
|
+
"scopeKinds": [
|
|
5025
|
+
"tenant",
|
|
5026
|
+
"workspace",
|
|
5027
|
+
"resource"
|
|
5028
|
+
],
|
|
5029
|
+
"approvalPolicy": "never",
|
|
5030
|
+
"status": "active",
|
|
5031
|
+
"assignable": true
|
|
5032
|
+
},
|
|
5033
|
+
{
|
|
5034
|
+
"key": "network_access.proxy_instances.create",
|
|
5035
|
+
"domain": "network_access",
|
|
5036
|
+
"resource": "proxy_instances",
|
|
5037
|
+
"action": "create",
|
|
5038
|
+
"displayName": "创建代理实例",
|
|
5039
|
+
"riskLevel": "high",
|
|
5040
|
+
"scopeKinds": [
|
|
5041
|
+
"tenant",
|
|
5042
|
+
"workspace",
|
|
5043
|
+
"resource"
|
|
5044
|
+
],
|
|
5045
|
+
"approvalPolicy": "eligible",
|
|
5046
|
+
"status": "active",
|
|
5047
|
+
"assignable": true
|
|
5048
|
+
},
|
|
5049
|
+
{
|
|
5050
|
+
"key": "network_access.proxy_instances.update",
|
|
5051
|
+
"domain": "network_access",
|
|
5052
|
+
"resource": "proxy_instances",
|
|
5053
|
+
"action": "update",
|
|
5054
|
+
"displayName": "更新代理实例配置",
|
|
5055
|
+
"riskLevel": "high",
|
|
5056
|
+
"scopeKinds": [
|
|
5057
|
+
"tenant",
|
|
5058
|
+
"workspace",
|
|
5059
|
+
"resource"
|
|
5060
|
+
],
|
|
5061
|
+
"approvalPolicy": "eligible",
|
|
5062
|
+
"status": "active",
|
|
5063
|
+
"assignable": true
|
|
5064
|
+
},
|
|
5065
|
+
{
|
|
5066
|
+
"key": "network_access.proxy_instances.view",
|
|
5067
|
+
"domain": "network_access",
|
|
5068
|
+
"resource": "proxy_instances",
|
|
5069
|
+
"action": "view",
|
|
5070
|
+
"displayName": "查看代理实例",
|
|
5071
|
+
"riskLevel": "read",
|
|
5072
|
+
"scopeKinds": [
|
|
5073
|
+
"tenant",
|
|
5074
|
+
"workspace",
|
|
5075
|
+
"resource"
|
|
5076
|
+
],
|
|
5077
|
+
"approvalPolicy": "never",
|
|
5078
|
+
"status": "active",
|
|
5079
|
+
"assignable": true
|
|
5080
|
+
},
|
|
5001
5081
|
{
|
|
5002
5082
|
"key": "network_access.resources.create",
|
|
5003
5083
|
"domain": "network_access",
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "network-ingest/v1alpha1",
|
|
3
|
+
"batchId": "proxy-sample-batch-invalid",
|
|
4
|
+
"producerId": "proxy-mihomo",
|
|
5
|
+
"producerKind": "proxy",
|
|
6
|
+
"sentAt": "2026-09-27T08:00:00Z",
|
|
7
|
+
"events": [{
|
|
8
|
+
"id": "proxy-sample-invalid",
|
|
9
|
+
"type": "proxy.runtime.sample",
|
|
10
|
+
"sequence": 1,
|
|
11
|
+
"occurredAt": "2026-09-27T08:00:00Z",
|
|
12
|
+
"payload": {
|
|
13
|
+
"engine": "mihomo",
|
|
14
|
+
"uptimeSeconds": 60,
|
|
15
|
+
"uploadTotal": -1,
|
|
16
|
+
"downloadTotal": 4096
|
|
17
|
+
}
|
|
18
|
+
}]
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "network-ingest/v1alpha1",
|
|
3
|
+
"batchId": "proxy-sample-batch-1",
|
|
4
|
+
"producerId": "proxy-mihomo",
|
|
5
|
+
"producerKind": "proxy",
|
|
6
|
+
"sentAt": "2026-09-27T08:00:00Z",
|
|
7
|
+
"events": [{
|
|
8
|
+
"id": "proxy-sample-1",
|
|
9
|
+
"type": "proxy.runtime.sample",
|
|
10
|
+
"sequence": 1,
|
|
11
|
+
"occurredAt": "2026-09-27T08:00:00Z",
|
|
12
|
+
"payload": {
|
|
13
|
+
"engine": "mihomo",
|
|
14
|
+
"uptimeSeconds": 60,
|
|
15
|
+
"uploadTotal": 1024,
|
|
16
|
+
"downloadTotal": 4096,
|
|
17
|
+
"activeConnections": 2
|
|
18
|
+
}
|
|
19
|
+
}]
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "proxy-runtime/v1alpha1",
|
|
3
|
+
"runtimeId": "proxy-lab-mihomo",
|
|
4
|
+
"messageType": "observation",
|
|
5
|
+
"occurredAt": "2026-09-27T00:00:00Z",
|
|
6
|
+
"payload": {
|
|
7
|
+
"engine": "mihomo",
|
|
8
|
+
"engineVersion": "v1.19.30",
|
|
9
|
+
"health": "healthy",
|
|
10
|
+
"capabilities": ["traffic", "connections", "close_connection"],
|
|
11
|
+
"uptimeSeconds": 60,
|
|
12
|
+
"uploadTotal": 2048,
|
|
13
|
+
"downloadTotal": 4096,
|
|
14
|
+
"activeConnections": 1
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"other.example/agent:latest"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"latest"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"v0.1.7"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"0.1.7"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"apiGroup":"apps--demo.example.io","resources":["widget-sets"],"verbs":["get","list"],"namespaces":["apps"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uid":"","name":"widgets.example.com","group":"example.com","scope":"Namespaced","kind":"Widget","plural":"widgets","ageSeconds":42}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"uid":"crd-uid-1","name":"widgets.example.com","group":"example.com","scope":"Namespaced","kind":"Widget","plural":"widgets","version":"v1","ageSeconds":42,"deletingAt":"2026-09-29T02:00:00Z","allowedActions":["list","delete"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":" "}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name":"team-a","labels":{"environment":"test"}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"expectedRevision":0,"enabled":true,"content":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"expectedRevision":0,"enabled":true,"content":"mixed-port: 7890\nsecret: example-test-secret\n"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"proxy-lab","name":"Proxy Lab","engine":"clash"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"proxy-lab-mihomo","name":"middleware Mihomo","engine":"mihomo","host":"middleware"}
|
package/gen/go/sohaapi/client.go
CHANGED
|
@@ -25,6 +25,31 @@ func TestDeliveryPlanStatusLegacyConstants(t *testing.T) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
func TestRuntimeAndWorkbenchLegacyEnumConstants(t *testing.T) {
|
|
29
|
+
scopes := map[RuntimeNetworkUsageScope]string{
|
|
30
|
+
NetworkNamespace: "network_namespace",
|
|
31
|
+
Process: "process",
|
|
32
|
+
Unavailable: "unavailable",
|
|
33
|
+
}
|
|
34
|
+
for scope, want := range scopes {
|
|
35
|
+
if string(scope) != want || !scope.Valid() {
|
|
36
|
+
t.Fatalf("RuntimeNetworkUsageScope %q is not the compatible value %q", scope, want)
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
statuses := map[WorkbenchAgentStatusEventStatus]string{
|
|
40
|
+
Cancelled: "cancelled",
|
|
41
|
+
Failed: "failed",
|
|
42
|
+
Queued: "queued",
|
|
43
|
+
Running: "running",
|
|
44
|
+
Succeeded: "succeeded",
|
|
45
|
+
}
|
|
46
|
+
for status, want := range statuses {
|
|
47
|
+
if string(status) != want || !status.Valid() {
|
|
48
|
+
t.Fatalf("WorkbenchAgentStatusEventStatus %q is not the compatible value %q", status, want)
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
28
53
|
func TestObservabilityCredentialKeyLegacyTypes(t *testing.T) {
|
|
29
54
|
dataSource := ObservabilityDataSource{
|
|
30
55
|
CredentialKeys: []ObservabilityDataSourceCredentialKeys{
|