feat(protocol): add gateway transport authority contracts
This commit is contained in:
+1149
-1
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -14,5 +14,5 @@
|
||||
},
|
||||
"generator_sha256": "cb975bcd42bf77641b6a0f44d5ec7a6fdba1858d6b8a865e0f04e53bad82648c",
|
||||
"protocol_version": "1.0.0",
|
||||
"schema_sha256": "36e4c8bac2eae674c1eba551c6ca8c64bf80fcc092ca63ec89a2c71c2bec86e1"
|
||||
"schema_sha256": "b8a69785112bb94d45f47c2250ca59d0bde47e3667b8ad89c9b0e2c4cfb25aec"
|
||||
}
|
||||
|
||||
Binary file not shown.
+102
-1
@@ -1,6 +1,6 @@
|
||||
// Code generated by tools/generate.py; DO NOT EDIT.
|
||||
#![allow(non_snake_case)]
|
||||
pub const SCHEMA_SHA256: &str = "36e4c8bac2eae674c1eba551c6ca8c64bf80fcc092ca63ec89a2c71c2bec86e1";
|
||||
pub const SCHEMA_SHA256: &str = "b8a69785112bb94d45f47c2250ca59d0bde47e3667b8ad89c9b0e2c4cfb25aec";
|
||||
pub const CURRENT_WIRE_VERSION: &str = "1";
|
||||
pub const N_MINUS_1_WIRE_VERSION: &str = "0";
|
||||
pub const N_MINUS_2_WIRE_VERSION: &str = "-1";
|
||||
@@ -46,6 +46,28 @@ pub struct BrokerSession {
|
||||
pub version: i64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct CapabilityProfile {
|
||||
pub transport: String,
|
||||
pub framing: String,
|
||||
pub media: String,
|
||||
pub audio: String,
|
||||
pub sourceRateControl: String,
|
||||
pub clientDecode: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ChannelFrame {
|
||||
pub version: String,
|
||||
pub flowId: String,
|
||||
pub sequence: i64,
|
||||
pub flags: i64,
|
||||
pub fragmentIndex: i64,
|
||||
pub fragmentCount: i64,
|
||||
pub timestampMs: i64,
|
||||
pub payload: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ClipboardText {
|
||||
pub text: String,
|
||||
@@ -133,6 +155,43 @@ pub struct FieldViolation {
|
||||
pub code: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct GatewayDrain {
|
||||
pub version: String,
|
||||
pub gatewayId: String,
|
||||
pub sequence: i64,
|
||||
pub reason: String,
|
||||
pub deadline: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct GatewayHeartbeat {
|
||||
pub version: String,
|
||||
pub gatewayId: String,
|
||||
pub sequence: i64,
|
||||
pub observedAt: String,
|
||||
pub activeConnections: i64,
|
||||
pub egressKbps: i64,
|
||||
pub state: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct GatewayRegistration {
|
||||
pub version: String,
|
||||
pub gatewayId: String,
|
||||
pub instanceIdentity: String,
|
||||
pub certificateIdentity: String,
|
||||
pub publicIdentity: String,
|
||||
pub address: String,
|
||||
pub providerIdentity: String,
|
||||
pub protocolMinVersion: i64,
|
||||
pub protocolMaxVersion: i64,
|
||||
pub connectionCapacity: i64,
|
||||
pub bandwidthCapacityKbps: i64,
|
||||
pub features: Vec<String>,
|
||||
pub capabilities: CapabilityProfile,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct GrantReference {
|
||||
pub opaqueValue: String,
|
||||
@@ -189,6 +248,15 @@ pub struct PageInfo {
|
||||
pub nextCursor: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ProviderState {
|
||||
pub version: String,
|
||||
pub sessionId: String,
|
||||
pub state: String,
|
||||
pub cleanupPending: bool,
|
||||
pub channels: Vec<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct ReauthGrant {
|
||||
pub token: String,
|
||||
@@ -240,6 +308,19 @@ pub struct ResourceList {
|
||||
pub page: PageInfo,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct SessionAuthority {
|
||||
pub version: String,
|
||||
pub sessionId: String,
|
||||
pub gatewayId: String,
|
||||
pub audience: String,
|
||||
pub reconnectSequence: i64,
|
||||
pub expiresAt: String,
|
||||
pub capabilities: CapabilityProfile,
|
||||
pub providerProfile: String,
|
||||
pub providerIdentity: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct SessionRequest {
|
||||
pub clientDeviceId: String,
|
||||
@@ -249,6 +330,26 @@ pub struct SessionRequest {
|
||||
pub policySnapshot: AllocationPolicy,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct StableError {
|
||||
pub version: String,
|
||||
pub code: String,
|
||||
pub message: String,
|
||||
pub retryable: bool,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct TunnelAdmissionRequest {
|
||||
pub version: String,
|
||||
pub sessionId: String,
|
||||
pub gatewayId: String,
|
||||
pub audience: String,
|
||||
pub grant: String,
|
||||
pub reconnectSequence: i64,
|
||||
pub clientNonce: String,
|
||||
pub capabilities: CapabilityProfile,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct VersionNegotiation {
|
||||
pub supportedVersions: Vec<String>,
|
||||
|
||||
+277
-1
@@ -1,7 +1,7 @@
|
||||
// Code generated by tools/generate.py; DO NOT EDIT.
|
||||
import Foundation
|
||||
public typealias JSONObject = [String: String]
|
||||
public let schemaSHA256 = "36e4c8bac2eae674c1eba551c6ca8c64bf80fcc092ca63ec89a2c71c2bec86e1"
|
||||
public let schemaSHA256 = "b8a69785112bb94d45f47c2250ca59d0bde47e3667b8ad89c9b0e2c4cfb25aec"
|
||||
public let currentWireVersion = "1"
|
||||
public let nMinus1WireVersion = "0"
|
||||
public let nMinus2WireVersion = "-1"
|
||||
@@ -117,6 +117,66 @@ public struct BrokerSession: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct CapabilityProfile: Codable, Equatable {
|
||||
public let transport: String
|
||||
public let framing: String
|
||||
public let media: String
|
||||
public let audio: String
|
||||
public let sourceRateControl: String
|
||||
public let clientDecode: String
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case transport = "transport"
|
||||
case framing = "framing"
|
||||
case media = "media"
|
||||
case audio = "audio"
|
||||
case sourceRateControl = "source_rate_control"
|
||||
case clientDecode = "client_decode"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
transport = try c.decode(String.self, forKey: .transport)
|
||||
framing = try c.decode(String.self, forKey: .framing)
|
||||
media = try c.decode(String.self, forKey: .media)
|
||||
audio = try c.decode(String.self, forKey: .audio)
|
||||
sourceRateControl = try c.decode(String.self, forKey: .sourceRateControl)
|
||||
clientDecode = try c.decode(String.self, forKey: .clientDecode)
|
||||
}
|
||||
}
|
||||
|
||||
public struct ChannelFrame: Codable, Equatable {
|
||||
public let version: String
|
||||
public let flowId: String
|
||||
public let sequence: Int64
|
||||
public let flags: Int64
|
||||
public let fragmentIndex: Int64
|
||||
public let fragmentCount: Int64
|
||||
public let timestampMs: Int64
|
||||
public let payload: String
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case flowId = "flow_id"
|
||||
case sequence = "sequence"
|
||||
case flags = "flags"
|
||||
case fragmentIndex = "fragment_index"
|
||||
case fragmentCount = "fragment_count"
|
||||
case timestampMs = "timestamp_ms"
|
||||
case payload = "payload"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
flowId = try c.decode(String.self, forKey: .flowId)
|
||||
sequence = try c.decode(Int64.self, forKey: .sequence)
|
||||
flags = try c.decode(Int64.self, forKey: .flags)
|
||||
fragmentIndex = try c.decode(Int64.self, forKey: .fragmentIndex)
|
||||
fragmentCount = try c.decode(Int64.self, forKey: .fragmentCount)
|
||||
timestampMs = try c.decode(Int64.self, forKey: .timestampMs)
|
||||
payload = try c.decode(String.self, forKey: .payload)
|
||||
}
|
||||
}
|
||||
|
||||
public struct ClipboardText: Codable, Equatable {
|
||||
public let text: String
|
||||
public let encoding: String
|
||||
@@ -348,6 +408,108 @@ public struct FieldViolation: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct GatewayDrain: Codable, Equatable {
|
||||
public let version: String
|
||||
public let gatewayId: String
|
||||
public let sequence: Int64
|
||||
public let reason: String
|
||||
public let deadline: String
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case gatewayId = "gateway_id"
|
||||
case sequence = "sequence"
|
||||
case reason = "reason"
|
||||
case deadline = "deadline"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
gatewayId = try c.decode(String.self, forKey: .gatewayId)
|
||||
sequence = try c.decode(Int64.self, forKey: .sequence)
|
||||
reason = try c.decode(String.self, forKey: .reason)
|
||||
deadline = try c.decode(String.self, forKey: .deadline)
|
||||
}
|
||||
}
|
||||
|
||||
public struct GatewayHeartbeat: Codable, Equatable {
|
||||
public let version: String
|
||||
public let gatewayId: String
|
||||
public let sequence: Int64
|
||||
public let observedAt: String
|
||||
public let activeConnections: Int64
|
||||
public let egressKbps: Int64
|
||||
public let state: String
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case gatewayId = "gateway_id"
|
||||
case sequence = "sequence"
|
||||
case observedAt = "observed_at"
|
||||
case activeConnections = "active_connections"
|
||||
case egressKbps = "egress_kbps"
|
||||
case state = "state"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
gatewayId = try c.decode(String.self, forKey: .gatewayId)
|
||||
sequence = try c.decode(Int64.self, forKey: .sequence)
|
||||
observedAt = try c.decode(String.self, forKey: .observedAt)
|
||||
activeConnections = try c.decode(Int64.self, forKey: .activeConnections)
|
||||
egressKbps = try c.decode(Int64.self, forKey: .egressKbps)
|
||||
state = try c.decode(String.self, forKey: .state)
|
||||
}
|
||||
}
|
||||
|
||||
public struct GatewayRegistration: Codable, Equatable {
|
||||
public let version: String
|
||||
public let gatewayId: String
|
||||
public let instanceIdentity: String
|
||||
public let certificateIdentity: String
|
||||
public let publicIdentity: String
|
||||
public let address: String
|
||||
public let providerIdentity: String
|
||||
public let protocolMinVersion: Int64
|
||||
public let protocolMaxVersion: Int64
|
||||
public let connectionCapacity: Int64
|
||||
public let bandwidthCapacityKbps: Int64
|
||||
public let features: [String]
|
||||
public let capabilities: CapabilityProfile
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case gatewayId = "gateway_id"
|
||||
case instanceIdentity = "instance_identity"
|
||||
case certificateIdentity = "certificate_identity"
|
||||
case publicIdentity = "public_identity"
|
||||
case address = "address"
|
||||
case providerIdentity = "provider_identity"
|
||||
case protocolMinVersion = "protocol_min_version"
|
||||
case protocolMaxVersion = "protocol_max_version"
|
||||
case connectionCapacity = "connection_capacity"
|
||||
case bandwidthCapacityKbps = "bandwidth_capacity_kbps"
|
||||
case features = "features"
|
||||
case capabilities = "capabilities"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
gatewayId = try c.decode(String.self, forKey: .gatewayId)
|
||||
instanceIdentity = try c.decode(String.self, forKey: .instanceIdentity)
|
||||
certificateIdentity = try c.decode(String.self, forKey: .certificateIdentity)
|
||||
publicIdentity = try c.decode(String.self, forKey: .publicIdentity)
|
||||
address = try c.decode(String.self, forKey: .address)
|
||||
providerIdentity = try c.decode(String.self, forKey: .providerIdentity)
|
||||
protocolMinVersion = try c.decode(Int64.self, forKey: .protocolMinVersion)
|
||||
protocolMaxVersion = try c.decode(Int64.self, forKey: .protocolMaxVersion)
|
||||
connectionCapacity = try c.decode(Int64.self, forKey: .connectionCapacity)
|
||||
bandwidthCapacityKbps = try c.decode(Int64.self, forKey: .bandwidthCapacityKbps)
|
||||
features = try c.decode([String].self, forKey: .features)
|
||||
capabilities = try c.decode(CapabilityProfile.self, forKey: .capabilities)
|
||||
}
|
||||
}
|
||||
|
||||
public struct GrantReference: Codable, Equatable {
|
||||
public let opaqueValue: String
|
||||
public let expiresAt: String
|
||||
@@ -492,6 +654,30 @@ public struct PageInfo: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct ProviderState: Codable, Equatable {
|
||||
public let version: String
|
||||
public let sessionId: String
|
||||
public let state: String
|
||||
public let cleanupPending: Bool
|
||||
public let channels: [String]
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case sessionId = "session_id"
|
||||
case state = "state"
|
||||
case cleanupPending = "cleanup_pending"
|
||||
case channels = "channels"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
sessionId = try c.decode(String.self, forKey: .sessionId)
|
||||
state = try c.decode(String.self, forKey: .state)
|
||||
cleanupPending = try c.decode(Bool.self, forKey: .cleanupPending)
|
||||
channels = try c.decode([String].self, forKey: .channels)
|
||||
}
|
||||
}
|
||||
|
||||
public struct ReauthGrant: Codable, Equatable {
|
||||
public let token: String
|
||||
public let purpose: String
|
||||
@@ -624,6 +810,42 @@ public struct ResourceList: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct SessionAuthority: Codable, Equatable {
|
||||
public let version: String
|
||||
public let sessionId: String
|
||||
public let gatewayId: String
|
||||
public let audience: String
|
||||
public let reconnectSequence: Int64
|
||||
public let expiresAt: String
|
||||
public let capabilities: CapabilityProfile
|
||||
public let providerProfile: String
|
||||
public let providerIdentity: String
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case sessionId = "session_id"
|
||||
case gatewayId = "gateway_id"
|
||||
case audience = "audience"
|
||||
case reconnectSequence = "reconnect_sequence"
|
||||
case expiresAt = "expires_at"
|
||||
case capabilities = "capabilities"
|
||||
case providerProfile = "provider_profile"
|
||||
case providerIdentity = "provider_identity"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
sessionId = try c.decode(String.self, forKey: .sessionId)
|
||||
gatewayId = try c.decode(String.self, forKey: .gatewayId)
|
||||
audience = try c.decode(String.self, forKey: .audience)
|
||||
reconnectSequence = try c.decode(Int64.self, forKey: .reconnectSequence)
|
||||
expiresAt = try c.decode(String.self, forKey: .expiresAt)
|
||||
capabilities = try c.decode(CapabilityProfile.self, forKey: .capabilities)
|
||||
providerProfile = try c.decode(String.self, forKey: .providerProfile)
|
||||
providerIdentity = try c.decode(String.self, forKey: .providerIdentity)
|
||||
}
|
||||
}
|
||||
|
||||
public struct SessionRequest: Codable, Equatable {
|
||||
public let clientDeviceId: String
|
||||
public let deviceKeyId: String
|
||||
@@ -648,6 +870,60 @@ public struct SessionRequest: Codable, Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct StableError: Codable, Equatable {
|
||||
public let version: String
|
||||
public let code: String
|
||||
public let message: String
|
||||
public let retryable: Bool
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case code = "code"
|
||||
case message = "message"
|
||||
case retryable = "retryable"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
code = try c.decode(String.self, forKey: .code)
|
||||
message = try c.decode(String.self, forKey: .message)
|
||||
retryable = try c.decode(Bool.self, forKey: .retryable)
|
||||
}
|
||||
}
|
||||
|
||||
public struct TunnelAdmissionRequest: Codable, Equatable {
|
||||
public let version: String
|
||||
public let sessionId: String
|
||||
public let gatewayId: String
|
||||
public let audience: String
|
||||
public let grant: String
|
||||
public let reconnectSequence: Int64
|
||||
public let clientNonce: String
|
||||
public let capabilities: CapabilityProfile
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case version = "version"
|
||||
case sessionId = "session_id"
|
||||
case gatewayId = "gateway_id"
|
||||
case audience = "audience"
|
||||
case grant = "grant"
|
||||
case reconnectSequence = "reconnect_sequence"
|
||||
case clientNonce = "client_nonce"
|
||||
case capabilities = "capabilities"
|
||||
}
|
||||
|
||||
public init(from decoder: Decoder) throws {
|
||||
let c = try decoder.container(keyedBy: CodingKeys.self)
|
||||
version = try c.decode(String.self, forKey: .version)
|
||||
sessionId = try c.decode(String.self, forKey: .sessionId)
|
||||
gatewayId = try c.decode(String.self, forKey: .gatewayId)
|
||||
audience = try c.decode(String.self, forKey: .audience)
|
||||
grant = try c.decode(String.self, forKey: .grant)
|
||||
reconnectSequence = try c.decode(Int64.self, forKey: .reconnectSequence)
|
||||
clientNonce = try c.decode(String.self, forKey: .clientNonce)
|
||||
capabilities = try c.decode(CapabilityProfile.self, forKey: .capabilities)
|
||||
}
|
||||
}
|
||||
|
||||
public struct VersionNegotiation: Codable, Equatable {
|
||||
public let supportedVersions: [String]
|
||||
public let features: [String]
|
||||
|
||||
Reference in New Issue
Block a user