@opensoha/contracts 0.1.15 → 0.1.17

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 (211) hide show
  1. package/COMPATIBILITY.md +46 -0
  2. package/README.md +12 -3
  3. package/auth/catalog_generated.go +2 -2
  4. package/auth/catalog_test.go +32 -0
  5. package/auth/permission-catalog.json +537 -8
  6. package/compat/json-schema-ecosystem-0.1.0.json +1 -1
  7. package/compat/openapi-loose-boundaries-0.1.0.json +58 -1
  8. package/fixtures/json-schema/network-ingest-event/invalid/duplicate-event.json +33 -0
  9. package/fixtures/json-schema/network-ingest-event/invalid/message-payload-mismatch.json +23 -0
  10. package/fixtures/json-schema/network-ingest-event/invalid/password.json +22 -0
  11. package/fixtures/json-schema/network-ingest-event/invalid/proxy-flow-destination.json +28 -0
  12. package/fixtures/json-schema/network-ingest-event/valid/endpoint-proxy-flow.json +27 -0
  13. package/fixtures/json-schema/network-ingest-event/valid/freeradius-accounting.json +25 -0
  14. package/fixtures/json-schema/network-ingest-event/valid/gateway.json +53 -0
  15. package/fixtures/json-schema/network-radius-accounting/invalid/password.json +9 -0
  16. package/fixtures/json-schema/network-radius-accounting/valid/accounting.json +16 -0
  17. package/fixtures/json-schema/network-runtime-protocol/invalid/invalid-cidr.json +31 -0
  18. package/fixtures/json-schema/network-runtime-protocol/invalid/message-payload-mismatch.json +19 -0
  19. package/fixtures/json-schema/network-runtime-protocol/invalid/mihomo-raw-subscription.json +33 -0
  20. package/fixtures/json-schema/network-runtime-protocol/invalid/nas-authorization-password.json +18 -0
  21. package/fixtures/json-schema/network-runtime-protocol/invalid/nas-eap-without-certificate.json +17 -0
  22. package/fixtures/json-schema/network-runtime-protocol/invalid/private-key.json +20 -0
  23. package/fixtures/json-schema/network-runtime-protocol/invalid/raw-credential-reference.json +16 -0
  24. package/fixtures/json-schema/network-runtime-protocol/invalid/runtime-interval-too-short.json +23 -0
  25. package/fixtures/json-schema/network-runtime-protocol/invalid/wireguard-capability-without-key.json +19 -0
  26. package/fixtures/json-schema/network-runtime-protocol/invalid/wireguard-default-route.json +31 -0
  27. package/fixtures/json-schema/network-runtime-protocol/invalid/ztna-without-access-grant.json +17 -0
  28. package/fixtures/json-schema/network-runtime-protocol/valid/configuration-desired.json +86 -0
  29. package/fixtures/json-schema/network-runtime-protocol/valid/direct-ztna-connect.json +19 -0
  30. package/fixtures/json-schema/network-runtime-protocol/valid/direct-ztna-result.json +33 -0
  31. package/fixtures/json-schema/network-runtime-protocol/valid/internal-ztna-connect.json +19 -0
  32. package/fixtures/json-schema/network-runtime-protocol/valid/mihomo-app-subscription-configuration.json +32 -0
  33. package/fixtures/json-schema/network-runtime-protocol/valid/mihomo-manual-node-configuration.json +32 -0
  34. package/fixtures/json-schema/network-runtime-protocol/valid/mihomo-wireguard-configuration.json +70 -0
  35. package/fixtures/json-schema/network-runtime-protocol/valid/nas-authorization-request.json +19 -0
  36. package/fixtures/json-schema/network-runtime-protocol/valid/nas-authorization-result.json +24 -0
  37. package/fixtures/json-schema/network-runtime-protocol/valid/nas-session-command-result.json +17 -0
  38. package/fixtures/json-schema/network-runtime-protocol/valid/nas-session-command.json +27 -0
  39. package/fixtures/json-schema/network-runtime-protocol/valid/vpn-connect-request.json +17 -0
  40. package/fixtures/json-schema/network-runtime-protocol/valid/vpn-connect-result.json +34 -0
  41. package/fixtures/json-schema/network-runtime-protocol/valid/wireguard-enrollment.json +20 -0
  42. package/fixtures/json-schema/network-runtime-protocol/valid/wireguard-site-link.json +48 -0
  43. package/fixtures/openapi/AlertRuleEnvelope/invalid/missing-data.json +1 -0
  44. package/fixtures/openapi/AlertRuleEnvelope/valid/metrics.json +11 -0
  45. package/fixtures/openapi/AlertRuleInput/invalid/missing-name.json +3 -0
  46. package/fixtures/openapi/AlertRuleInput/valid/metrics.json +25 -0
  47. package/fixtures/openapi/AlertRuleRunListEnvelope/invalid/missing-rule-id.json +12 -0
  48. package/fixtures/openapi/AlertRuleRunListEnvelope/valid/items.json +13 -0
  49. package/fixtures/openapi/AlertRuleTestResultEnvelope/invalid/missing-executed-at.json +5 -0
  50. package/fixtures/openapi/AlertRuleTestResultEnvelope/valid/clear.json +10 -0
  51. package/fixtures/openapi/AnnouncementReceiptPageEnvelope/invalid/missing-read-count.json +9 -0
  52. package/fixtures/openapi/AnnouncementReceiptPageEnvelope/valid/read-and-unread.json +28 -0
  53. package/fixtures/openapi/ApplicationRuntimeEnvironment/invalid/unknown-status.json +7 -0
  54. package/fixtures/openapi/ApplicationRuntimeEnvironment/valid/unavailable.json +7 -0
  55. package/fixtures/openapi/ApplicationWorkflowInput/invalid/owner-fields.json +7 -0
  56. package/fixtures/openapi/ApplicationWorkflowInput/valid/minimal.json +9 -0
  57. package/fixtures/openapi/BrandingAssetUploadEnvelope/valid/svg-data-url.json +5 -0
  58. package/fixtures/openapi/BrowserHandoffCompletionEnvelope/invalid/token-leak.json +7 -0
  59. package/fixtures/openapi/BrowserHandoffCompletionEnvelope/valid/completed.json +6 -0
  60. package/fixtures/openapi/BrowserHandoffEnvelope/invalid/missing-principal.json +12 -0
  61. package/fixtures/openapi/BrowserHandoffEnvelope/valid/pending.json +11 -0
  62. package/fixtures/openapi/ChangePasswordRequest/invalid/missing-current-password.json +3 -0
  63. package/fixtures/openapi/ChangePasswordRequest/invalid/short-new-password.json +4 -0
  64. package/fixtures/openapi/ChangePasswordRequest/valid/password.json +4 -0
  65. package/fixtures/openapi/DesktopAuthAttemptCreateRequest/invalid/https-redirect.json +6 -0
  66. package/fixtures/openapi/DesktopAuthAttemptCreateRequest/invalid/localhost-redirect.json +6 -0
  67. package/fixtures/openapi/DesktopAuthAttemptCreateRequest/invalid/plain-challenge.json +6 -0
  68. package/fixtures/openapi/DesktopAuthAttemptCreateRequest/invalid/privileged-port.json +6 -0
  69. package/fixtures/openapi/DesktopAuthAttemptCreateRequest/invalid/short-callback.json +6 -0
  70. package/fixtures/openapi/DesktopAuthAttemptCreateRequest/valid/loopback.json +6 -0
  71. package/fixtures/openapi/DesktopAuthAttemptEnvelope/invalid/missing-expiry.json +6 -0
  72. package/fixtures/openapi/DesktopAuthAttemptEnvelope/valid/attempt.json +7 -0
  73. package/fixtures/openapi/DesktopAuthAttemptExchangeRequest/invalid/short-verifier.json +4 -0
  74. package/fixtures/openapi/DesktopAuthAttemptExchangeRequest/valid/exchange.json +4 -0
  75. package/fixtures/openapi/EndpointDevice/invalid/missing-owner.json +8 -0
  76. package/fixtures/openapi/EndpointDevice/valid/active.json +35 -0
  77. package/fixtures/openapi/EndpointDeviceRegistrationInput/invalid/client-owned-status.json +5 -0
  78. package/fixtures/openapi/EndpointDeviceRegistrationInput/invalid/oversized-network-inventory.json +18 -0
  79. package/fixtures/openapi/EndpointDeviceRegistrationInput/valid/macos.json +28 -0
  80. package/fixtures/openapi/IdentityApplication/invalid/missing-id.json +7 -0
  81. package/fixtures/openapi/IdentityApplication/valid/full.json +30 -0
  82. package/fixtures/openapi/IdentityApplicationEnvelope/invalid/missing-data.json +1 -0
  83. package/fixtures/openapi/IdentityApplicationEnvelope/valid/minimal.json +10 -0
  84. package/fixtures/openapi/IdentityApplicationLaunchListEnvelope/invalid/missing-user.json +11 -0
  85. package/fixtures/openapi/IdentityApplicationLaunchListEnvelope/valid/minimal.json +12 -0
  86. package/fixtures/openapi/LLMUpstreamTestResultEnvelope/invalid/models-not-array.json +9 -0
  87. package/fixtures/openapi/LLMUpstreamTestResultEnvelope/valid/discovered-models.json +11 -0
  88. package/fixtures/openapi/LogQuery/invalid/empty-data-source-id.json +7 -0
  89. package/fixtures/openapi/LogQuery/valid/durable-data-source.json +14 -0
  90. package/fixtures/openapi/ManifestPackage/invalid/missing-application.json +12 -0
  91. package/fixtures/openapi/ManifestPackage/valid/service-scoped.json +29 -0
  92. package/fixtures/openapi/NetworkAccessGrant/invalid/token-digest.json +15 -0
  93. package/fixtures/openapi/NetworkAccessGrant/valid/issued.json +14 -0
  94. package/fixtures/openapi/NetworkAccessGrantInput/invalid/no-resources.json +7 -0
  95. package/fixtures/openapi/NetworkAccessGrantInput/valid/direct-ztna.json +8 -0
  96. package/fixtures/openapi/NetworkAccessGrantSecret/invalid/short-token.json +17 -0
  97. package/fixtures/openapi/NetworkAccessGrantSecret/valid/issued.json +17 -0
  98. package/fixtures/openapi/NetworkAccessPolicy/invalid/missing-version.json +20 -0
  99. package/fixtures/openapi/NetworkAccessPolicy/valid/published-draft.json +21 -0
  100. package/fixtures/openapi/NetworkAccessPolicyInput/invalid/duplicate-team.json +17 -0
  101. package/fixtures/openapi/NetworkAccessPolicyInput/valid/team-and-tag-allow.json +17 -0
  102. package/fixtures/openapi/NetworkConflictAnalysisRequest/invalid/ipv6-range.json +9 -0
  103. package/fixtures/openapi/NetworkConflictAnalysisRequest/valid/runtime-ranges.json +15 -0
  104. package/fixtures/openapi/NetworkConnectionOption/invalid/secret.json +10 -0
  105. package/fixtures/openapi/NetworkConnectionOption/valid/wifi.json +9 -0
  106. package/fixtures/openapi/NetworkConnectionOption/valid/wired.json +8 -0
  107. package/fixtures/openapi/NetworkGateway/invalid/missing-site.json +7 -0
  108. package/fixtures/openapi/NetworkGateway/valid/online.json +23 -0
  109. package/fixtures/openapi/NetworkGatewayInput/invalid/default-route-overlay.json +13 -0
  110. package/fixtures/openapi/NetworkGatewayInput/valid/routed.json +14 -0
  111. package/fixtures/openapi/NetworkLease/invalid/empty-cidrs.json +12 -0
  112. package/fixtures/openapi/NetworkLease/valid/active.json +12 -0
  113. package/fixtures/openapi/NetworkMihomoProfile/invalid/subscription-leak.json +20 -0
  114. package/fixtures/openapi/NetworkMihomoProfile/valid/managed.json +21 -0
  115. package/fixtures/openapi/NetworkMihomoProfileInput/invalid/app-subscription-secret.json +14 -0
  116. package/fixtures/openapi/NetworkMihomoProfileInput/invalid/manual-node-with-subscription.json +20 -0
  117. package/fixtures/openapi/NetworkMihomoProfileInput/valid/app-subscription.json +14 -0
  118. package/fixtures/openapi/NetworkMihomoProfileInput/valid/managed.json +16 -0
  119. package/fixtures/openapi/NetworkMihomoProfileInput/valid/manual-node.json +21 -0
  120. package/fixtures/openapi/NetworkNASBinding/invalid/secret.json +13 -0
  121. package/fixtures/openapi/NetworkNASBinding/valid/default.json +16 -0
  122. package/fixtures/openapi/NetworkNASBindingInput/invalid/secret.json +10 -0
  123. package/fixtures/openapi/NetworkNASBindingInput/valid/default.json +13 -0
  124. package/fixtures/openapi/NetworkPolicyPreviewRequest/invalid/unknown-mode.json +6 -0
  125. package/fixtures/openapi/NetworkPolicyPreviewRequest/valid/external-direct-ztna.json +6 -0
  126. package/fixtures/openapi/NetworkPolicyPreviewRequest/valid/external-vpn-ztna.json +6 -0
  127. package/fixtures/openapi/NetworkPolicyPreviewRequest/valid/external-vpn.json +6 -0
  128. package/fixtures/openapi/NetworkPolicyPreviewRequest/valid/internal-direct.json +7 -0
  129. package/fixtures/openapi/NetworkPolicyPreviewRequest/valid/internal-ztna.json +7 -0
  130. package/fixtures/openapi/NetworkPolicyPreviewResult/invalid/bypass-path.json +9 -0
  131. package/fixtures/openapi/NetworkPolicyPreviewResult/valid/onboarding.json +10 -0
  132. package/fixtures/openapi/NetworkPolicyPreviewResult/valid/protected-broad-path-denied.json +9 -0
  133. package/fixtures/openapi/NetworkPolicyPreviewResult/valid/protected-resource.json +9 -0
  134. package/fixtures/openapi/NetworkPolicyPreviewResult/valid/quarantine.json +10 -0
  135. package/fixtures/openapi/NetworkPolicyPreviewResult/valid/restricted.json +10 -0
  136. package/fixtures/openapi/NetworkPolicySnapshot/invalid/zero-version.json +7 -0
  137. package/fixtures/openapi/NetworkPolicySnapshot/valid/published.json +7 -0
  138. package/fixtures/openapi/NetworkResourceInput/invalid/invalid-port.json +10 -0
  139. package/fixtures/openapi/NetworkResourceInput/valid/protected-cidr.json +10 -0
  140. package/fixtures/openapi/NetworkRuntimeEnrollmentInput/invalid/excessive-ttl.json +7 -0
  141. package/fixtures/openapi/NetworkRuntimeEnrollmentInput/valid/endpoint.json +7 -0
  142. package/fixtures/openapi/NetworkRuntimeEnrollmentSecret/invalid/short-token.json +15 -0
  143. package/fixtures/openapi/NetworkRuntimeEnrollmentSecret/valid/pending.json +15 -0
  144. package/fixtures/openapi/NetworkSession/invalid/unknown-status.json +14 -0
  145. package/fixtures/openapi/NetworkSession/valid/restricted-vpn-ztna.json +16 -0
  146. package/fixtures/openapi/NetworkSessionActionExecuteInput/invalid/short-hash.json +6 -0
  147. package/fixtures/openapi/NetworkSessionActionExecuteInput/valid/restrict.json +6 -0
  148. package/fixtures/openapi/NetworkSessionActionInput/invalid/unknown-action.json +5 -0
  149. package/fixtures/openapi/NetworkSessionActionInput/valid/restrict.json +5 -0
  150. package/fixtures/openapi/NetworkSessionActionPlan/invalid/missing-hash.json +12 -0
  151. package/fixtures/openapi/NetworkSessionActionPlan/valid/fallback-disconnect.json +13 -0
  152. package/fixtures/openapi/NetworkSessionCommand/invalid/unknown-status.json +14 -0
  153. package/fixtures/openapi/NetworkSessionCommand/valid/pending.json +14 -0
  154. package/fixtures/openapi/NetworkSiteInput/invalid/unknown-status.json +4 -0
  155. package/fixtures/openapi/NetworkSiteInput/valid/shanghai.json +5 -0
  156. package/fixtures/openapi/NetworkSiteProfileBinding/invalid/vlan.json +9 -0
  157. package/fixtures/openapi/NetworkSiteProfileBinding/valid/default.json +10 -0
  158. package/fixtures/openapi/NetworkSiteProfileBindingInput/invalid/timeout.json +7 -0
  159. package/fixtures/openapi/NetworkSiteProfileBindingInput/valid/default.json +7 -0
  160. package/fixtures/openapi/NetworkSpaceInput/invalid/empty-cidrs.json +6 -0
  161. package/fixtures/openapi/NetworkSpaceInput/invalid/malformed-cidr.json +6 -0
  162. package/fixtures/openapi/NetworkSpaceInput/valid/corp.json +6 -0
  163. package/fixtures/openapi/NetworkTelemetrySummary/invalid/raw-destination.json +29 -0
  164. package/fixtures/openapi/NetworkTelemetrySummary/valid/proxy-flow.json +36 -0
  165. package/fixtures/openapi/OIDCClientInput/valid/generated-client-id.json +8 -0
  166. package/fixtures/openapi/OIDCClientSecretRevealEnvelope/invalid/missing-secret.json +6 -0
  167. package/fixtures/openapi/OIDCClientSecretRevealEnvelope/valid/reveal.json +7 -0
  168. package/fixtures/openapi/PasswordChangeResult/invalid/unexpected-status.json +3 -0
  169. package/fixtures/openapi/PasswordChangeResult/valid/ok.json +3 -0
  170. package/fixtures/openapi/PortalApplicationListEnvelope/invalid/missing-items.json +1 -0
  171. package/fixtures/openapi/PortalApplicationListEnvelope/valid/minimal.json +12 -0
  172. package/fixtures/openapi/PortalBootstrapEnvelope/invalid/missing-security.json +17 -0
  173. package/fixtures/openapi/PortalBootstrapEnvelope/valid/minimal.json +31 -0
  174. package/fixtures/openapi/PortalLaunchDecisionEnvelope/invalid/missing-launch-url.json +14 -0
  175. package/fixtures/openapi/PortalLaunchDecisionEnvelope/valid/desktop-handoff.json +16 -0
  176. package/fixtures/openapi/PortalLaunchRequest/invalid/unknown-surface.json +3 -0
  177. package/fixtures/openapi/PortalLaunchRequest/valid/default-web.json +1 -0
  178. package/fixtures/openapi/PortalLaunchRequest/valid/desktop.json +3 -0
  179. package/fixtures/openapi/PortalSecuritySummaryEnvelope/invalid/missing-session-count.json +15 -0
  180. package/fixtures/openapi/PortalSecuritySummaryEnvelope/valid/minimal.json +16 -0
  181. package/fixtures/openapi/ResourceLease/invalid/missing-session.json +10 -0
  182. package/fixtures/openapi/ResourceLease/valid/active.json +11 -0
  183. package/fixtures/openapi/ScopeGrantInput/invalid/delivery-missing-business-line.json +7 -0
  184. package/fixtures/openapi/ScopeGrantInput/invalid/platform-missing-clusters.json +7 -0
  185. package/fixtures/openapi/ScopeGrantInput/valid/platform.json +8 -0
  186. package/fixtures/openapi/SoftwarePackage/valid/software-package.json +6 -0
  187. package/fixtures/openapi/SoftwarePackageDownloadRecord/invalid/negative-duration.json +6 -0
  188. package/fixtures/openapi/SoftwarePackageDownloadRecord/valid/software-package-download-record.json +8 -0
  189. package/fixtures/openapi/SoftwarePackageURLImportRequest/valid/software-package-url-import-request.json +4 -0
  190. package/fixtures/openapi/SoftwareStorage/invalid/software-storage.json +1 -1
  191. package/fixtures/openapi/SoftwareStorage/valid/software-storage.json +13 -1
  192. package/fixtures/openapi/SystemIntegrationCreateRequest/invalid/s3-storage-missing-name.json +5 -0
  193. package/fixtures/openapi/SystemIntegrationCreateRequest/valid/s3-software-storage.json +18 -0
  194. package/fixtures/openapi/UpdateProfileRequest/invalid/invalid-avatar-fit.json +5 -0
  195. package/fixtures/openapi/UpdateProfileRequest/invalid/missing-email.json +3 -0
  196. package/fixtures/openapi/UpdateProfileRequest/valid/profile.json +7 -0
  197. package/gen/go/sohaapi/client.go +210 -5
  198. package/gen/go/sohaapi/client_test.go +128 -5
  199. package/gen/go/sohaapi/types.go +3326 -369
  200. package/gen/go/sohaapi/types_test.go +22 -0
  201. package/gen/ts/sohaapi/index.ts +11612 -6479
  202. package/network/README.md +116 -0
  203. package/network/network-ingest-event.schema.json +187 -0
  204. package/network/network-radius-accounting.schema.json +41 -0
  205. package/network/network-runtime-protocol.schema.json +752 -0
  206. package/network/schema.go +26 -0
  207. package/network/schema_test.go +22 -0
  208. package/openapi/soha-api.json +29591 -18317
  209. package/openapi/soha-api.yaml +11603 -6720
  210. package/openapi/spec_generated.go +3 -3
  211. package/package.json +5 -1
