feat(protocol): add gateway transport authority contracts

This commit is contained in:
sechmachine
2026-07-29 05:59:46 +07:00
parent b2c24b3fa3
commit b5558133e3
21 changed files with 1898 additions and 15 deletions
+102 -1
View File
@@ -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>,