Skip to main content

tf_types/generated/
session_migration.rs

1// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.
2
3#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]
4
5use serde::{Deserialize, Serialize};
6use super::*;
7
8/// Signed record describing a TrustForge session being moved between transports while preserving session_id, generation, and trust continuity (TF-0003 "session migration").
9#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
10pub struct SessionMigration {
11    /// Version of the session-migration schema itself.
12    pub migration_version: SessionMigration_MigrationVersion,
13    /// The session id that survives the migration. Must equal the pre-migration session id.
14    pub session_id: String,
15    /// Migration counter. Increases by 1 per migration; lets receivers detect replays.
16    pub generation: i64,
17    pub from_binding: TransportBinding,
18    pub to_binding: TransportBinding,
19    /// Capabilities the migration explicitly preserves.
20    #[serde(skip_serializing_if = "Option::is_none", default)]
21    pub preserved_capabilities: Option<Vec<Capability>>,
22    /// Whether the session keys were rotated as part of the migration.
23    #[serde(skip_serializing_if = "Option::is_none", default)]
24    pub rotated_keys: Option<bool>,
25    pub migrated_at: Timestamp,
26    /// Human-readable reason (transport upgrade, network change, peer reconnect, ...).
27    #[serde(skip_serializing_if = "Option::is_none", default)]
28    pub reason: Option<String>,
29    pub signer: ActorId,
30    pub signature: SignatureEnvelope,
31}
32
33/// Version of the session-migration schema itself.
34#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
35pub enum SessionMigration_MigrationVersion {
36    #[serde(rename = "1")]
37    V1,
38}