@opensoha/contracts 0.1.20 → 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.
Files changed (32) hide show
  1. package/auth/catalog_generated.go +2 -2
  2. package/auth/permission-catalog.json +81 -1
  3. package/compat/json-schema-ecosystem-0.1.0.json +1 -1
  4. package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
  5. package/fixtures/json-schema/network-ingest-event/invalid/proxy-runtime-negative-total.json +19 -0
  6. package/fixtures/json-schema/network-ingest-event/valid/proxy-runtime-sample.json +20 -0
  7. package/fixtures/json-schema/proxy-runtime/invalid/v2ray-connection-snapshot.json +10 -0
  8. package/fixtures/json-schema/proxy-runtime/valid/mihomo-observation.json +16 -0
  9. package/fixtures/openapi/KubernetesCustomResourceDefinition/invalid/empty-uid.json +1 -0
  10. package/fixtures/openapi/KubernetesCustomResourceDefinition/valid/deleting-definition.json +1 -0
  11. package/fixtures/openapi/KubernetesResourceUpdatePlanRequest/valid/range-kind.json +5 -0
  12. package/fixtures/openapi/KubernetesResourceYaml/valid/range-kind.json +5 -0
  13. package/fixtures/openapi/NetworkProxyConfigurationInput/invalid/empty-content.json +1 -0
  14. package/fixtures/openapi/NetworkProxyConfigurationInput/valid/enabled.json +1 -0
  15. package/fixtures/openapi/NetworkProxyInstanceInput/invalid/unknown-engine.json +1 -0
  16. package/fixtures/openapi/NetworkProxyInstanceInput/valid/mihomo.json +1 -0
  17. package/gen/go/sohaapi/client.go +1 -1
  18. package/gen/go/sohaapi/client_test.go +25 -0
  19. package/gen/go/sohaapi/types.go +40 -11
  20. package/gen/ts/sohaapi/index.ts +264 -156
  21. package/go.mod +4 -4
  22. package/go.sum +4 -4
  23. package/network/README.md +12 -0
  24. package/network/network-ingest-event.schema.json +21 -3
  25. package/network/network-runtime-protocol.schema.json +2 -2
  26. package/network/proxy-runtime.schema.json +113 -0
  27. package/network/schema.go +7 -0
  28. package/openapi/soha-api.json +412 -4
  29. package/openapi/soha-api.yaml +381 -251
  30. package/openapi/spec_generated.go +3 -3
  31. package/package.json +2 -1
  32. package/resource/models.go +2 -0
@@ -19569,6 +19569,56 @@ export interface components {
19569
19569
  usesInformerCache: boolean;
19570
19570
  customResourceRules?: components["schemas"]["KubernetesAgentCustomResourceRule"][];
19571
19571
  };
