tf-types 0.1.6

Core semantic types, traits, and schemas powering the TrustForge protocol.
Documentation
// GENERATED by `tf-schema codegen --target rust` — DO NOT EDIT BY HAND.

#![allow(unused_imports, non_camel_case_types, non_snake_case, clippy::all)]

use serde::{Deserialize, Serialize};
use super::*;

/// Discriminated record describing how an approval was (or must be) collected. TF-0004 calls for first-class ceremony types so audit logs say not just "approved" but how (passkey tap, YubiKey touch, mobile push, quorum, offline-signed packet, biometric, physical-presence attestation, time-delay).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApprovalCeremony {
    /// Version of the ceremony schema itself.
    pub ceremony_version: ApprovalCeremony_CeremonyVersion,
    /// Stable identifier emitted alongside the ApprovalResponse.
    pub ceremony_id: String,
    /// ApprovalRequest this ceremony belongs to.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub request_id: Option<String>,
    /// When the ceremony began.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub started_at: Option<Timestamp>,
    /// When the ceremony resolved.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub completed_at: Option<Timestamp>,
    /// Actor that resolved the ceremony.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub responder: Option<ActorId>,
    /// Discriminator naming the ceremony variant.
    pub kind: ApprovalCeremony_Kind,
    /// Passkey/WebAuthn credential identifier (base64url).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub credential_id: Option<String>,
    /// WebAuthn relying-party identifier the credential is bound to.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub rp_id: Option<String>,
    /// Hash of the WebAuthn clientDataJSON over which the assertion was signed.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub client_data_hash: Option<HashRef>,
    /// Base64-encoded signature over the canonical ApprovalRequest.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub signature: Option<String>,
    /// YubiKey serial number.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub serial: Option<String>,
    /// Challenge string the device signed (HOTP / OATH / OOB code).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub challenge: Option<String>,
    /// Device response over the challenge.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub response: Option<String>,
    /// Actor URI of the device that produced the proof (mobile, biometric sensor, presence sensor).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub device_actor: Option<ActorId>,
    /// Mandatory cool-down period before the ceremony can complete.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub delay_seconds: Option<i64>,
    /// Earliest wall-clock time the ceremony may complete.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub earliest_completion_at: Option<Timestamp>,
    /// Minimum number of approvers required by a quorum ceremony.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub min_approvers: Option<i64>,
    /// Eligible approver set for a quorum ceremony.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub of: Option<Vec<ActorId>>,
    /// Subset of `of` that signed approve.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub approvers: Option<Vec<ActorId>>,
    /// Detached approver signatures over the canonical ApprovalRequest.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub signatures: Option<Vec<SignatureEnvelope>>,
    /// Opaque attestation blob from the presence sensor.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub presence_attestation: Option<String>,
    /// Identifier for the offline-signed packet that carried this approval.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub packet_id: Option<String>,
    /// How the offline packet reached the daemon.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub transport_hint: Option<ApprovalCeremony_TransportHint>,
    /// Biometric modality used for the ceremony.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub modality: Option<ApprovalCeremony_Modality>,
    /// Biometric match score in [0, 1].
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub match_score: Option<f64>,
}

/// Version of the ceremony schema itself.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ApprovalCeremony_CeremonyVersion {
    #[serde(rename = "1")]
    V1,
}

/// Discriminator naming the ceremony variant.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ApprovalCeremony_Kind {
    #[serde(rename = "click")]
    Click,
    #[serde(rename = "passkey")]
    Passkey,
    #[serde(rename = "yubikey")]
    Yubikey,
    #[serde(rename = "mobile-push")]
    MobilePush,
    #[serde(rename = "time-delay")]
    TimeDelay,
    #[serde(rename = "quorum")]
    Quorum,
    #[serde(rename = "physical-presence")]
    PhysicalPresence,
    #[serde(rename = "offline-signed-packet")]
    OfflineSignedPacket,
    #[serde(rename = "biometric")]
    Biometric,
}

/// Biometric modality used for the ceremony.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ApprovalCeremony_Modality {
    #[serde(rename = "fingerprint")]
    Fingerprint,
    #[serde(rename = "face")]
    Face,
    #[serde(rename = "iris")]
    Iris,
    #[serde(rename = "voice")]
    Voice,
}

/// How the offline packet reached the daemon.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ApprovalCeremony_TransportHint {
    #[serde(rename = "usb")]
    Usb,
    #[serde(rename = "qr-code")]
    QrCode,
    #[serde(rename = "serial")]
    Serial,
    #[serde(rename = "lora")]
    Lora,
    #[serde(rename = "file-drop")]
    FileDrop,
    #[serde(rename = "manual")]
    Manual,
}