Files
VerseVDI-Protocol/schemas/control-v1.schema.json
T
sechmachine 357e5e0dbc
Verify Protocol / verify (push) Canceled after 0s
Verify Protocol / module (push) Successful in 2m30s
feat(protocol): add gateway provider session work
2026-07-29 11:10:32 +07:00

501 lines
24 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://protocol.versevdi.invalid/schemas/control-v1.schema.json",
"title": "VerseVDI Phase 3A control contract",
"type": "object",
"additionalProperties": false,
"$defs": {
"FieldViolation": {
"type": "object",
"additionalProperties": false,
"required": ["field", "code"],
"properties": {
"field": {"type": "string", "minLength": 1, "maxLength": 128},
"code": {"type": "string", "minLength": 1, "maxLength": 64}
}
},
"ErrorEnvelope": {
"type": "object",
"additionalProperties": false,
"required": ["status", "error", "code", "message", "resolution", "request_id", "violations"],
"properties": {
"status": {"type": "boolean"},
"error": {"type": "string", "minLength": 1, "maxLength": 512},
"code": {"type": "string", "minLength": 1, "maxLength": 128},
"message": {"type": "string", "minLength": 1, "maxLength": 512},
"resolution": {"type": "string", "minLength": 1, "maxLength": 128},
"request_id": {"type": "string", "minLength": 1, "maxLength": 128},
"violations": {"type": "array", "maxItems": 16, "items": {"$ref": "#/$defs/FieldViolation"}}
}
},
"PageInfo": {
"type": "object",
"additionalProperties": false,
"required": ["limit", "next_cursor"],
"properties": {
"limit": {"type": "integer", "minimum": 1, "maximum": 100},
"next_cursor": {"type": "string", "maxLength": 512}
}
},
"ResourceLink": {
"type": "object",
"additionalProperties": false,
"required": ["type", "id", "version"],
"properties": {
"type": {"type": "string", "minLength": 1, "maxLength": 64},
"id": {"type": "string", "minLength": 1, "maxLength": 128},
"version": {"type": "integer", "minimum": 1}
}
},
"Resource": {
"type": "object",
"additionalProperties": false,
"required": ["id", "kind", "name", "state", "version", "links"],
"properties": {
"id": {"type": "string", "minLength": 1, "maxLength": 128},
"kind": {"type": "string", "minLength": 1, "maxLength": 64},
"name": {"type": "string", "minLength": 1, "maxLength": 256},
"state": {"type": "string", "minLength": 1, "maxLength": 64},
"assignment_state": {"type": "string", "maxLength": 64},
"version": {"type": "integer", "minimum": 1},
"links": {"type": "array", "maxItems": 16, "items": {"$ref": "#/$defs/ResourceLink"}}
}
},
"AssignedDesktop": {
"type": "object",
"additionalProperties": false,
"required": ["assignment_id", "pool_id", "name", "availability"],
"properties": {
"assignment_id": {"type": "string", "minLength": 1, "maxLength": 128},
"pool_id": {"type": "string", "minLength": 1, "maxLength": 128},
"name": {"type": "string", "minLength": 1, "maxLength": 256},
"availability": {"type": "string", "minLength": 1, "maxLength": 64}
}
},
"EntitledPool": {
"type": "object",
"additionalProperties": false,
"required": ["pool_id", "name", "assignment_state"],
"properties": {
"pool_id": {"type": "string", "minLength": 1, "maxLength": 128},
"name": {"type": "string", "minLength": 1, "maxLength": 256},
"assignment_state": {"type": "string", "minLength": 1, "maxLength": 64}
}
},
"ResourceList": {
"type": "object",
"additionalProperties": false,
"required": ["assigned_desktops", "entitled_pools", "page"],
"properties": {
"assigned_desktops": {"type": "array", "maxItems": 100, "items": {"$ref": "#/$defs/AssignedDesktop"}},
"entitled_pools": {"type": "array", "maxItems": 100, "items": {"$ref": "#/$defs/EntitledPool"}},
"page": {"$ref": "#/$defs/PageInfo"}
}
},
"DeviceRegistrationRequest": {
"type": "object",
"additionalProperties": false,
"required": ["name", "platform", "device_subject", "algorithm", "public_key"],
"properties": {
"name": {"type": "string", "minLength": 1, "maxLength": 128},
"platform": {"type": "string", "minLength": 1, "maxLength": 64},
"device_subject": {"type": "string", "minLength": 1, "maxLength": 256},
"algorithm": {"type": "string", "const": "ed25519"},
"public_key": {"type": "string", "minLength": 1, "maxLength": 256}
}
},
"DeviceChallenge": {
"type": "object",
"additionalProperties": false,
"required": ["device_id", "server_id", "principal_id", "challenge", "expires_at", "algorithm", "signature_format"],
"properties": {
"device_id": {"type": "string", "minLength": 1, "maxLength": 128},
"server_id": {"type": "string", "minLength": 1, "maxLength": 128},
"principal_id": {"type": "string", "minLength": 1, "maxLength": 128},
"challenge": {"type": "string", "minLength": 1, "maxLength": 256},
"expires_at": {"type": "string", "format": "date-time", "maxLength": 64},
"algorithm": {"type": "string", "const": "ed25519"},
"signature_format": {"type": "string", "const": "ed25519-domain-separated-v1"}
}
},
"DeviceProofRequest": {
"type": "object",
"additionalProperties": false,
"required": ["challenge", "signature"],
"properties": {
"challenge": {"type": "string", "minLength": 1, "maxLength": 256},
"signature": {"type": "string", "minLength": 1, "maxLength": 256}
}
},
"LoginRequest": {
"type": "object",
"additionalProperties": false,
"required": ["username", "password"],
"properties": {
"provider": {"type": "string", "enum": ["ldap", "local"]},
"username": {"type": "string", "minLength": 1, "maxLength": 256},
"password": {"type": "string", "minLength": 1, "maxLength": 1024}
}
},
"ReauthRequest": {
"type": "object",
"additionalProperties": false,
"required": ["password", "purpose"],
"properties": {
"password": {"type": "string", "minLength": 1, "maxLength": 1024},
"purpose": {"type": "string", "enum": ["identity_change", "key_change", "backup_enable", "external_database_tls_disabled", "assignment_change"]}
}
},
"ReauthGrant": {
"type": "object",
"additionalProperties": false,
"required": ["token", "purpose", "expires_at"],
"properties": {
"token": {"type": "string", "minLength": 1, "maxLength": 256},
"purpose": {"type": "string", "minLength": 1, "maxLength": 64},
"expires_at": {"type": "string", "format": "date-time", "maxLength": 64}
}
},
"RefreshRequest": {
"type": "object",
"additionalProperties": false,
"required": ["family_id", "refresh_token"],
"properties": {
"family_id": {"type": "string", "minLength": 1, "maxLength": 128},
"refresh_token": {"type": "string", "minLength": 1, "maxLength": 256}
}
},
"NativeCredential": {
"type": "object",
"additionalProperties": false,
"required": ["family_id", "access_token", "refresh_token", "expires_at"],
"properties": {
"device_id": {"type": "string", "maxLength": 128},
"family_id": {"type": "string", "minLength": 1, "maxLength": 128},
"access_token": {"type": "string", "minLength": 1, "maxLength": 256},
"refresh_token": {"type": "string", "minLength": 1, "maxLength": 256},
"expires_at": {"type": "string", "format": "date-time", "maxLength": 64},
"refresh_expires_at": {"type": "string", "format": "date-time", "maxLength": 64}
}
},
"SessionRequest": {
"type": "object",
"additionalProperties": false,
"required": ["client_device_id", "device_key_id", "pool_id", "idempotency_key", "policy_snapshot"],
"properties": {
"client_device_id": {"type": "string", "minLength": 1, "maxLength": 128},
"device_key_id": {"type": "string", "minLength": 1, "maxLength": 128},
"pool_id": {"type": "string", "minLength": 1, "maxLength": 128},
"idempotency_key": {"type": "string", "minLength": 1, "maxLength": 256},
"policy_snapshot": {"$ref": "#/$defs/AllocationPolicy"}
}
},
"ReconnectRequest": {
"type": "object",
"additionalProperties": false,
"required": ["client_device_id", "device_key_id", "expected_version"],
"properties": {
"client_device_id": {"type": "string", "minLength": 1, "maxLength": 128},
"device_key_id": {"type": "string", "minLength": 1, "maxLength": 128},
"expected_version": {"type": "integer", "minimum": 1}
}
},
"BrokerSession": {
"type": "object",
"additionalProperties": false,
"required": ["id", "principal_id", "pool_id", "state", "policy_snapshot", "cleanup_state", "idempotency_key", "correlation_id", "requested_at", "version"],
"properties": {
"id": {"type": "string", "minLength": 1, "maxLength": 128},
"principal_id": {"type": "string", "minLength": 1, "maxLength": 128},
"pool_id": {"type": "string", "minLength": 1, "maxLength": 128},
"assignment_id": {"type": "string", "maxLength": 128},
"state": {"type": "string", "minLength": 1, "maxLength": 64},
"policy_snapshot": {"$ref": "#/$defs/AllocationPolicy"},
"reconnect_deadline": {"type": "string", "format": "date-time", "maxLength": 64},
"outcome": {"type": "string", "maxLength": 64},
"failure_code": {"type": "string", "maxLength": 128},
"cleanup_state": {"type": "string", "minLength": 1, "maxLength": 64},
"idempotency_key": {"type": "string", "minLength": 1, "maxLength": 256},
"correlation_id": {"type": "string", "minLength": 1, "maxLength": 128},
"requested_at": {"type": "string", "format": "date-time", "maxLength": 64},
"ended_at": {"type": "string", "format": "date-time", "maxLength": 64},
"version": {"type": "integer", "minimum": 1}
}
},
"AllocationPolicy": {
"type": "object",
"additionalProperties": false,
"required": ["minimum_kbps", "target_kbps", "maximum_kbps", "tier", "audience", "protocol", "protocol_version", "grant_ttl_seconds", "reservation_lease_seconds"],
"properties": {
"minimum_kbps": {"type": "integer", "minimum": 1, "maximum": 100000000},
"target_kbps": {"type": "integer", "minimum": 1, "maximum": 100000000},
"maximum_kbps": {"type": "integer", "minimum": 1, "maximum": 100000000},
"tier": {"type": "string", "enum": ["standard", "priority", "premium"]},
"audience": {"type": "string", "minLength": 1, "maxLength": 256},
"protocol": {"type": "string", "minLength": 1, "maxLength": 64},
"protocol_version": {"type": "integer", "minimum": 1, "maximum": 100},
"grant_ttl_seconds": {"type": "integer", "minimum": 5, "maximum": 300},
"reservation_lease_seconds": {"type": "integer", "minimum": 5, "maximum": 3600}
}
},
"ConnectionManifest": {
"type": "object",
"additionalProperties": false,
"required": ["version", "purpose", "session_id", "reconnect_sequence", "gateway", "tunnel", "profile", "grant", "correlation_id"],
"properties": {
"version": {"type": "string", "const": "1"},
"purpose": {"type": "string", "enum": ["launch", "reconnect"]},
"session_id": {"type": "string", "minLength": 1, "maxLength": 128},
"reconnect_sequence": {"type": "integer", "minimum": 0},
"gateway": {"$ref": "#/$defs/ManifestGateway"},
"tunnel": {"$ref": "#/$defs/ManifestTunnel"},
"profile": {"$ref": "#/$defs/ManifestProfile"},
"grant": {"$ref": "#/$defs/GrantReference"},
"correlation_id": {"type": "string", "minLength": 1, "maxLength": 128}
}
},
"ManifestGateway": {
"type": "object",
"additionalProperties": false,
"required": ["id", "addresses", "public_identity"],
"properties": {
"id": {"type": "string", "minLength": 1, "maxLength": 128},
"addresses": {"type": "array", "minItems": 1, "maxItems": 4, "items": {"type": "string", "minLength": 1, "maxLength": 256}},
"public_identity": {"type": "string", "minLength": 1, "maxLength": 256}
}
},
"ManifestTunnel": {
"type": "object",
"additionalProperties": false,
"required": ["versions", "features"],
"properties": {
"versions": {"type": "array", "minItems": 1, "maxItems": 4, "items": {"type": "string", "minLength": 1, "maxLength": 64}},
"features": {"type": "array", "maxItems": 32, "items": {"type": "string", "minLength": 1, "maxLength": 64}}
}
},
"ManifestProfile": {
"type": "object",
"additionalProperties": false,
"required": ["id", "bounds"],
"properties": {
"id": {"type": "string", "minLength": 1, "maxLength": 128},
"bounds": {"$ref": "#/$defs/ManifestBounds"}
}
},
"ManifestBounds": {
"type": "object",
"additionalProperties": false,
"required": ["minimum_kbps", "target_kbps", "maximum_kbps"],
"properties": {
"minimum_kbps": {"type": "integer", "minimum": 1, "maximum": 100000000},
"target_kbps": {"type": "integer", "minimum": 1, "maximum": 100000000},
"maximum_kbps": {"type": "integer", "minimum": 1, "maximum": 100000000}
}
},
"GrantReference": {
"type": "object",
"additionalProperties": false,
"required": ["opaque_value", "expires_at", "audience"],
"properties": {
"opaque_value": {"type": "string", "minLength": 43, "maxLength": 256},
"expires_at": {"type": "string", "format": "date-time", "maxLength": 64},
"audience": {"type": "string", "minLength": 1, "maxLength": 128}
}
},
"EventResume": {
"type": "object",
"additionalProperties": false,
"required": ["cursor", "last_sequence"],
"properties": {
"cursor": {"type": "string", "maxLength": 512},
"last_sequence": {"type": "integer", "minimum": 0}
}
},
"EventEnvelope": {
"type": "object",
"additionalProperties": false,
"required": ["event_id", "sequence", "type", "version", "resource", "occurred_at", "correlation_id", "payload"],
"properties": {
"event_id": {"type": "string", "minLength": 1, "maxLength": 128},
"sequence": {"type": "integer", "minimum": 1},
"type": {"type": "string", "minLength": 1, "maxLength": 128},
"version": {"type": "integer", "minimum": 1},
"resource": {"$ref": "#/$defs/ResourceLink"},
"occurred_at": {"type": "string", "format": "date-time", "maxLength": 64},
"correlation_id": {"type": "string", "minLength": 1, "maxLength": 128},
"payload": {"type": "object", "x-max-bytes": 16384}
}
},
"ClipboardText": {
"type": "object",
"additionalProperties": false,
"required": ["text", "encoding"],
"properties": {
"text": {"type": "string", "maxLength": 65536},
"encoding": {"type": "string", "const": "utf-8"}
}
},
"VersionNegotiation": {
"type": "object",
"additionalProperties": false,
"required": ["supported_versions", "features"],
"properties": {
"supported_versions": {"type": "array", "minItems": 1, "maxItems": 3, "items": {"type": "string", "maxLength": 16}},
"features": {"type": "array", "maxItems": 64, "items": {"type": "string", "maxLength": 64}}
}
},
"CapabilityProfile": {
"type": "object",
"additionalProperties": false,
"required": ["transport", "framing", "media", "audio", "source_rate_control", "client_decode"],
"properties": {
"transport": {"type": "string", "minLength": 1, "maxLength": 64},
"framing": {"type": "string", "minLength": 1, "maxLength": 64},
"media": {"type": "string", "minLength": 1, "maxLength": 64},
"audio": {"type": "string", "minLength": 1, "maxLength": 64},
"source_rate_control": {"type": "string", "minLength": 1, "maxLength": 64},
"client_decode": {"type": "string", "minLength": 1, "maxLength": 64}
}
},
"GatewayRegistration": {
"type": "object",
"additionalProperties": false,
"required": ["version", "gateway_id", "instance_identity", "certificate_identity", "public_identity", "address", "provider_identity", "protocol_min_version", "protocol_max_version", "connection_capacity", "bandwidth_capacity_kbps", "features", "capabilities"],
"properties": {
"version": {"type": "string", "const": "1"},
"gateway_id": {"type": "string", "minLength": 1, "maxLength": 128},
"instance_identity": {"type": "string", "minLength": 1, "maxLength": 512},
"certificate_identity": {"type": "string", "minLength": 1, "maxLength": 512},
"public_identity": {"type": "string", "minLength": 1, "maxLength": 256},
"address": {"type": "string", "minLength": 1, "maxLength": 256},
"provider_identity": {"type": "string", "minLength": 1, "maxLength": 256},
"protocol_min_version": {"type": "integer", "minimum": 1, "maximum": 100},
"protocol_max_version": {"type": "integer", "minimum": 1, "maximum": 100},
"connection_capacity": {"type": "integer", "minimum": 1, "maximum": 1000000},
"bandwidth_capacity_kbps": {"type": "integer", "minimum": 1, "maximum": 1000000000},
"features": {"type": "array", "maxItems": 64, "items": {"type": "string", "minLength": 1, "maxLength": 64}},
"capabilities": {"$ref": "#/$defs/CapabilityProfile"}
}
},
"GatewayHeartbeat": {
"type": "object",
"additionalProperties": false,
"required": ["version", "gateway_id", "sequence", "observed_at", "active_connections", "egress_kbps", "state"],
"properties": {
"version": {"type": "string", "const": "1"},
"gateway_id": {"type": "string", "minLength": 1, "maxLength": 128},
"sequence": {"type": "integer", "minimum": 1},
"observed_at": {"type": "string", "format": "date-time", "maxLength": 64},
"active_connections": {"type": "integer", "minimum": 0, "maximum": 1000000},
"egress_kbps": {"type": "integer", "minimum": 0, "maximum": 1000000000},
"state": {"type": "string", "enum": ["ready", "draining", "offline"]}
}
},
"GatewayDrain": {
"type": "object",
"additionalProperties": false,
"required": ["version", "gateway_id", "sequence", "reason", "deadline"],
"properties": {
"version": {"type": "string", "const": "1"},
"gateway_id": {"type": "string", "minLength": 1, "maxLength": 128},
"sequence": {"type": "integer", "minimum": 1},
"reason": {"type": "string", "minLength": 1, "maxLength": 256},
"deadline": {"type": "string", "format": "date-time", "maxLength": 64}
}
},
"TunnelAdmissionRequest": {
"type": "object",
"additionalProperties": false,
"required": ["version", "session_id", "gateway_id", "audience", "grant", "reconnect_sequence", "client_nonce", "device_signature", "capabilities"],
"properties": {
"version": {"type": "string", "const": "1"},
"session_id": {"type": "string", "minLength": 1, "maxLength": 128},
"gateway_id": {"type": "string", "minLength": 1, "maxLength": 128},
"audience": {"type": "string", "minLength": 1, "maxLength": 256},
"grant": {"type": "string", "minLength": 43, "maxLength": 256},
"reconnect_sequence": {"type": "integer", "minimum": 0},
"client_nonce": {"type": "string", "minLength": 16, "maxLength": 128},
"device_signature": {"type": "string", "minLength": 86, "maxLength": 86},
"capabilities": {"$ref": "#/$defs/CapabilityProfile"}
}
},
"SessionAuthority": {
"type": "object",
"additionalProperties": false,
"required": ["version", "session_id", "gateway_id", "audience", "reconnect_sequence", "expires_at", "capabilities", "provider_profile", "provider_identity"],
"properties": {
"version": {"type": "string", "const": "1"},
"session_id": {"type": "string", "minLength": 1, "maxLength": 128},
"gateway_id": {"type": "string", "minLength": 1, "maxLength": 128},
"audience": {"type": "string", "minLength": 1, "maxLength": 256},
"reconnect_sequence": {"type": "integer", "minimum": 0},
"expires_at": {"type": "string", "format": "date-time", "maxLength": 64},
"capabilities": {"$ref": "#/$defs/CapabilityProfile"},
"provider_profile": {"type": "string", "enum": ["apollo"]},
"provider_identity": {"type": "string", "minLength": 1, "maxLength": 256}
}
},
"ProviderSessionWork": {
"type": "object",
"additionalProperties": false,
"required": ["version", "session_id", "gateway_id", "reconnect_sequence", "expires_at", "provider_profile", "provider_identity", "policy_version_id", "application_id", "management_host", "management_port", "stream_host", "stream_port", "client_certificate_pem", "client_private_key_pem", "server_certificate_pem"],
"properties": {
"version": {"type": "string", "const": "1"},
"session_id": {"type": "string", "minLength": 1, "maxLength": 128},
"gateway_id": {"type": "string", "minLength": 1, "maxLength": 128},
"reconnect_sequence": {"type": "integer", "minimum": 0},
"expires_at": {"type": "string", "format": "date-time", "maxLength": 64},
"provider_profile": {"type": "string", "const": "apollo"},
"provider_identity": {"type": "string", "minLength": 1, "maxLength": 256},
"policy_version_id": {"type": "string", "minLength": 1, "maxLength": 128},
"application_id": {"type": "string", "minLength": 1, "maxLength": 128},
"management_host": {"type": "string", "minLength": 1, "maxLength": 256},
"management_port": {"type": "integer", "minimum": 1, "maximum": 65535},
"stream_host": {"type": "string", "minLength": 1, "maxLength": 256},
"stream_port": {"type": "integer", "minimum": 1, "maximum": 65535},
"client_certificate_pem": {"type": "string", "minLength": 1, "maxLength": 32768},
"client_private_key_pem": {"type": "string", "minLength": 1, "maxLength": 32768},
"server_certificate_pem": {"type": "string", "minLength": 1, "maxLength": 32768}
}
},
"ChannelFrame": {
"type": "object",
"additionalProperties": false,
"required": ["version", "flow_id", "sequence", "flags", "fragment_index", "fragment_count", "timestamp_ms", "payload"],
"properties": {
"version": {"type": "string", "const": "1"},
"flow_id": {"type": "string", "minLength": 1, "maxLength": 64},
"sequence": {"type": "integer", "minimum": 0},
"flags": {"type": "integer", "minimum": 0, "maximum": 255},
"fragment_index": {"type": "integer", "minimum": 0, "maximum": 15},
"fragment_count": {"type": "integer", "minimum": 1, "maximum": 16},
"timestamp_ms": {"type": "integer", "minimum": 0},
"payload": {"type": "string", "maxLength": 87384, "x-max-bytes": 65536}
}
},
"ProviderState": {
"type": "object",
"additionalProperties": false,
"required": ["version", "session_id", "state", "cleanup_pending", "channels"],
"properties": {
"version": {"type": "string", "const": "1"},
"session_id": {"type": "string", "minLength": 1, "maxLength": 128},
"state": {"type": "string", "enum": ["starting", "ready", "disconnected", "terminating", "terminated", "cleanup_pending", "failed"]},
"cleanup_pending": {"type": "boolean"},
"channels": {"type": "array", "maxItems": 8, "items": {"type": "string", "minLength": 1, "maxLength": 64}}
}
},
"StableError": {
"type": "object",
"additionalProperties": false,
"required": ["version", "code", "message", "retryable"],
"properties": {
"version": {"type": "string", "const": "1"},
"code": {"type": "string", "minLength": 1, "maxLength": 128},
"message": {"type": "string", "minLength": 1, "maxLength": 512},
"retryable": {"type": "boolean"}
}
}
}
}