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

/// Daemon-signed reply to a PermissionRequest. When granted, the bearer can present this to the RpcServer to authorize the requested action within the listed constraints; when denied, audits still see the reason and the policy decision the engine produced.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct PermissionGrant {
    /// Version of the permission-grant schema itself.
    pub grant_version: PermissionGrant_GrantVersion,
    /// Identifier of the PermissionRequest this grant resolves.
    pub request_id: String,
    /// Outcome of the request.
    pub decision: PermissionGrant_Decision,
    /// Capability the bearer may exercise. Present only when decision=allow.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub capability: Option<Capability>,
    /// Constraints attached to the grant (time window, target glob, quorum, ...).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub constraints: Option<Vec<Constraint>>,
    /// PolicyDecision the engine produced while evaluating the request.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub policy_decision: Option<PolicyDecision>,
    /// Approval ceremony that resolved the request, if any.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub ceremony_id: Option<String>,
    /// Free-text denial reason (decision=deny / approval-required).
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub denial_reason: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub valid_from: Option<Timestamp>,
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub valid_until: Option<Timestamp>,
    pub issued_at: Timestamp,
    /// Daemon actor that signed this grant.
    pub issuer: ActorId,
    /// Ed25519 signature over the canonical form of this grant.
    pub signature: SignatureEnvelope,
}

/// Outcome of the request.
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum PermissionGrant_Decision {
    #[serde(rename = "allow")]
    Allow,
    #[serde(rename = "deny")]
    Deny,
    #[serde(rename = "approval-required")]
    ApprovalRequired,
}

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