@opensoha/contracts 0.1.26 → 0.1.27
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/COMPATIBILITY.md +10 -0
- package/auth/catalog_generated.go +2 -2
- package/auth/permission-catalog.json +481 -1
- package/compat/json-schema-ecosystem-0.1.0.json +1 -1
- package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
- package/endpointcontrol/decode.go +64 -0
- package/endpointcontrol/models.go +138 -0
- package/endpointcontrol/models_test.go +51 -0
- package/endpointcontrol/protocol.schema.json +397 -0
- package/fixtures/json-schema/endpoint-controls/invalid/controls.json +16 -0
- package/fixtures/json-schema/endpoint-controls/invalid/missing-channel-decision.json +15 -0
- package/fixtures/json-schema/endpoint-controls/invalid/receipt-content.json +36 -0
- package/fixtures/json-schema/endpoint-controls/valid/controls.json +16 -0
- package/fixtures/json-schema/endpoint-controls/valid/receipt.json +35 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/eap-activate-bad-fingerprint.json +14 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/eap-gateway-request.json +14 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/eap-private-key-request.json +15 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/eap-profile-without-eap-credential.json +22 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/endpoint-dns-observation.json +25 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/gateway-presence.json +22 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/mihomo-protection-zero-version.json +45 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/presence-raw-key.json +23 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/presence-zero-sequence.json +22 -0
- package/fixtures/json-schema/network-runtime-protocol/invalid/workload-wide-vpn.json +17 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/eap-certificate-activate.json +14 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/eap-certificate-request.json +14 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/eap-profile-enrollment.json +24 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/endpoint-presence.json +22 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/ipv6-configuration.json +102 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/mihomo-protected-policy.json +45 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/site-dns-ipv6.json +25 -0
- package/fixtures/json-schema/network-runtime-protocol/valid/workload-direct-ztna.json +20 -0
- package/fixtures/openapi/DLPShadowDecision/invalid/step-up-type.json +14 -0
- package/fixtures/openapi/DLPShadowDecision/valid/archive-v2.json +14 -0
- package/fixtures/openapi/DLPShadowDecision/valid/step-up.json +14 -0
- package/fixtures/openapi/DLPShadowInput/invalid/self-reported-result.json +7 -0
- package/fixtures/openapi/DLPShadowInput/invalid/too-many-samples.json +14 -0
- package/fixtures/openapi/DLPShadowInput/valid/bounded.json +7 -0
- package/fixtures/openapi/DockerVolumeDLPAppealInput/invalid/p4-response.json +3 -0
- package/fixtures/openapi/DockerVolumeDLPAppealInput/valid/p4-response.json +3 -0
- package/fixtures/openapi/DockerVolumeDLPAppealReviewInput/invalid/p4-response.json +5 -0
- package/fixtures/openapi/DockerVolumeDLPAppealReviewInput/valid/p4-response.json +5 -0
- package/fixtures/openapi/DockerVolumeDLPAuthorizationInput/invalid/p4-response.json +3 -0
- package/fixtures/openapi/DockerVolumeDLPAuthorizationInput/valid/p4-response.json +3 -0
- package/fixtures/openapi/DockerVolumeDLPContent/invalid/archive-unsupported-channel.json +9 -0
- package/fixtures/openapi/DockerVolumeDLPContent/invalid/p4.json +6 -0
- package/fixtures/openapi/DockerVolumeDLPContent/invalid/step-up-audit.json +9 -0
- package/fixtures/openapi/DockerVolumeDLPContent/invalid/unavailable-engine.json +9 -0
- package/fixtures/openapi/DockerVolumeDLPContent/invalid/unknown-data-level.json +12 -0
- package/fixtures/openapi/DockerVolumeDLPContent/valid/classified-rule.json +16 -0
- package/fixtures/openapi/DockerVolumeDLPContent/valid/p4.json +8 -0
- package/fixtures/openapi/DockerVolumeDLPContent/valid/step-up.json +9 -0
- package/fixtures/openapi/DockerVolumeDLPDecision/invalid/p4.json +9 -0
- package/fixtures/openapi/DockerVolumeDLPDecision/invalid/step-up-type.json +12 -0
- package/fixtures/openapi/DockerVolumeDLPDecision/valid/archive-v2.json +12 -0
- package/fixtures/openapi/DockerVolumeDLPDecision/valid/p4.json +11 -0
- package/fixtures/openapi/DockerVolumeDLPDecision/valid/step-up.json +12 -0
- package/fixtures/openapi/DockerVolumeDLPSaveInput/invalid/p4.json +11 -0
- package/fixtures/openapi/DockerVolumeDLPSaveInput/valid/p4.json +11 -0
- package/fixtures/openapi/DockerVolumeFileReadInput/invalid/p4-response.json +5 -0
- package/fixtures/openapi/DockerVolumeFileReadInput/valid/p4-response.json +4 -0
- package/fixtures/openapi/EndpointDeviceInput/invalid/reported-management.json +5 -0
- package/fixtures/openapi/EndpointDeviceInput/valid/management-state.json +5 -0
- package/fixtures/openapi/EndpointDeviceRegistrationInput/invalid/self-promote-management.json +5 -0
- package/fixtures/openapi/ManagedContentPasteInput/invalid/boundary.json +5 -0
- package/fixtures/openapi/ManagedContentPasteInput/valid/boundary.json +6 -0
- package/fixtures/openapi/ManagedContentPolicy/invalid/self-reported-allow.json +8 -0
- package/fixtures/openapi/ManagedContentPolicy/invalid/step-up-audit.json +8 -0
- package/fixtures/openapi/ManagedContentPolicy/invalid/unknown-extractor.json +8 -0
- package/fixtures/openapi/ManagedContentPolicy/valid/archive-v2.json +8 -0
- package/fixtures/openapi/ManagedContentPolicy/valid/network-and-level.json +10 -0
- package/fixtures/openapi/ManagedContentPolicy/valid/step-up.json +8 -0
- package/fixtures/openapi/ManagedContentReviewInput/invalid/boundary.json +5 -0
- package/fixtures/openapi/ManagedContentReviewInput/valid/boundary.json +5 -0
- package/fixtures/openapi/ManagedContentSaveInput/invalid/boundary.json +14 -0
- package/fixtures/openapi/ManagedContentSaveInput/valid/boundary.json +16 -0
- package/fixtures/openapi/ManagedContentUploadInput/invalid/boundary.json +7 -0
- package/fixtures/openapi/ManagedContentUploadInput/valid/boundary.json +6 -0
- package/fixtures/openapi/NetworkAccessPolicyInput/invalid/unknown-management-state.json +35 -0
- package/fixtures/openapi/NetworkAccessPolicyInput/valid/managed-device.json +35 -0
- package/fixtures/openapi/NetworkAdmissionPreviewRequest/invalid/deviceId-characters.json +4 -0
- package/fixtures/openapi/NetworkAdmissionPreviewRequest/invalid/nasBindingId-characters.json +4 -0
- package/fixtures/openapi/NetworkAdmissionPreviewRequest/invalid/subject-override.json +1 -0
- package/fixtures/openapi/NetworkAdmissionPreviewRequest/valid/device-nas.json +1 -0
- package/fixtures/openapi/NetworkAdmissionPreviewResult/invalid/missing-attributeVersion.json +13 -0
- package/fixtures/openapi/NetworkAdmissionPreviewResult/invalid/missing-evaluatedAt.json +13 -0
- package/fixtures/openapi/NetworkAdmissionPreviewResult/valid/versioned.json +14 -0
- package/fixtures/openapi/NetworkConflictAnalysisRequest/invalid/missing-runtime-ranges.json +1 -0
- package/fixtures/openapi/NetworkConflictAnalysisRequest/invalid/unknown-source-type.json +9 -0
- package/fixtures/openapi/NetworkConflictAnalysisRequest/valid/empty-runtime-ranges.json +3 -0
- package/fixtures/openapi/NetworkConflictAnalysisRequest/{invalid → valid}/ipv6-range.json +1 -1
- package/fixtures/openapi/NetworkEAPServerTrust/invalid/no-server-validation.json +5 -0
- package/fixtures/openapi/NetworkEAPServerTrust/valid/named-server.json +9 -0
- package/fixtures/openapi/NetworkEndpointResponsePolicyInput/invalid/all-sites-implicit.json +45 -0
- package/fixtures/openapi/NetworkEndpointResponsePolicyInput/invalid/unbounded-stages.json +54 -0
- package/fixtures/openapi/NetworkEndpointResponsePolicyInput/invalid/zero-heartbeat.json +47 -0
- package/fixtures/openapi/NetworkEndpointResponsePolicyInput/valid/staged-protection.json +47 -0
- package/fixtures/openapi/NetworkEndpointResponseRestoreInput/invalid/missing-reason.json +3 -0
- package/fixtures/openapi/NetworkEndpointResponseRestoreInput/valid/expected-current.json +4 -0
- package/fixtures/openapi/NetworkPolicyPreviewResult/invalid/attribute-version.json +1 -0
- package/fixtures/openapi/NetworkPolicyPreviewResult/valid/admission-version.json +1 -0
- package/fixtures/openapi/NetworkPolicySubjects/invalid/duplicate-role.json +1 -0
- package/fixtures/openapi/NetworkPolicySubjects/invalid/role-characters.json +5 -0
- package/fixtures/openapi/NetworkPolicySubjects/valid/role-bound.json +1 -0
- package/fixtures/openapi/NetworkProxyConfigurationInput/invalid/missing-content.json +1 -0
- package/fixtures/openapi/NetworkProxyConfigurationPatchInput/invalid/bad-binding-id.json +9 -0
- package/fixtures/openapi/NetworkProxyConfigurationPatchInput/invalid/empty-content.json +1 -0
- package/fixtures/openapi/NetworkProxyConfigurationPatchInput/valid/binding-only.json +11 -0
- package/fixtures/openapi/NetworkProxyConfigurationPatchInput/valid/clear-binding-disabled.json +5 -0
- package/fixtures/openapi/NetworkProxyConfigurationPatchInput/valid/enabled.json +1 -0
- package/fixtures/openapi/NetworkSiteInput/invalid/unknown-governance.json +6 -0
- package/fixtures/openapi/NetworkSiteInput/valid/restricted-unmanaged.json +6 -0
- package/gen/go/sohaapi/client.go +1 -1
- package/gen/go/sohaapi/proxy_configuration_test.go +38 -0
- package/gen/go/sohaapi/types.go +2825 -196
- package/gen/ts/sohaapi/index.ts +14533 -9883
- package/network/README.md +34 -0
- package/network/network-radius-accounting.schema.json +4 -1
- package/network/network-runtime-protocol.schema.json +2166 -317
- package/network/proxy-runtime.schema.json +482 -67
- package/openapi/network_control_test.go +64 -0
- package/openapi/soha-api.json +52989 -45064
- package/openapi/soha-api.yaml +26472 -20872
- package/openapi/spec_generated.go +3 -3
- package/package.json +6 -3
- package/proxytransport/handler.go +271 -0
- package/proxytransport/probe.go +30 -0
- package/proxytransport/scope.go +89 -0
- package/proxytransport/transport_test.go +60 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expectedRevision": 0,
|
|
3
|
+
"configuration": {
|
|
4
|
+
"name": "Office service protection",
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"siteIds": [
|
|
7
|
+
"site-lab"
|
|
8
|
+
],
|
|
9
|
+
"nasBindingIds": [
|
|
10
|
+
"nas-lab"
|
|
11
|
+
],
|
|
12
|
+
"deviceIds": [
|
|
13
|
+
"endpoint-lab"
|
|
14
|
+
],
|
|
15
|
+
"subjects": {
|
|
16
|
+
"users": [],
|
|
17
|
+
"teams": [],
|
|
18
|
+
"tags": []
|
|
19
|
+
},
|
|
20
|
+
"signal": "service_unavailable",
|
|
21
|
+
"requireHealthyForAdmission": true,
|
|
22
|
+
"heartbeatIntervalSeconds": 0,
|
|
23
|
+
"missedHeartbeats": 3,
|
|
24
|
+
"gracePeriodSeconds": 30,
|
|
25
|
+
"accountingFreshnessSeconds": 120,
|
|
26
|
+
"restoreHeartbeats": 3,
|
|
27
|
+
"restoreObservationSeconds": 60,
|
|
28
|
+
"autoRestore": false,
|
|
29
|
+
"steps": [
|
|
30
|
+
{
|
|
31
|
+
"afterSeconds": 0,
|
|
32
|
+
"action": "notify"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"afterSeconds": 60,
|
|
36
|
+
"action": "restrict",
|
|
37
|
+
"targetAccessProfile": "restricted"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"afterSeconds": 180,
|
|
41
|
+
"action": "disconnect"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"failureAction": "disconnect",
|
|
45
|
+
"notificationPolicyId": "notifications-lab"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"expectedRevision": 0,
|
|
3
|
+
"configuration": {
|
|
4
|
+
"name": "Office service protection",
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"siteIds": [
|
|
7
|
+
"site-lab"
|
|
8
|
+
],
|
|
9
|
+
"nasBindingIds": [
|
|
10
|
+
"nas-lab"
|
|
11
|
+
],
|
|
12
|
+
"deviceIds": [
|
|
13
|
+
"endpoint-lab"
|
|
14
|
+
],
|
|
15
|
+
"subjects": {
|
|
16
|
+
"users": [],
|
|
17
|
+
"teams": [],
|
|
18
|
+
"tags": []
|
|
19
|
+
},
|
|
20
|
+
"signal": "service_unavailable",
|
|
21
|
+
"requireHealthyForAdmission": true,
|
|
22
|
+
"heartbeatIntervalSeconds": 30,
|
|
23
|
+
"missedHeartbeats": 3,
|
|
24
|
+
"gracePeriodSeconds": 30,
|
|
25
|
+
"accountingFreshnessSeconds": 120,
|
|
26
|
+
"restoreHeartbeats": 3,
|
|
27
|
+
"restoreObservationSeconds": 60,
|
|
28
|
+
"autoRestore": false,
|
|
29
|
+
"steps": [
|
|
30
|
+
{
|
|
31
|
+
"afterSeconds": 0,
|
|
32
|
+
"action": "notify"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"afterSeconds": 60,
|
|
36
|
+
"action": "restrict",
|
|
37
|
+
"targetAccessProfile": "restricted"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"afterSeconds": 180,
|
|
41
|
+
"action": "disconnect"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"failureAction": "disconnect",
|
|
45
|
+
"notificationPolicyId": "notifications-lab"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"decision":"allow","path":"site_direct","policyVersion":2,"attributeVersion":"unversioned","protected":false,"networkLeaseRequired":false,"resourceLeaseRequired":false,"reasons":["policy_allow:office"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"decision":"allow","path":"site_direct","policyVersion":2,"attributeVersion":"sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","evaluatedAt":"2026-10-15T05:00:00Z","protected":false,"networkLeaseRequired":false,"resourceLeaseRequired":false,"networkProfile":"restricted","reasons":["policy_allow:office"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"users":[],"teams":[],"tags":[],"roles":["network-staff","network-staff"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"users":[],"teams":[],"tags":[],"roles":["network-staff"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"expectedRevision":0,"enabled":true}
|
|
@@ -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"}
|
package/gen/go/sohaapi/client.go
CHANGED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
package sohaapi
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
"encoding/json"
|
|
5
|
+
"strings"
|
|
6
|
+
"testing"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
// These assignments protect source compatibility for existing SDK consumers.
|
|
10
|
+
var (
|
|
11
|
+
_ string = NetworkProxyConfigurationInput{}.Content
|
|
12
|
+
_ string = UpdateNetworkProxyConfigurationJSONRequestBody{}.Content
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
func TestProxyPartialInputKeepsOmissionSeparateFromEmptyContent(t *testing.T) {
|
|
16
|
+
var input NetworkProxyConfigurationPatchInput
|
|
17
|
+
if err := json.Unmarshal([]byte(`{"expectedRevision":4,"enabled":false,"clearBinding":true}`), &input); err != nil {
|
|
18
|
+
t.Fatal(err)
|
|
19
|
+
}
|
|
20
|
+
if input.Content != nil || !input.ClearBinding {
|
|
21
|
+
t.Fatalf("partial input = %#v", input)
|
|
22
|
+
}
|
|
23
|
+
payload, err := json.Marshal(input)
|
|
24
|
+
if err != nil || strings.Contains(string(payload), `"content"`) {
|
|
25
|
+
t.Fatalf("omitted content encoded as %s, %v", payload, err)
|
|
26
|
+
}
|
|
27
|
+
if err := json.Unmarshal([]byte(`{"expectedRevision":4,"enabled":true,"content":""}`), &input); err != nil {
|
|
28
|
+
t.Fatal(err)
|
|
29
|
+
}
|
|
30
|
+
if input.Content == nil || *input.Content != "" {
|
|
31
|
+
t.Fatal("explicit empty content lost its presence for server-side rejection")
|
|
32
|
+
}
|
|
33
|
+
legacy := UpdateNetworkProxyConfigurationJSONRequestBody{ExpectedRevision: 4, Enabled: true, Content: "mode: rule"}
|
|
34
|
+
payload, err = json.Marshal(legacy)
|
|
35
|
+
if err != nil || !strings.Contains(string(payload), `"content":"mode: rule"`) {
|
|
36
|
+
t.Fatalf("legacy full input = %s, %v", payload, err)
|
|
37
|
+
}
|
|
38
|
+
}
|