@@ -0,0 +1,752 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://contracts.opensoha.dev/network/network-runtime-protocol.schema.json",
4
+ "title": "OpenSoha Network Runtime Protocol Message",
5
+ "description": "Strict, versioned control messages exchanged by network-control, endpoint services and network gateways. Private keys and raw authentication credentials are intentionally excluded.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": [
9
+ "schemaVersion",
10
+ "messageId",
11
+ "messageType",
12
+ "producerId",
13
+ "runtimeId",
14
+ "runtimeKind",
15
+ "occurredAt",
16
+ "expiresAt",
17
+ "payload"
18
+ ],
19
+ "properties": {
20
+ "schemaVersion": { "const": "network-runtime/v1alpha1" },
21
+ "messageId": { "$ref": "#/$defs/Identifier" },
22
+ "messageType": {
23
+ "enum": [
24
+ "runtime.enroll.request",
25
+ "runtime.enroll.result",
26
+ "configuration.desired",
27
+ "configuration.applied",
28
+ "lease.renew.request",
29
+ "lease.renew.result",
30
+ "lease.revoke",
31
+ "vpn.connect.request",
32
+ "vpn.connect.result",
33
+ "nas.authorization.request",
34
+ "nas.authorization.result",
35
+ "nas.session.command",
36
+ "nas.session.command.result"
37
+ ]
38
+ },
39
+ "producerId": { "$ref": "#/$defs/Identifier" },
40
+ "runtimeId": { "$ref": "#/$defs/Identifier" },
41
+ "runtimeKind": { "enum": ["endpoint", "gateway", "nas"] },
42
+ "occurredAt": { "type": "string", "format": "date-time" },
43
+ "expiresAt": { "type": "string", "format": "date-time" },
44
+ "payload": {
45
+ "oneOf": [
46
+ { "$ref": "#/$defs/EnrollmentRequest" },
47
+ { "$ref": "#/$defs/EnrollmentResult" },
48
+ { "$ref": "#/$defs/ConfigurationDesired" },
49
+ { "$ref": "#/$defs/ConfigurationApplied" },
50
+ { "$ref": "#/$defs/LeaseRenewRequest" },
51
+ { "$ref": "#/$defs/LeaseRenewResult" },
52
+ { "$ref": "#/$defs/LeaseRevoke" },
53
+ { "$ref": "#/$defs/VPNConnectRequest" },
54
+ { "$ref": "#/$defs/VPNConnectResult" },
55
+ { "$ref": "#/$defs/NASAuthorizationRequest" },
56
+ { "$ref": "#/$defs/NASAuthorizationResult" },
57
+ { "$ref": "#/$defs/NASSessionCommand" },
58
+ { "$ref": "#/$defs/NASSessionCommandResult" }
59
+ ]
60
+ }
61
+ },
62
+ "allOf": [
63
+ {
64
+ "if": { "properties": { "messageType": { "const": "runtime.enroll.request" } }, "required": ["messageType"] },
65
+ "then": { "properties": { "payload": { "$ref": "#/$defs/EnrollmentRequest" } } }
66
+ },
67
+ {
68
+ "if": { "properties": { "messageType": { "const": "runtime.enroll.result" } }, "required": ["messageType"] },
69
+ "then": { "properties": { "payload": { "$ref": "#/$defs/EnrollmentResult" } } }
70
+ },
71
+ {
72
+ "if": { "properties": { "messageType": { "const": "configuration.desired" } }, "required": ["messageType"] },
73
+ "then": { "properties": { "payload": { "$ref": "#/$defs/ConfigurationDesired" } } }
74
+ },
75
+ {
76
+ "if": { "properties": { "messageType": { "const": "configuration.applied" } }, "required": ["messageType"] },
77
+ "then": { "properties": { "payload": { "$ref": "#/$defs/ConfigurationApplied" } } }
78
+ },
79
+ {
80
+ "if": { "properties": { "messageType": { "const": "lease.renew.request" } }, "required": ["messageType"] },
81
+ "then": { "properties": { "payload": { "$ref": "#/$defs/LeaseRenewRequest" } } }
82
+ },
83
+ {
84
+ "if": { "properties": { "messageType": { "const": "lease.renew.result" } }, "required": ["messageType"] },
85
+ "then": { "properties": { "payload": { "$ref": "#/$defs/LeaseRenewResult" } } }
86
+ },
87
+ {
88
+ "if": { "properties": { "messageType": { "const": "lease.revoke" } }, "required": ["messageType"] },
89
+ "then": { "properties": { "payload": { "$ref": "#/$defs/LeaseRevoke" } } }
90
+ },
91
+ {
92
+ "if": { "properties": { "messageType": { "const": "vpn.connect.request" } }, "required": ["messageType"] },
93
+ "then": {
94
+ "properties": {
95
+ "runtimeKind": { "const": "endpoint" },
96
+ "payload": { "$ref": "#/$defs/VPNConnectRequest" }
97
+ }
98
+ }
99
+ },
100
+ {
101
+ "if": { "properties": { "messageType": { "const": "vpn.connect.result" } }, "required": ["messageType"] },
102
+ "then": {
103
+ "properties": {
104
+ "runtimeKind": { "const": "endpoint" },
105
+ "payload": { "$ref": "#/$defs/VPNConnectResult" }
106
+ }
107
+ }
108
+ },
109
+ {
110
+ "if": { "properties": { "messageType": { "const": "nas.authorization.request" } }, "required": ["messageType"] },
111
+ "then": {
112
+ "properties": {
113
+ "runtimeKind": { "const": "nas" },
114
+ "payload": { "$ref": "#/$defs/NASAuthorizationRequest" }
115
+ }
116
+ }
117
+ },
118
+ {
119
+ "if": { "properties": { "messageType": { "const": "nas.authorization.result" } }, "required": ["messageType"] },
120
+ "then": {
121
+ "properties": {
122
+ "runtimeKind": { "const": "nas" },
123
+ "payload": { "$ref": "#/$defs/NASAuthorizationResult" }
124
+ }
125
+ }
126
+ },
127
+ {
128
+ "if": { "properties": { "messageType": { "const": "nas.session.command" } }, "required": ["messageType"] },
129
+ "then": {
130
+ "properties": {
131
+ "runtimeKind": { "const": "nas" },
132
+ "payload": { "$ref": "#/$defs/NASSessionCommand" }
133
+ }
134
+ }
135
+ },
136
+ {
137
+ "if": { "properties": { "messageType": { "const": "nas.session.command.result" } }, "required": ["messageType"] },
138
+ "then": {
139
+ "properties": {
140
+ "runtimeKind": { "const": "nas" },
141
+ "payload": { "$ref": "#/$defs/NASSessionCommandResult" }
142
+ }
143
+ }
144
+ }
145
+ ],
146
+ "$defs": {
147
+ "Identifier": {
148
+ "type": "string",
149
+ "minLength": 1,
150
+ "maxLength": 128,
151
+ "pattern": "^[A-Za-z0-9][A-Za-z0-9._:-]*$"
152
+ },
153
+ "AccessProfile": {
154
+ "enum": ["onboarding", "full", "restricted", "quarantine", "deny"]
155
+ },
156
+ "IPv4Address": {
157
+ "type": "string",
158
+ "maxLength": 15,
159
+ "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])$"
160
+ },
161
+ "IPv4CIDR": {
162
+ "type": "string",
163
+ "maxLength": 18,
164
+ "pattern": "^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])/(?:[0-9]|[12][0-9]|3[0-2])$",
165
+ "description": "Canonical IPv4 CIDR. IPv6 is intentionally deferred beyond network-runtime/v1alpha1."
166
+ },
167
+ "SplitRoute": {
168
+ "allOf": [
169
+ { "$ref": "#/$defs/IPv4CIDR" },
170
+ { "not": { "const": "0.0.0.0/0" } }
171
+ ]
172
+ },
173
+ "WireGuardPublicKey": {
174
+ "type": "string",
175
+ "minLength": 44,
176
+ "maxLength": 44,
177
+ "pattern": "^[A-Za-z0-9+/]{43}=$"
178
+ },
179
+ "RadiusAttributes": {
180
+ "type": "object",
181
+ "additionalProperties": false,
182
+ "required": ["sessionTimeoutSeconds"],
183
+ "properties": {
184
+ "vlanId": { "type": "integer", "minimum": 1, "maximum": 4094 },
185
+ "filterId": { "type": "string", "minLength": 1, "maxLength": 128 },
186
+ "sessionTimeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 86400 }
187
+ }
188
+ },
189
+ "NetworkLease": {
190
+ "type": "object",
191
+ "additionalProperties": false,
192
+ "required": [
193
+ "id",
194
+ "sessionId",
195
+ "subjectId",
196
+ "deviceId",
197
+ "networkSpaceId",
198
+ "cidrs",
199
+ "policyVersion",
200
+ "issuedAt",
201
+ "expiresAt"
202
+ ],
203
+ "properties": {
204
+ "id": { "$ref": "#/$defs/Identifier" },
205
+ "sessionId": { "$ref": "#/$defs/Identifier" },
206
+ "subjectId": { "$ref": "#/$defs/Identifier" },
207
+ "deviceId": { "$ref": "#/$defs/Identifier" },
208
+ "networkSpaceId": { "$ref": "#/$defs/Identifier" },
209
+ "cidrs": {
210
+ "type": "array",
211
+ "minItems": 1,
212
+ "maxItems": 128,
213
+ "uniqueItems": true,
214
+ "items": { "$ref": "#/$defs/IPv4CIDR" }
215
+ },
216
+ "policyVersion": { "type": "integer", "minimum": 1 },
217
+ "issuedAt": { "type": "string", "format": "date-time" },
218
+ "expiresAt": { "type": "string", "format": "date-time" }
219
+ }
220
+ },
221
+ "ResourceLease": {
222
+ "type": "object",
223
+ "additionalProperties": false,
224
+ "required": [
225
+ "id",
226
+ "sessionId",
227
+ "subjectId",
228
+ "deviceId",
229
+ "resourceIds",
230
+ "policyVersion",
231
+ "issuedAt",
232
+ "expiresAt"
233
+ ],
234
+ "properties": {
235
+ "id": { "$ref": "#/$defs/Identifier" },
236
+ "sessionId": { "$ref": "#/$defs/Identifier" },
237
+ "subjectId": { "$ref": "#/$defs/Identifier" },
238
+ "deviceId": { "$ref": "#/$defs/Identifier" },
239
+ "resourceIds": {
240
+ "type": "array",
241
+ "minItems": 1,
242
+ "maxItems": 256,
243
+ "uniqueItems": true,
244
+ "items": { "$ref": "#/$defs/Identifier" }
245
+ },
246
+ "policyVersion": { "type": "integer", "minimum": 1 },
247
+ "issuedAt": { "type": "string", "format": "date-time" },
248
+ "expiresAt": { "type": "string", "format": "date-time" }
249
+ }
250
+ },
251
+ "EnrollmentRequest": {
252
+ "type": "object",
253
+ "additionalProperties": false,
254
+ "required": ["enrollmentId", "challengeId", "deviceId", "devicePublicKey", "platform", "clientVersion", "capabilities"],
255
+ "properties": {
256
+ "enrollmentId": { "$ref": "#/$defs/Identifier" },
257
+ "challengeId": { "$ref": "#/$defs/Identifier" },
258
+ "deviceId": { "$ref": "#/$defs/Identifier" },
259
+ "devicePublicKey": { "type": "string", "minLength": 32, "maxLength": 4096 },
260
+ "wireguardPublicKey": { "$ref": "#/$defs/WireGuardPublicKey" },
261
+ "platform": { "enum": ["windows", "linux", "macos"] },
262
+ "clientVersion": { "type": "string", "minLength": 1, "maxLength": 64 },
263
+ "capabilities": {
264
+ "type": "array",
265
+ "minItems": 1,
266
+ "maxItems": 32,
267
+ "uniqueItems": true,
268
+ "items": { "enum": ["wireguard", "mihomo", "route-coordinator", "dns-coordinator"] }
269
+ }
270
+ },
271
+ "allOf": [{
272
+ "if": {
273
+ "properties": {
274
+ "capabilities": { "contains": { "const": "wireguard" } }
275
+ },
276
+ "required": ["capabilities"]
277
+ },
278
+ "then": { "required": ["wireguardPublicKey"] }
279
+ }]
280
+ },
281
+ "EnrollmentResult": {
282
+ "type": "object",
283
+ "additionalProperties": false,
284
+ "required": ["accepted", "reasonCode"],
285
+ "properties": {
286
+ "accepted": { "type": "boolean" },
287
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 },
288
+ "credentialReference": {
289
+ "type": "string",
290
+ "maxLength": 266,
291
+ "pattern": "^secretref:[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$",
292
+ "description": "Opaque reference to runtime-local protected storage, never raw credential material."
293
+ },
294
+ "credentialExpiresAt": { "type": "string", "format": "date-time" }
295
+ }
296
+ },
297
+ "RuntimeIntervals": {
298
+ "type": "object",
299
+ "additionalProperties": false,
300
+ "required": ["heartbeatIntervalSeconds", "configurationPollIntervalSeconds"],
301
+ "properties": {
302
+ "heartbeatIntervalSeconds": { "type": "integer", "minimum": 30, "maximum": 300 },
303
+ "configurationPollIntervalSeconds": { "type": "integer", "minimum": 30, "maximum": 300 }
304
+ }
305
+ },
306
+ "ConfigurationDesired": {
307
+ "type": "object",
308
+ "additionalProperties": false,
309
+ "required": [
310
+ "configurationVersion",
311
+ "policyVersion",
312
+ "validUntil",
313
+ "accessProfile",
314
+ "protectedResourceIds",
315
+ "networkLeases",
316
+ "resourceLeases"
317
+ ],
318
+ "properties": {
319
+ "configurationVersion": { "type": "integer", "minimum": 1 },
320
+ "policyVersion": { "type": "integer", "minimum": 1 },
321
+ "validUntil": { "type": "string", "format": "date-time" },
322
+ "accessProfile": { "$ref": "#/$defs/AccessProfile" },
323
+ "protectedResourceIds": {
324
+ "type": "array",
325
+ "maxItems": 2048,
326
+ "uniqueItems": true,
327
+ "items": { "$ref": "#/$defs/Identifier" }
328
+ },
329
+ "networkLeases": {
330
+ "type": "array",
331
+ "maxItems": 256,
332
+ "items": { "$ref": "#/$defs/NetworkLease" }
333
+ },
334
+ "resourceLeases": {
335
+ "type": "array",
336
+ "maxItems": 512,
337
+ "items": { "$ref": "#/$defs/ResourceLease" }
338
+ },
339
+ "runtimeIntervals": { "$ref": "#/$defs/RuntimeIntervals" },
340
+ "wireguard": { "$ref": "#/$defs/WireGuardConfiguration" },
341
+ "mihomo": { "$ref": "#/$defs/MihomoConfiguration" }
342
+ }
343
+ },
344
+ "MihomoBypassHost": {
345
+ "type": "string",
346
+ "minLength": 1,
347
+ "maxLength": 253,
348
+ "pattern": "^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?|[A-Za-z0-9])$"
349
+ },
350
+ "MihomoConfiguration": {
351
+ "type": "object",
352
+ "additionalProperties": false,
353
+ "required": [
354
+ "mode",
355
+ "profileId",
356
+ "profileRevision",
357
+ "mixedPort",
358
+ "controllerPort",
359
+ "dnsMode",
360
+ "selectorGroup",
361
+ "bypassCidrs",
362
+ "bypassHosts",
363
+ "failClosed"
364
+ ],
365
+ "properties": {
366
+ "mode": { "enum": ["managed_follow", "app_subscription"] },
367
+ "sourceType": { "enum": ["managed_subscription", "manual_node"] },
368
+ "profileId": { "$ref": "#/$defs/Identifier" },
369
+ "profileRevision": { "type": "integer", "minimum": 1 },
370
+ "mixedPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
371
+ "controllerPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
372
+ "dnsMode": { "enum": ["disabled", "fake_ip"] },
373
+ "fakeIpRange": { "$ref": "#/$defs/SplitRoute" },
374
+ "selectorGroup": { "type": "string", "minLength": 1, "maxLength": 128 },
375
+ "selectedProxy": { "type": "string", "minLength": 1, "maxLength": 128 },
376
+ "bypassCidrs": {
377
+ "type": "array",
378
+ "maxItems": 256,
379
+ "uniqueItems": true,
380
+ "items": { "$ref": "#/$defs/SplitRoute" }
381
+ },
382
+ "bypassHosts": {
383
+ "type": "array",
384
+ "maxItems": 128,
385
+ "uniqueItems": true,
386
+ "items": { "$ref": "#/$defs/MihomoBypassHost" }
387
+ },
388
+ "failClosed": { "type": "boolean" }
389
+ },
390
+ "allOf": [
391
+ {
392
+ "if": { "properties": { "mode": { "const": "managed_follow" } }, "required": ["mode"] },
393
+ "then": { "properties": { "failClosed": { "const": true } } },
394
+ "else": { "not": { "anyOf": [{ "required": ["sourceType"] }, { "required": ["selectedProxy"] }] } }
395
+ },
396
+ {
397
+ "if": {
398
+ "allOf": [
399
+ { "properties": { "mode": { "const": "managed_follow" } }, "required": ["mode"] },
400
+ { "not": { "properties": { "sourceType": { "const": "manual_node" } }, "required": ["sourceType"] } }
401
+ ]
402
+ },
403
+ "then": { "required": ["selectedProxy"] }
404
+ },
405
+ {
406
+ "if": { "properties": { "sourceType": { "const": "manual_node" } }, "required": ["sourceType"] },
407
+ "then": { "not": { "required": ["selectedProxy"] } }
408
+ },
409
+ {
410
+ "if": { "properties": { "dnsMode": { "const": "fake_ip" } }, "required": ["dnsMode"] },
411
+ "then": { "required": ["fakeIpRange"] },
412
+ "else": { "not": { "required": ["fakeIpRange"] } }
413
+ }
414
+ ]
415
+ },
416
+ "WireGuardPeer": {
417
+ "type": "object",
418
+ "additionalProperties": false,
419
+ "required": ["runtimeId", "publicKey", "allowedIPs", "persistentKeepaliveSeconds"],
420
+ "properties": {
421
+ "runtimeId": { "$ref": "#/$defs/Identifier" },
422
+ "deviceId": { "$ref": "#/$defs/Identifier" },
423
+ "publicKey": { "$ref": "#/$defs/WireGuardPublicKey" },
424
+ "endpointHost": {
425
+ "type": "string",
426
+ "minLength": 1,
427
+ "maxLength": 253,
428
+ "pattern": "^[A-Za-z0-9](?:[A-Za-z0-9.-]{0,251}[A-Za-z0-9])?$"
429
+ },
430
+ "endpointPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
431
+ "allowedIPs": {
432
+ "type": "array",
433
+ "minItems": 1,
434
+ "maxItems": 128,
435
+ "uniqueItems": true,
436
+ "items": { "$ref": "#/$defs/SplitRoute" }
437
+ },
438
+ "persistentKeepaliveSeconds": { "type": "integer", "minimum": 0, "maximum": 300 }
439
+ },
440
+ "dependentRequired": {
441
+ "endpointHost": ["endpointPort"],
442
+ "endpointPort": ["endpointHost"]
443
+ }
444
+ },
445
+ "WireGuardFirewallRule": {
446
+ "type": "object",
447
+ "additionalProperties": false,
448
+ "required": ["id", "effect", "sourceCidr", "destinationCidr", "protocol"],
449
+ "properties": {
450
+ "id": { "$ref": "#/$defs/Identifier" },
451
+ "effect": { "enum": ["allow", "deny"] },
452
+ "leaseId": { "$ref": "#/$defs/Identifier" },
453
+ "siteLinkRuntimeId": { "$ref": "#/$defs/Identifier" },
454
+ "direction": { "enum": ["from_wireguard", "to_wireguard"] },
455
+ "sourceCidr": { "$ref": "#/$defs/SplitRoute" },
456
+ "destinationCidr": { "$ref": "#/$defs/SplitRoute" },
457
+ "protocol": { "enum": ["any", "tcp", "udp", "icmp"] },
458
+ "ports": {
459
+ "type": "array",
460
+ "minItems": 1,
461
+ "maxItems": 64,
462
+ "uniqueItems": true,
463
+ "items": { "type": "integer", "minimum": 1, "maximum": 65535 }
464
+ },
465
+ "expiresAt": { "type": "string", "format": "date-time" }
466
+ },
467
+ "allOf": [
468
+ {
469
+ "if": { "properties": { "effect": { "const": "allow" } }, "required": ["effect"] },
470
+ "then": {
471
+ "required": ["expiresAt"],
472
+ "oneOf": [
473
+ { "required": ["leaseId"], "not": { "required": ["siteLinkRuntimeId"] } },
474
+ { "required": ["siteLinkRuntimeId", "direction"], "not": { "required": ["leaseId"] } }
475
+ ]
476
+ }
477
+ },
478
+ {
479
+ "if": { "properties": { "protocol": { "enum": ["any", "icmp"] } }, "required": ["protocol"] },
480
+ "then": { "not": { "required": ["ports"] } }
481
+ },
482
+ { "not": { "required": ["leaseId", "siteLinkRuntimeId"] } }
483
+ ],
484
+ "dependentRequired": {
485
+ "siteLinkRuntimeId": ["direction", "expiresAt"],
486
+ "direction": ["siteLinkRuntimeId"]
487
+ }
488
+ },
489
+ "WireGuardConfiguration": {
490
+ "type": "object",
491
+ "additionalProperties": false,
492
+ "required": ["role", "interfaceName", "publicKey", "addresses", "mtu", "routingMode", "firewallDefault", "peers", "routes", "firewallRules"],
493
+ "properties": {
494
+ "role": { "enum": ["endpoint", "gateway"] },
495
+ "interfaceName": { "type": "string", "minLength": 1, "maxLength": 15, "pattern": "^[A-Za-z][A-Za-z0-9_.-]*$" },
496
+ "publicKey": { "$ref": "#/$defs/WireGuardPublicKey" },
497
+ "addresses": {
498
+ "type": "array",
499
+ "minItems": 1,
500
+ "maxItems": 8,
501
+ "uniqueItems": true,
502
+ "items": { "$ref": "#/$defs/SplitRoute" }
503
+ },
504
+ "listenPort": { "type": "integer", "minimum": 1, "maximum": 65535 },
505
+ "mtu": { "type": "integer", "minimum": 1280, "maximum": 1500 },
506
+ "routingMode": { "enum": ["routed", "snat"] },
507
+ "firewallDefault": { "const": "deny" },
508
+ "peers": {
509
+ "type": "array",
510
+ "maxItems": 1024,
511
+ "items": { "$ref": "#/$defs/WireGuardPeer" }
512
+ },
513
+ "routes": {
514
+ "type": "array",
515
+ "maxItems": 256,
516
+ "uniqueItems": true,
517
+ "items": { "$ref": "#/$defs/SplitRoute" }
518
+ },
519
+ "dnsServers": {
520
+ "type": "array",
521
+ "maxItems": 8,
522
+ "uniqueItems": true,
523
+ "items": { "$ref": "#/$defs/IPv4Address" }
524
+ },
525
+ "firewallRules": {
526
+ "type": "array",
527
+ "maxItems": 4096,
528
+ "items": { "$ref": "#/$defs/WireGuardFirewallRule" }
529
+ }
530
+ },
531
+ "allOf": [{
532
+ "if": { "properties": { "role": { "const": "gateway" } }, "required": ["role"] },
533
+ "then": { "required": ["listenPort"] }
534
+ }]
535
+ },
536
+ "ConfigurationApplied": {
537
+ "type": "object",
538
+ "additionalProperties": false,
539
+ "required": ["configurationVersion", "policyVersion", "status", "readbackHash"],
540
+ "properties": {
541
+ "configurationVersion": { "type": "integer", "minimum": 1 },
542
+ "policyVersion": { "type": "integer", "minimum": 1 },
543
+ "status": { "enum": ["applied", "rejected", "rolled-back"] },
544
+ "readbackHash": { "type": "string", "pattern": "^sha256:[a-f0-9]{64}$" },
545
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 }
546
+ }
547
+ },
548
+ "LeaseRenewRequest": {
549
+ "type": "object",
550
+ "additionalProperties": false,
551
+ "required": ["sessionId", "leaseIds", "observedConfigurationVersion"],
552
+ "properties": {
553
+ "sessionId": { "$ref": "#/$defs/Identifier" },
554
+ "leaseIds": {
555
+ "type": "array",
556
+ "minItems": 1,
557
+ "maxItems": 512,
558
+ "uniqueItems": true,
559
+ "items": { "$ref": "#/$defs/Identifier" }
560
+ },
561
+ "observedConfigurationVersion": { "type": "integer", "minimum": 1 },
562
+ "postureVersion": { "type": "integer", "minimum": 0 }
563
+ }
564
+ },
565
+ "LeaseRenewResult": {
566
+ "type": "object",
567
+ "additionalProperties": false,
568
+ "required": ["policyVersion", "validUntil", "networkLeases", "resourceLeases", "revokedLeaseIds"],
569
+ "properties": {
570
+ "policyVersion": { "type": "integer", "minimum": 1 },
571
+ "validUntil": { "type": "string", "format": "date-time" },
572
+ "networkLeases": { "type": "array", "maxItems": 256, "items": { "$ref": "#/$defs/NetworkLease" } },
573
+ "resourceLeases": { "type": "array", "maxItems": 512, "items": { "$ref": "#/$defs/ResourceLease" } },
574
+ "revokedLeaseIds": {
575
+ "type": "array",
576
+ "maxItems": 512,
577
+ "uniqueItems": true,
578
+ "items": { "$ref": "#/$defs/Identifier" }
579
+ }
580
+ }
581
+ },
582
+ "LeaseRevoke": {
583
+ "type": "object",
584
+ "additionalProperties": false,
585
+ "required": ["sessionId", "leaseIds", "reasonCode", "effectiveAt"],
586
+ "properties": {
587
+ "sessionId": { "$ref": "#/$defs/Identifier" },
588
+ "leaseIds": {
589
+ "type": "array",
590
+ "minItems": 1,
591
+ "maxItems": 512,
592
+ "uniqueItems": true,
593
+ "items": { "$ref": "#/$defs/Identifier" }
594
+ },
595
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 },
596
+ "effectiveAt": { "type": "string", "format": "date-time" }
597
+ }
598
+ },
599
+ "VPNConnectRequest": {
600
+ "type": "object",
601
+ "additionalProperties": false,
602
+ "required": ["requestId", "siteId", "networkSpaceId", "mode"],
603
+ "properties": {
604
+ "requestId": { "$ref": "#/$defs/Identifier" },
605
+ "siteId": { "$ref": "#/$defs/Identifier" },
606
+ "networkSpaceId": { "$ref": "#/$defs/Identifier" },
607
+ "gatewayId": { "$ref": "#/$defs/Identifier" },
608
+ "mode": { "enum": ["internal_ztna", "external_vpn", "external_vpn_ztna", "external_direct_ztna"] },
609
+ "resourceIds": {
610
+ "type": "array",
611
+ "maxItems": 256,
612
+ "uniqueItems": true,
613
+ "items": { "$ref": "#/$defs/Identifier" }
614
+ },
615
+ "accessGrantId": { "$ref": "#/$defs/Identifier" },
616
+ "accessGrantToken": {
617
+ "type": "string",
618
+ "minLength": 32,
619
+ "maxLength": 512
620
+ }
621
+ },
622
+ "allOf": [{
623
+ "if": { "properties": { "mode": { "const": "external_vpn" } }, "required": ["mode"] },
624
+ "then": {
625
+ "properties": { "resourceIds": { "maxItems": 0 } },
626
+ "not": { "anyOf": [{ "required": ["accessGrantId"] }, { "required": ["accessGrantToken"] }] }
627
+ },
628
+ "else": {
629
+ "required": ["resourceIds", "accessGrantId", "accessGrantToken"],
630
+ "properties": { "resourceIds": { "minItems": 1 } }
631
+ }
632
+ }]
633
+ },
634
+ "VPNConnectResult": {
635
+ "type": "object",
636
+ "additionalProperties": false,
637
+ "required": ["requestId", "decision", "reasonCode", "policyVersion", "validUntil", "networkLeases", "resourceLeases"],
638
+ "properties": {
639
+ "requestId": { "$ref": "#/$defs/Identifier" },
640
+ "decision": { "enum": ["allow", "deny"] },
641
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 },
642
+ "sessionId": { "$ref": "#/$defs/Identifier" },
643
+ "gatewayId": { "$ref": "#/$defs/Identifier" },
644
+ "configurationVersion": { "type": "integer", "minimum": 1 },
645
+ "policyVersion": { "type": "integer", "minimum": 1 },
646
+ "validUntil": { "type": "string", "format": "date-time" },
647
+ "networkLeases": {
648
+ "type": "array",
649
+ "maxItems": 256,
650
+ "items": { "$ref": "#/$defs/NetworkLease" }
651
+ },
652
+ "resourceLeases": {
653
+ "type": "array",
654
+ "maxItems": 512,
655
+ "items": { "$ref": "#/$defs/ResourceLease" }
656
+ }
657
+ },
658
+ "allOf": [{
659
+ "if": { "properties": { "decision": { "const": "allow" } }, "required": ["decision"] },
660
+ "then": {
661
+ "required": ["sessionId", "gatewayId", "configurationVersion"],
662
+ "anyOf": [
663
+ { "properties": { "networkLeases": { "minItems": 1 } } },
664
+ { "properties": { "resourceLeases": { "minItems": 1 } } }
665
+ ]
666
+ },
667
+ "else": {
668
+ "properties": {
669
+ "networkLeases": { "maxItems": 0 },
670
+ "resourceLeases": { "maxItems": 0 }
671
+ }
672
+ }
673
+ }]
674
+ },
675
+ "NASAuthorizationRequest": {
676
+ "type": "object",
677
+ "additionalProperties": false,
678
+ "required": ["requestId", "nasId", "subjectId", "authenticationMethod"],
679
+ "properties": {
680
+ "requestId": { "$ref": "#/$defs/Identifier" },
681
+ "nasId": { "$ref": "#/$defs/Identifier" },
682
+ "subjectId": { "$ref": "#/$defs/Identifier" },
683
+ "deviceId": { "$ref": "#/$defs/Identifier" },
684
+ "stationId": { "$ref": "#/$defs/Identifier" },
685
+ "authenticationMethod": { "enum": ["eap-tls", "password-compatible"] },
686
+ "clientCertificateSerial": { "type": "string", "pattern": "^[A-Fa-f0-9]{1,40}$" },
687
+ "clientCertificateAuthorityKeyId": { "type": "string", "minLength": 16, "maxLength": 191, "pattern": "^[A-Fa-f0-9:]+$" }
688
+ },
689
+ "allOf": [{
690
+ "if": { "properties": { "authenticationMethod": { "const": "eap-tls" } }, "required": ["authenticationMethod"] },
691
+ "then": {
692
+ "required": ["stationId", "clientCertificateSerial", "clientCertificateAuthorityKeyId"],
693
+ "not": { "required": ["deviceId"] }
694
+ },
695
+ "else": {
696
+ "required": ["deviceId"],
697
+ "not": {
698
+ "anyOf": [
699
+ { "required": ["clientCertificateSerial"] },
700
+ { "required": ["clientCertificateAuthorityKeyId"] }
701
+ ]
702
+ }
703
+ }
704
+ }]
705
+ },
706
+ "NASAuthorizationResult": {
707
+ "type": "object",
708
+ "additionalProperties": false,
709
+ "required": ["requestId", "sessionId", "decision", "accessProfile", "policyVersion", "validUntil", "reasonCode"],
710
+ "properties": {
711
+ "requestId": { "$ref": "#/$defs/Identifier" },
712
+ "sessionId": { "$ref": "#/$defs/Identifier" },
713
+ "decision": { "enum": ["allow", "deny"] },
714
+ "accessProfile": { "$ref": "#/$defs/AccessProfile" },
715
+ "policyVersion": { "type": "integer", "minimum": 1 },
716
+ "validUntil": { "type": "string", "format": "date-time" },
717
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 },
718
+ "radiusAttributes": { "$ref": "#/$defs/RadiusAttributes" }
719
+ }
720
+ },
721
+ "NASSessionCommand": {
722
+ "type": "object",
723
+ "additionalProperties": false,
724
+ "required": ["commandId", "sessionId", "nasId", "subjectId", "deviceId", "action", "targetAccessProfile", "policyVersion", "effectiveAt", "reasonCode"],
725
+ "properties": {
726
+ "commandId": { "$ref": "#/$defs/Identifier" },
727
+ "sessionId": { "$ref": "#/$defs/Identifier" },
728
+ "nasId": { "$ref": "#/$defs/Identifier" },
729
+ "subjectId": { "$ref": "#/$defs/Identifier" },
730
+ "deviceId": { "$ref": "#/$defs/Identifier" },
731
+ "action": { "enum": ["coa", "disconnect"] },
732
+ "targetAccessProfile": { "$ref": "#/$defs/AccessProfile" },
733
+ "policyVersion": { "type": "integer", "minimum": 1 },
734
+ "effectiveAt": { "type": "string", "format": "date-time" },
735
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 },
736
+ "radiusAttributes": { "$ref": "#/$defs/RadiusAttributes" }
737
+ }
738
+ },
739
+ "NASSessionCommandResult": {
740
+ "type": "object",
741
+ "additionalProperties": false,
742
+ "required": ["commandId", "sessionId", "status", "reasonCode", "completedAt"],
743
+ "properties": {
744
+ "commandId": { "$ref": "#/$defs/Identifier" },
745
+ "sessionId": { "$ref": "#/$defs/Identifier" },
746
+ "status": { "enum": ["applied", "rejected", "unsupported", "timed-out"] },
747
+ "reasonCode": { "type": "string", "minLength": 1, "maxLength": 128 },
748
+ "completedAt": { "type": "string", "format": "date-time" }
749
+ }
750
+ }
751
+ }
752
+ }