tf-types 0.1.8

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

/// Serialized capability grant carried across actors (TF-0004).
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CapabilityToken {
    /// Version of the capability-token schema itself.
    pub token_version: CapabilityToken_TokenVersion,
    /// Stable token identifier, usable by revocations.
    pub id: String,
    /// Actor that issued the grant.
    pub issuer: ActorId,
    /// Actor the grant is issued to.
    pub subject: ActorId,
    /// Granted capability.
    pub capability: Capability,
    /// Additional constraints attached on top of those inside `capability`.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub constraints: Option<Vec<Constraint>>,
    /// Delegation chain leading to this grant, root at index 0.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub chain: Option<Vec<DelegationLink>>,
    /// When the token was issued.
    pub issued_at: Timestamp,
    /// When the token expires.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub expires_at: Option<Timestamp>,
    /// Optional hash reference to a proof event recording issuance.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub proof_ref: Option<HashRef>,
    /// Signature envelope over the canonical form of this token (not verified in the foundation phase).
    pub signature: SignatureEnvelope,
}

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