19572
+ KubernetesCustomResourceAccess: {
19573
+ allowedActions: ("list" | "view" | "create" | "update" | "delete")[];
19574
+ };
19575
+ KubernetesCustomResourceAccessEnvelope: {
19576
+ data: components["schemas"]["KubernetesCustomResourceAccess"];
19577
+ };
19578
+ KubernetesClusterRegistrationRequest: {
19579
+ id?: string;
19580
+ name?: string;
19581
+ region?: string;
19582
+ environment?: string;
19583
+ labels?: {
19584
+ [key: string]: string;
19585
+ };
19586
+ connectionMode?: components["schemas"]["KubernetesConnectionMode"];
19587
+ kubeconfig?: string;
19588
+ context?: string;
19589
+ agentEndpoint?: string;
19590
+ agentToken?: string;
19591
+ prometheusBaseUrl?: string;
19592
+ prometheusBearerToken?: string;
19593
+ prometheusClusterLabel?: string;
19594
+ grafanaBaseUrl?: string;
19595
+ prometheusTransport?: components["schemas"]["KubernetesPrometheusTransport"];
19596
+ agentCustomResourceRules?: components["schemas"]["KubernetesAgentCustomResourceRule"][];
19597
+ };
19598
+ KubernetesAgentCustomResourceRule: {
19599
+ apiGroup: string;
19600
+ resources: string[];
19601
+ verbs: ("get" | "list" | "watch" | "create" | "update" | "patch" | "delete")[];
19602
+ /** @description Explicit namespaces; omitted or empty grants cluster-wide access to the named resources only. */
19603
+ namespaces?: string[];
19604
+ };
19605
+ /**
19606
+ * @default direct
19607
+ * @enum {string}
19608
+ */
19609
+ KubernetesPrometheusTransport: "direct" | "agent";
19610
+ /** @description Range queries require start, end and step. The runtime also enforces end greater than start, a maximum 24-hour range and at most 11000 intervals. */
19611
+ AgentPrometheusQueryRequest: {
19612
+ endpoint: string;
19613
+ query: string;
19614
+ /** @enum {string} */
19615
+ kind: "instant" | "range";
19616
+ /** Format: int64 */
19617
+ start?: number;
19618
+ /** Format: int64 */
19619
+ end?: number;
19620
+ step?: number;
19621
+ };
19572
19622
  KubernetesPrometheusDetail: {
19573
19623
  baseUrl?: string;
19574
19624
  clusterLabel?: string;
@@ -20258,6 +20308,62 @@ export interface components {
20258
20308
  KubernetesConfigMapListEnvelope: {
20259
20309
  items: components["schemas"]["KubernetesConfigMap"][];
20260
20310
  };
20311
+ KubernetesNamespaceInput: {
20312
+ name?: string;
20313
+ labels?: components["schemas"]["KubernetesStringMap"];
20314
+ annotations?: components["schemas"]["KubernetesStringMap"];
20315
+ };
20316
+ KubernetesNamespaceCreateInput: {
20317
+ name: string;
20318
+ labels?: components["schemas"]["KubernetesStringMap"];
20319
+ annotations?: components["schemas"]["KubernetesStringMap"];
20320
+ };
20321
+ KubernetesNamespaceEnvelope: {
20322
+ data: components["schemas"]["KubernetesNamespace"];
20323
+ };
20324
+ KubernetesNodeUpdateInput: {
20325
+ labels?: components["schemas"]["KubernetesStringMap"];
20326
+ taints?: components["schemas"]["KubernetesNodeTaint"][];
20327
+ };
20328
+ KubernetesNodeSchedulabilityInput: {
20329
+ unschedulable: boolean;
20330
+ };
20331
+ KubernetesNodeDrainInput: {
20332
+ force?: boolean;
20333
+ deleteEmptyDirData?: boolean;
20334
+ /** @default 300 */
20335
+ timeoutSeconds?: number;
20336
+ };
20337
+ KubernetesResourceYamlInput: {
20338
+ content: string;
20339
+ };
20340
+ KubernetesConfigMapDataInput: {
20341
+ data?: components["schemas"]["KubernetesStringMap"];
20342
+ binaryData?: components["schemas"]["KubernetesStringMap"];
20343
+ };
20344
+ /** @description Data values are plain text. The response detail returns Kubernetes Base64-encoded values. */
20345
+ KubernetesSecretDataInput: {
20346
+ data?: components["schemas"]["KubernetesStringMap"];
20347
+ };
20348
+ KubernetesCronJobSuspendInput: {
20349
+ suspend: boolean;
20350
+ };
20351
+ KubernetesSecretDetail: {
20352
+ name: string;
20353
+ namespace: string;
20354
+ labels?: components["schemas"]["KubernetesStringMap"];
20355
+ annotations?: components["schemas"]["KubernetesStringMap"];
20356
+ /** @description Secret data values encoded with standard Base64. Requires secret-data.view. */
20357
+ data?: components["schemas"]["KubernetesStringMap"];
20358
+ immutable: boolean;
20359
+ createdAt?: string;
20360
+ /** Format: int64 */
20361
+ ageSeconds: number;
20362
+ type: string;
20363
+ };
20364
+ KubernetesSecretDetailEnvelope: {
20365
+ data: components["schemas"]["KubernetesSecretDetail"];
20366
+ };
20261
20367
  KubernetesConfigMapDetail: {
20262
20368
  name: string;
20263
20369
  namespace: string;
@@ -21277,6 +21383,9 @@ export interface components {
21277
21383
  data: components["schemas"]["KubernetesIngressClassDetail"];
21278
21384
  };
21279
21385
  KubernetesCustomResourceDefinition: {
21386
+ uid?: string;
21387
+ /** Format: date-time */
21388
+ deletingAt?: string;
21280
21389
  name: string;
21281
21390
  group: string;
21282
21391
  scope: string;
@@ -21664,6 +21773,32 @@ export interface components {
21664
21773
  PlatformOperationSummaryEnvelope: {
21665
21774
  data: components["schemas"]["PlatformOperationSummary"];
21666
21775
  };
21776
+ ClusterAgentUpgradeInput: {
21777
+ /** @description Explicit stable official Agent version, such as v0.1.7. Registry and container identity cannot be overridden. */
21778
+ version: string;
21779
+ };
21780
+ ClusterAgentUpgradeStatus: {
21781
+ /** @description Version reported by the currently connected Agent process. */
21782
+ version: string;
21783
+ /** @description Desired image of the standard Agent Deployment. */
21784
+ image: string;
21785
+ /** @description Agent version bundled with this Core release. */
21786
+ recommendedVersion: string;
21787
+ rolloutStatus: string;
21788
+ message: string;
21789
+ canUpgrade: boolean;
21790
+ upgradeDisabledReason?: string;
21791
+ };
21792
+ ClusterAgentUpgradeStatusEnvelope: {
21793
+ data: components["schemas"]["ClusterAgentUpgradeStatus"];
21794
+ };
21795
+ ClusterAgentUpgradeResult: {
21796
+ previousImage: string;
21797
+ targetImage: string;
21798
+ };
21799
+ ClusterAgentUpgradeResultEnvelope: {
21800
+ data: components["schemas"]["ClusterAgentUpgradeResult"];
21801
+ };
21667
21802
  AgentInstallation: {
21668
21803
  clusterId: string;
21669
21804
  /** Format: uri */
@@ -25557,9 +25692,101 @@ export interface components {
25557
25692
  items: components["schemas"]["NetworkSiteProfileBinding"][];
25558
25693
  };
25559
25694
  /** @enum {string} */
25560
- NetworkRuntimeKind: "endpoint" | "gateway" | "nas";
25695
+ NetworkProxyEngine: "mihomo" | "sing-box" | "v2ray";
25696
+ NetworkProxyInstanceInput: {
25697
+ id: string;
25698
+ name: string;
25699
+ engine: components["schemas"]["NetworkProxyEngine"];
25700
+ host?: string;
25701
+ };
25702
+ /** @enum {string} */
25703
+ NetworkProxyInstanceStatus: "unregistered" | "online" | "degraded" | "offline" | "disabled";
25704
+ /** @enum {string} */
25705
+ NetworkProxyCapability: "traffic" | "connections" | "close_connection";
25706
+ NetworkProxyInstance: {
25707
+ id: string;
25708
+ name: string;
25709
+ engine: components["schemas"]["NetworkProxyEngine"];
25710
+ enabled: boolean;
25711
+ host?: string;
25712
+ engineVersion?: string;
25713
+ status: components["schemas"]["NetworkProxyInstanceStatus"];
25714
+ capabilities: components["schemas"]["NetworkProxyCapability"][];
25715
+ /** Format: int64 */
25716
+ desiredRevision: number;
25717
+ /** Format: int64 */
25718
+ observedRevision: number;
25719
+ /** Format: date-time */
25720
+ lastSeenAt?: string;
25721
+ /** Format: date-time */
25722
+ lastSampleAt?: string;
25723
+ reasonCode?: string;
25724
+ /** Format: date-time */
25725
+ createdAt: string;
25726
+ /** Format: date-time */
25727
+ updatedAt: string;
25728
+ };
25729
+ NetworkProxyInstanceEnvelope: {
25730
+ data: components["schemas"]["NetworkProxyInstance"];
25731
+ };
25732
+ NetworkProxyInstanceListEnvelope: {
25733
+ items: components["schemas"]["NetworkProxyInstance"][];
25734
+ };
25735
+ NetworkProxyConfigurationInput: {
25736
+ /** Format: int64 */
25737
+ expectedRevision: number;
25738
+ enabled: boolean;
25739
+ /** Format: password */
25740
+ content: string;
25741
+ };
25742
+ NetworkProxyTrafficSample: {
25743
+ /** Format: date-time */
25744
+ observedAt: string;
25745
+ /** Format: int64 */
25746
+ uploadTotal: number;
25747
+ /** Format: int64 */
25748
+ downloadTotal: number;
25749
+ uploadBytesPerSecond: number;
25750
+ downloadBytesPerSecond: number;
25751
+ activeConnections?: number;
25752
+ };
25753
+ NetworkProxyTrafficEnvelope: {
25754
+ instanceId: string;
25755
+ supported: boolean;
25756
+ samples: components["schemas"]["NetworkProxyTrafficSample"][];
25757
+ };
25758
+ NetworkProxyConnection: {
25759
+ id: string;
25760
+ destination: string;
25761
+ /** @enum {string} */
25762
+ network: "tcp" | "udp" | "other";
25763
+ /** Format: int64 */
25764
+ uploadBytes: number;
25765
+ /** Format: int64 */
25766
+ downloadBytes: number;
25767
+ /** Format: date-time */
25768
+ startedAt?: string;
25769
+ };
25770
+ NetworkProxyConnectionsEnvelope: {
25771
+ instanceId: string;
25772
+ /** @enum {string} */
25773
+ state: "available" | "unsupported" | "unavailable";
25774
+ /** Format: date-time */
25775
+ observedAt?: string;
25776
+ connections: components["schemas"]["NetworkProxyConnection"][];
25777
+ };
25778
+ NetworkProxyCloseCommandEnvelope: {
25779
+ commandId: string;
25780
+ /** @enum {string} */
25781
+ status: "pending" | "closed" | "not-found" | "failed" | "expired";
25782
+ /** Format: date-time */
25783
+ expiresAt: string;
25784
+ };
25785
+ /** @enum {string} */
25786
+ NetworkRuntimeKind: "endpoint" | "gateway" | "nas" | "proxy";
25561
25787
  /** @enum {string} */
25562
25788
  NetworkRuntimeEnrollmentStatus: "pending" | "consumed" | "revoked";
25789
+ /** @description For proxy runtimes, runtimeId identifies an existing proxy instance and deviceId and subjectId must equal runtimeId. */
25563
25790
  NetworkRuntimeEnrollmentInput: {
25564
25791
  runtimeId: string;
25565
25792
  runtimeKind: components["schemas"]["NetworkRuntimeKind"];
@@ -25877,138 +26104,6 @@ export interface components {
25877
26104
  NetworkPolicyPreviewEnvelope: {
25878
26105
  data: components["schemas"]["NetworkPolicyPreviewResult"];
25879
26106
  };
25880
- KubernetesCustomResourceAccess: {
25881
- allowedActions: ("list" | "view" | "create" | "update" | "delete")[];
25882
- };
25883
- KubernetesCustomResourceAccessEnvelope: {
25884
- data: components["schemas"]["KubernetesCustomResourceAccess"];
25885
- };
25886
- KubernetesClusterRegistrationRequest: {
25887
- id?: string;
25888
- name?: string;
25889
- region?: string;
25890
- environment?: string;
25891
- labels?: {
25892
- [key: string]: string;
25893
- };
25894
- connectionMode?: components["schemas"]["KubernetesConnectionMode"];
25895
- kubeconfig?: string;
25896
- context?: string;
25897
- agentEndpoint?: string;
25898
- agentToken?: string;
25899
- prometheusBaseUrl?: string;
25900
- prometheusBearerToken?: string;
25901
- prometheusClusterLabel?: string;
25902
- grafanaBaseUrl?: string;
25903
- prometheusTransport?: components["schemas"]["KubernetesPrometheusTransport"];
25904
- agentCustomResourceRules?: components["schemas"]["KubernetesAgentCustomResourceRule"][];
25905
- };
25906
- KubernetesAgentCustomResourceRule: {
25907
- apiGroup: string;
25908
- resources: string[];
25909
- verbs: ("get" | "list" | "watch" | "create" | "update" | "patch" | "delete")[];
25910
- /** @description Explicit namespaces; omitted or empty grants cluster-wide access to the named resources only. */
25911
- namespaces?: string[];
25912
- };
25913
- /**
25914
- * @default direct
25915
- * @enum {string}
25916
- */
25917
- KubernetesPrometheusTransport: "direct" | "agent";
25918
- /** @description Range queries require start, end and step. The runtime also enforces end greater than start, a maximum 24-hour range and at most 11000 intervals. */
25919
- AgentPrometheusQueryRequest: {
25920
- endpoint: string;
25921
- query: string;
25922
- /** @enum {string} */
25923
- kind: "instant" | "range";
25924
- /** Format: int64 */
25925
- start?: number;
25926
- /** Format: int64 */
25927
- end?: number;
25928
- step?: number;
25929
- };
25930
- KubernetesNamespaceInput: {
25931
- name?: string;
25932
- labels?: components["schemas"]["KubernetesStringMap"];
25933
- annotations?: components["schemas"]["KubernetesStringMap"];
25934
- };
25935
- KubernetesNamespaceCreateInput: {
25936
- name: string;
25937
- labels?: components["schemas"]["KubernetesStringMap"];
25938
- annotations?: components["schemas"]["KubernetesStringMap"];
25939
- };
25940
- KubernetesNamespaceEnvelope: {
25941
- data: components["schemas"]["KubernetesNamespace"];
25942
- };
25943
- KubernetesNodeUpdateInput: {
25944
- labels?: components["schemas"]["KubernetesStringMap"];
25945
- taints?: components["schemas"]["KubernetesNodeTaint"][];
25946
- };
25947
- KubernetesNodeSchedulabilityInput: {
25948
- unschedulable: boolean;
25949
- };
25950
- KubernetesNodeDrainInput: {
25951
- force?: boolean;
25952
- deleteEmptyDirData?: boolean;
25953
- /** @default 300 */
25954
- timeoutSeconds?: number;
25955
- };
25956
- KubernetesResourceYamlInput: {
25957
- content: string;
25958
- };
25959
- KubernetesConfigMapDataInput: {
25960
- data?: components["schemas"]["KubernetesStringMap"];
25961
- binaryData?: components["schemas"]["KubernetesStringMap"];
25962
- };
25963
- /** @description Data values are plain text. The response detail returns Kubernetes Base64-encoded values. */
25964
- KubernetesSecretDataInput: {
25965
- data?: components["schemas"]["KubernetesStringMap"];
25966
- };
25967
- KubernetesCronJobSuspendInput: {
25968
- suspend: boolean;
25969
- };
25970
- KubernetesSecretDetail: {
25971
- name: string;
25972
- namespace: string;
25973
- labels?: components["schemas"]["KubernetesStringMap"];
25974
- annotations?: components["schemas"]["KubernetesStringMap"];
25975
- /** @description Secret data values encoded with standard Base64. Requires secret-data.view. */
25976
- data?: components["schemas"]["KubernetesStringMap"];
25977
- immutable: boolean;
25978
- createdAt?: string;
25979
- /** Format: int64 */
25980
- ageSeconds: number;
25981
- type: string;
25982
- };
25983
- KubernetesSecretDetailEnvelope: {
25984
- data: components["schemas"]["KubernetesSecretDetail"];
25985
- };
25986
- ClusterAgentUpgradeInput: {
25987
- /** @description Explicit stable official Agent version, such as v0.1.7. Registry and container identity cannot be overridden. */
25988
- version: string;
25989
- };
25990
- ClusterAgentUpgradeStatus: {
25991
- /** @description Version reported by the currently connected Agent process. */
25992
- version: string;
25993
- /** @description Desired image of the standard Agent Deployment. */
25994
- image: string;
25995
- /** @description Agent version bundled with this Core release. */
25996
- recommendedVersion: string;
25997
- rolloutStatus: string;
25998
- message: string;
25999
- canUpgrade: boolean;
26000
- upgradeDisabledReason?: string;
26001
- };
26002
- ClusterAgentUpgradeStatusEnvelope: {
26003
- data: components["schemas"]["ClusterAgentUpgradeStatus"];
26004
- };
26005
- ClusterAgentUpgradeResult: {
26006
- previousImage: string;
26007
- targetImage: string;
26008
- };
26009
- ClusterAgentUpgradeResultEnvelope: {
26010
- data: components["schemas"]["ClusterAgentUpgradeResult"];
26011
- };
26012
26107
  };
26013
26108
  responses: {
26014
26109
  /** @description Stable redacted Identity protocol or management error. */
@@ -27251,6 +27346,12 @@ export type KubernetesClusterListEnvelope = components['schemas']['KubernetesClu
27251
27346
  export type KubernetesCacheResourceDiagnostic = components['schemas']['KubernetesCacheResourceDiagnostic'];
27252
27347
  export type KubernetesClusterDiagnostics = components['schemas']['KubernetesClusterDiagnostics'];
27253
27348
  export type KubernetesClusterConnectionDetail = components['schemas']['KubernetesClusterConnectionDetail'];
27349
+ export type KubernetesCustomResourceAccess = components['schemas']['KubernetesCustomResourceAccess'];
27350
+ export type KubernetesCustomResourceAccessEnvelope = components['schemas']['KubernetesCustomResourceAccessEnvelope'];
27351
+ export type KubernetesClusterRegistrationRequest = components['schemas']['KubernetesClusterRegistrationRequest'];
27352
+ export type KubernetesAgentCustomResourceRule = components['schemas']['KubernetesAgentCustomResourceRule'];
27353
+ export type KubernetesPrometheusTransport = components['schemas']['KubernetesPrometheusTransport'];
27354
+ export type AgentPrometheusQueryRequest = components['schemas']['AgentPrometheusQueryRequest'];
27254
27355
  export type KubernetesPrometheusDetail = components['schemas']['KubernetesPrometheusDetail'];
27255
27356
  export type KubernetesMonitoringDetail = components['schemas']['KubernetesMonitoringDetail'];
27256
27357
  export type KubernetesClusterDetail = components['schemas']['KubernetesClusterDetail'];
@@ -27331,6 +27432,18 @@ export type KubernetesReplicationControllerDetail = components['schemas']['Kuber
27331
27432
  export type KubernetesReplicationControllerDetailEnvelope = components['schemas']['KubernetesReplicationControllerDetailEnvelope'];
27332
27433
  export type KubernetesConfigMap = components['schemas']['KubernetesConfigMap'];
27333
27434
  export type KubernetesConfigMapListEnvelope = components['schemas']['KubernetesConfigMapListEnvelope'];
27435
+ export type KubernetesNamespaceInput = components['schemas']['KubernetesNamespaceInput'];
27436
+ export type KubernetesNamespaceCreateInput = components['schemas']['KubernetesNamespaceCreateInput'];
27437
+ export type KubernetesNamespaceEnvelope = components['schemas']['KubernetesNamespaceEnvelope'];
27438
+ export type KubernetesNodeUpdateInput = components['schemas']['KubernetesNodeUpdateInput'];
27439
+ export type KubernetesNodeSchedulabilityInput = components['schemas']['KubernetesNodeSchedulabilityInput'];
27440
+ export type KubernetesNodeDrainInput = components['schemas']['KubernetesNodeDrainInput'];
27441
+ export type KubernetesResourceYamlInput = components['schemas']['KubernetesResourceYamlInput'];
27442
+ export type KubernetesConfigMapDataInput = components['schemas']['KubernetesConfigMapDataInput'];
27443
+ export type KubernetesSecretDataInput = components['schemas']['KubernetesSecretDataInput'];
27444
+ export type KubernetesCronJobSuspendInput = components['schemas']['KubernetesCronJobSuspendInput'];
27445
+ export type KubernetesSecretDetail = components['schemas']['KubernetesSecretDetail'];
27446
+ export type KubernetesSecretDetailEnvelope = components['schemas']['KubernetesSecretDetailEnvelope'];
27334
27447
  export type KubernetesConfigMapDetail = components['schemas']['KubernetesConfigMapDetail'];
27335
27448
  export type KubernetesConfigMapDetailEnvelope = components['schemas']['KubernetesConfigMapDetailEnvelope'];
27336
27449
  export type KubernetesSecretMetadata = components['schemas']['KubernetesSecretMetadata'];
@@ -27503,6 +27616,11 @@ export type PlatformOperationLog = components['schemas']['PlatformOperationLog']
27503
27616
  export type PlatformOperationLogListEnvelope = components['schemas']['PlatformOperationLogListEnvelope'];
27504
27617
  export type PlatformOperationSummary = components['schemas']['PlatformOperationSummary'];
27505
27618
  export type PlatformOperationSummaryEnvelope = components['schemas']['PlatformOperationSummaryEnvelope'];
27619
+ export type ClusterAgentUpgradeInput = components['schemas']['ClusterAgentUpgradeInput'];
27620
+ export type ClusterAgentUpgradeStatus = components['schemas']['ClusterAgentUpgradeStatus'];
27621
+ export type ClusterAgentUpgradeStatusEnvelope = components['schemas']['ClusterAgentUpgradeStatusEnvelope'];
27622
+ export type ClusterAgentUpgradeResult = components['schemas']['ClusterAgentUpgradeResult'];
27623
+ export type ClusterAgentUpgradeResultEnvelope = components['schemas']['ClusterAgentUpgradeResultEnvelope'];
27506
27624
  export type AgentInstallation = components['schemas']['AgentInstallation'];
27507
27625
  export type AgentInstallationEnvelope = components['schemas']['AgentInstallationEnvelope'];
27508
27626
  export type DockerHostAgentInstallation = components['schemas']['DockerHostAgentInstallation'];
@@ -27980,6 +28098,19 @@ export type NetworkSiteProfileBindingInput = components['schemas']['NetworkSiteP
27980
28098
  export type NetworkSiteProfileBinding = components['schemas']['NetworkSiteProfileBinding'];
27981
28099
  export type NetworkSiteProfileBindingEnvelope = components['schemas']['NetworkSiteProfileBindingEnvelope'];
27982
28100
  export type NetworkSiteProfileBindingListEnvelope = components['schemas']['NetworkSiteProfileBindingListEnvelope'];
28101
+ export type NetworkProxyEngine = components['schemas']['NetworkProxyEngine'];
28102
+ export type NetworkProxyInstanceInput = components['schemas']['NetworkProxyInstanceInput'];
28103
+ export type NetworkProxyInstanceStatus = components['schemas']['NetworkProxyInstanceStatus'];
28104
+ export type NetworkProxyCapability = components['schemas']['NetworkProxyCapability'];
28105
+ export type NetworkProxyInstance = components['schemas']['NetworkProxyInstance'];
28106
+ export type NetworkProxyInstanceEnvelope = components['schemas']['NetworkProxyInstanceEnvelope'];
28107
+ export type NetworkProxyInstanceListEnvelope = components['schemas']['NetworkProxyInstanceListEnvelope'];
28108
+ export type NetworkProxyConfigurationInput = components['schemas']['NetworkProxyConfigurationInput'];
28109
+ export type NetworkProxyTrafficSample = components['schemas']['NetworkProxyTrafficSample'];
28110
+ export type NetworkProxyTrafficEnvelope = components['schemas']['NetworkProxyTrafficEnvelope'];
28111
+ export type NetworkProxyConnection = components['schemas']['NetworkProxyConnection'];
28112
+ export type NetworkProxyConnectionsEnvelope = components['schemas']['NetworkProxyConnectionsEnvelope'];
28113
+ export type NetworkProxyCloseCommandEnvelope = components['schemas']['NetworkProxyCloseCommandEnvelope'];
27983
28114
  export type NetworkRuntimeKind = components['schemas']['NetworkRuntimeKind'];
27984
28115
  export type NetworkRuntimeEnrollmentStatus = components['schemas']['NetworkRuntimeEnrollmentStatus'];
27985
28116
  export type NetworkRuntimeEnrollmentInput = components['schemas']['NetworkRuntimeEnrollmentInput'];
@@ -28031,29 +28162,6 @@ export type NetworkSessionCommandEnvelope = components['schemas']['NetworkSessio
28031
28162
  export type NetworkPolicyPreviewRequest = components['schemas']['NetworkPolicyPreviewRequest'];
28032
28163
  export type NetworkPolicyPreviewResult = components['schemas']['NetworkPolicyPreviewResult'];
28033
28164
  export type NetworkPolicyPreviewEnvelope = components['schemas']['NetworkPolicyPreviewEnvelope'];
28034
- export type KubernetesCustomResourceAccess = components['schemas']['KubernetesCustomResourceAccess'];
28035
- export type KubernetesCustomResourceAccessEnvelope = components['schemas']['KubernetesCustomResourceAccessEnvelope'];
28036
- export type KubernetesClusterRegistrationRequest = components['schemas']['KubernetesClusterRegistrationRequest'];
28037
- export type KubernetesAgentCustomResourceRule = components['schemas']['KubernetesAgentCustomResourceRule'];
28038
- export type KubernetesPrometheusTransport = components['schemas']['KubernetesPrometheusTransport'];
28039
- export type AgentPrometheusQueryRequest = components['schemas']['AgentPrometheusQueryRequest'];
28040
- export type KubernetesNamespaceInput = components['schemas']['KubernetesNamespaceInput'];
28041
- export type KubernetesNamespaceCreateInput = components['schemas']['KubernetesNamespaceCreateInput'];
28042
- export type KubernetesNamespaceEnvelope = components['schemas']['KubernetesNamespaceEnvelope'];
28043
- export type KubernetesNodeUpdateInput = components['schemas']['KubernetesNodeUpdateInput'];
28044
- export type KubernetesNodeSchedulabilityInput = components['schemas']['KubernetesNodeSchedulabilityInput'];
28045
- export type KubernetesNodeDrainInput = components['schemas']['KubernetesNodeDrainInput'];
28046
- export type KubernetesResourceYamlInput = components['schemas']['KubernetesResourceYamlInput'];
28047
- export type KubernetesConfigMapDataInput = components['schemas']['KubernetesConfigMapDataInput'];
28048
- export type KubernetesSecretDataInput = components['schemas']['KubernetesSecretDataInput'];
28049
- export type KubernetesCronJobSuspendInput = components['schemas']['KubernetesCronJobSuspendInput'];
28050
- export type KubernetesSecretDetail = components['schemas']['KubernetesSecretDetail'];
28051
- export type KubernetesSecretDetailEnvelope = components['schemas']['KubernetesSecretDetailEnvelope'];
28052
- export type ClusterAgentUpgradeInput = components['schemas']['ClusterAgentUpgradeInput'];
28053
- export type ClusterAgentUpgradeStatus = components['schemas']['ClusterAgentUpgradeStatus'];
28054
- export type ClusterAgentUpgradeStatusEnvelope = components['schemas']['ClusterAgentUpgradeStatusEnvelope'];
28055
- export type ClusterAgentUpgradeResult = components['schemas']['ClusterAgentUpgradeResult'];
28056
- export type ClusterAgentUpgradeResultEnvelope = components['schemas']['ClusterAgentUpgradeResultEnvelope'];
28057
28165
  export type ResponseIdentityError = components['responses']['IdentityError'];
28058
28166
  export type ResponseError = components['responses']['Error'];
28059
28167
  export type ResponseComputeError = components['responses']['ComputeError'];
package/go.mod CHANGED
@@ -3,10 +3,12 @@ module github.com/opensoha/soha-contracts
3
3
  go 1.26.6
4
4
 
5
5
  require (
6
+ github.com/google/uuid v1.6.0
6
7
  github.com/oapi-codegen/runtime v1.4.2
7
8
  github.com/santhosh-tekuri/jsonschema/v6 v6.0.2
8
9
  go.yaml.in/yaml/v3 v3.0.4
9
10
  helm.sh/helm/v4 v4.1.4
11
+ k8s.io/api v0.35.1
10
12
  k8s.io/apimachinery v0.35.1
11
13
  k8s.io/cli-runtime v0.35.1
12
14
  k8s.io/client-go v0.35.1
@@ -49,7 +51,6 @@ require (
49
51
  github.com/google/btree v1.1.3 // indirect
50
52
  github.com/google/gnostic-models v0.7.0 // indirect
51
53
  github.com/google/go-cmp v0.7.0 // indirect
52
- github.com/google/uuid v1.6.0 // indirect
53
54
  github.com/gosuri/uitable v0.0.4 // indirect
54
55
  github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 // indirect
55
56
  github.com/huandu/xstrings v1.5.0 // indirect
@@ -93,7 +94,7 @@ require (
93
94
  golang.org/x/crypto v0.51.0 // indirect
94
95
  golang.org/x/net v0.55.0 // indirect
95
96
  golang.org/x/oauth2 v0.34.0 // indirect
96
- golang.org/x/sync v0.21.0 // indirect
97
+ golang.org/x/sync v0.22.0 // indirect
97
98
  golang.org/x/sys v0.45.0 // indirect
98
99
  golang.org/x/term v0.43.0 // indirect
99
100
  golang.org/x/text v0.39.0 // indirect
@@ -102,7 +103,6 @@ require (
102
103
  gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
103
104
  gopkg.in/inf.v0 v0.9.1 // indirect
104
105
  gopkg.in/yaml.v3 v3.0.1 // indirect
105
- k8s.io/api v0.35.1 // indirect
106
106
  k8s.io/apiextensions-apiserver v0.35.1 // indirect
107
107
  k8s.io/apiserver v0.35.1 // indirect
108
108
  k8s.io/component-base v0.35.1 // indirect
@@ -110,7 +110,7 @@ require (
110
110
  k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
111
111
  k8s.io/kubectl v0.35.1 // indirect
112
112
  k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 // indirect
113
- oras.land/oras-go/v2 v2.6.0 // indirect
113
+ oras.land/oras-go/v2 v2.6.2 // indirect
114
114
  sigs.k8s.io/controller-runtime v0.23.1 // indirect
115
115
  sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
116
116
  sigs.k8s.io/kustomize/api v0.21.1 // indirect
package/go.sum CHANGED
@@ -333,8 +333,8 @@ golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
333
333
  golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
334
334
  golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
335
335
  golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
336
- golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM=
337
- golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
336
+ golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek=
337
+ golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
338
338
  golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
339
339
  golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
340
340
  golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
@@ -391,8 +391,8 @@ k8s.io/kubectl v0.35.1 h1:zP3Er8C5i1dcAFUMh9Eva0kVvZHptXIn/+8NtRWMxwg=
391
391
  k8s.io/kubectl v0.35.1/go.mod h1:cQ2uAPs5IO/kx8R5s5J3Ihv3VCYwrx0obCXum0CvnXo=
392
392
  k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck=
393
393
  k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
394
- oras.land/oras-go/v2 v2.6.0 h1:X4ELRsiGkrbeox69+9tzTu492FMUu7zJQW6eJU+I2oc=
395
- oras.land/oras-go/v2 v2.6.0/go.mod h1:magiQDfG6H1O9APp+rOsvCPcW1GD2MM7vgnKY0Y+u1o=
394
+ oras.land/oras-go/v2 v2.6.2 h1:N04RXngAp1LJKTG6ifz3xHPipasEkWr+hFmInja5YKo=
395
+ oras.land/oras-go/v2 v2.6.2/go.mod h1:PlTtg4JTDJkDe8yVHpM2wz7/YDc00GVas+i4jAW2TZ4=
396
396
  sigs.k8s.io/controller-runtime v0.23.1 h1:TjJSM80Nf43Mg21+RCy3J70aj/W6KyvDtOlpKf+PupE=
397
397
  sigs.k8s.io/controller-runtime v0.23.1/go.mod h1:B6COOxKptp+YaUT5q4l6LqUJTRpizbgf9KSRNdQGns0=
398
398
  sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg=
package/network/README.md CHANGED
@@ -4,6 +4,18 @@ The JSON Schemas in this directory define strict serialized shapes. Every
4
4
  consumer must also enforce the cross-field rules below before using a message
5
5
  for authorization, routing, firewall configuration or accounting.
6
6
 
7
+ ## Server proxy telemetry
8
+
9
+ - A Linux proxy runtime uses a separate `network-ingest/proxy/{instanceId}`
10
+ certificate to submit `proxy.runtime.sample`; its control certificate cannot
11
+ be used for ingest. The authenticated producer ID is the managed instance ID.
12
+ - Each event records sampled cumulative bytes and process uptime at
13
+ `occurredAt`. Readers derive rates only between samples from the same process
14
+ lifetime with nondecreasing counters. A process restart starts a new series.
15
+ - The existing `proxy.flow.aggregate` remains an endpoint Mihomo profile
16
+ window and is not a server instance sample. Neither event authorizes access
17
+ or exposes individual connections.
18
+
7
19
  ## Runtime messages
8
20
 
9
21
  - Runtime mTLS certificates carry exactly one Soha URI SAN:
@@ -10,7 +10,7 @@
10
10
  "schemaVersion": { "const": "network-ingest/v1alpha1" },
11
11
  "batchId": { "$ref": "#/$defs/Identifier" },
12
12
  "producerId": { "$ref": "#/$defs/Identifier" },
13
- "producerKind": { "enum": ["endpoint", "gateway", "freeradius", "network-control"] },
13
+ "producerKind": { "enum": ["endpoint", "gateway", "freeradius", "network-control", "proxy"] },
14
14
  "sentAt": { "type": "string", "format": "date-time" },
15
15
  "events": {
16
16
  "type": "array",
@@ -207,7 +207,8 @@
207
207
  "radius.accounting",
208
208
  "network.flow.aggregate",
209
209
  "network.connection.summary",
210
- "proxy.flow.aggregate"
210
+ "proxy.flow.aggregate",
211
+ "proxy.runtime.sample"
211
212
  ]
212
213
  },
213
214
  "sequence": { "type": "integer", "minimum": 0 },
@@ -221,7 +222,8 @@
221
222
  { "$ref": "#/$defs/RadiusAccounting" },
222
223
  { "$ref": "#/$defs/FlowAggregate" },
223
224
  { "$ref": "#/$defs/ConnectionSummary" },
224
- { "$ref": "#/$defs/ProxyFlowAggregate" }
225
+ { "$ref": "#/$defs/ProxyFlowAggregate" },
226
+ { "$ref": "#/$defs/ProxyRuntimeSample" }
225
227
  ]
226
228
  }
227
229
  },
@@ -302,6 +304,10 @@
302
304
  {
303
305
  "if": { "properties": { "type": { "const": "proxy.flow.aggregate" } }, "required": ["type"] },
304
306
  "then": { "properties": { "payload": { "$ref": "#/$defs/ProxyFlowAggregate" } } }
307
+ },
308
+ {
309
+ "if": { "properties": { "type": { "const": "proxy.runtime.sample" } }, "required": ["type"] },
310
+ "then": { "properties": { "payload": { "$ref": "#/$defs/ProxyRuntimeSample" } } }
305
311
  }
306
312
  ]
307
313
  },
@@ -410,6 +416,18 @@
410
416
  "downloadBytes": { "type": "integer", "minimum": 0, "maximum": 9223372036854775807 },
411
417
  "activeConnections": { "type": "integer", "minimum": 0, "maximum": 1000000 }
412
418
  }
419
+ },
420
+ "ProxyRuntimeSample": {
421
+ "type": "object",
422
+ "additionalProperties": false,
423
+ "required": ["engine", "uptimeSeconds", "uploadTotal", "downloadTotal"],
424
+ "properties": {
425
+ "engine": { "enum": ["mihomo", "sing-box", "v2ray"] },
426
+ "uptimeSeconds": { "type": "integer", "minimum": 0 },
427
+ "uploadTotal": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
428
+ "downloadTotal": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
429
+ "activeConnections": { "type": "integer", "minimum": 0, "maximum": 1000000 }
430
+ }
413
431
  }
414
432
  }
415
433
  }