Files
VerseVDI-Protocol/schemas/control-v1.schema.json
T

349 lines
15 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}}
}
}
}
}