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::*;

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Feature {
    /// Stable feature identifier the FeatureGate exposes (e.g. policy-engine, transparency-anchor.rfc6962).
    pub id: String,
    /// Human-readable description.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub description: Option<String>,
    /// TF-XXXX or DECISIONS.md reference.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub spec_ref: Option<String>,
}

/// Declarative profile specification (TF-0010 conformance label + TF-0001 'profiles control complexity'). A profile lists the MUST and SHOULD features a deployment claiming the label has to satisfy. The runtime FeatureGate consults this so daemons can refuse to start when a claimed profile demands a feature that isn't enabled.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProfileSpec {
    /// Version of the profile-spec schema.
    pub profile_version: ProfileSpec_ProfileVersion,
    /// Conformance-label identifier, e.g. tf-home-compatible.
    pub profile_id: String,
    /// Human-readable profile label.
    pub label: String,
    /// Free-text description of when this profile applies.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub description: Option<String>,
    /// Mandatory features. A daemon claiming this profile MUST satisfy every entry.
    pub must: Vec<Feature>,
    /// Recommended features.
    pub should: Vec<Feature>,
    /// Features the profile forbids (e.g. constrained profile MUST NOT enable WebSocket-only listener).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub must_not: Option<Vec<Feature>>,
    /// Minimum EnforcementLevel the daemon must run at when claiming this profile.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub min_enforcement_level: Option<ProfileSpec_MinEnforcementLevel>,
    /// Minimum proof level for actions emitted under this profile.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub min_proof_level: Option<ProofLevel>,
    /// Bridge kinds the profile requires (e.g. ['spiffe', 'webauthn']).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub required_bridges: Option<Vec<String>>,
    /// Transparency anchor kinds the profile requires.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub required_anchors: Option<Vec<ProfileSpec_RequiredAnchors_Item>>,
}

/// Minimum EnforcementLevel the daemon must run at when claiming this profile.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProfileSpec_MinEnforcementLevel {
    #[serde(rename = "E0")]
    E0,
    #[serde(rename = "E1")]
    E1,
    #[serde(rename = "E2")]
    E2,
    #[serde(rename = "E3")]
    E3,
    #[serde(rename = "E4")]
    E4,
    #[serde(rename = "E5")]
    E5,
}

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

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProfileSpec_RequiredAnchors_Item {
    #[serde(rename = "rfc6962")]
    Rfc6962,
    #[serde(rename = "sigstore")]
    Sigstore,
    #[serde(rename = "rfc3161")]
    Rfc3161,
    #[serde(rename = "memory")]
    Memory,
    #[serde(rename = "custom")]
    Custom,
}