Skip to main content

tf_types/generated/
proof_profile.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/// Rule describing how a given event type is recorded.
9#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
10pub struct EmitRule {
11    /// Event type identifier this rule applies to, e.g. session.established.
12    pub event_type: String,
13    /// Proof level at which this event must be emitted.
14    pub level: ProofLevel,
15    /// Where the event is anchored.
16    pub anchor: EmitRule_Anchor,
17    /// Retention period in days (0 = indefinite).
18    #[serde(skip_serializing_if = "Option::is_none", default)]
19    pub retention_days: Option<i64>,
20}
21
22/// Where the event is anchored.
23#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
24pub enum EmitRule_Anchor {
25    #[serde(rename = "local")]
26    Local,
27    #[serde(rename = "org")]
28    Org,
29    #[serde(rename = "federated")]
30    Federated,
31    #[serde(rename = "transparency")]
32    Transparency,
33    #[serde(rename = "none")]
34    None,
35}
36
37/// Declarative profile describing which proof events to emit and how (TF-0005).
38#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
39pub struct ProofProfile {
40    /// Version of the proof-profile manifest schema itself.
41    pub profile_version: ProofProfile_ProfileVersion,
42    /// Trust domain this profile applies to.
43    pub trust_domain: TrustDomain,
44    /// Default proof level when an event has none explicitly set.
45    #[serde(skip_serializing_if = "Option::is_none", default)]
46    pub default_level: Option<ProofLevel>,
47    /// Event-emission rules, evaluated per emitted event.
48    pub emit: Vec<EmitRule>,
49    /// Field-level redaction applied before anchoring.
50    #[serde(skip_serializing_if = "Option::is_none", default)]
51    pub redaction_rules: Option<Vec<RedactionRule>>,
52}
53
54/// Version of the proof-profile manifest schema itself.
55#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
56pub enum ProofProfile_ProfileVersion {
57    #[serde(rename = "1")]
58    V1,
59}
60
61/// Redaction applied to a field before anchoring.
62#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
63pub struct RedactionRule {
64    /// JSON Pointer into the event payload.
65    pub field: String,
66    /// How the field is treated.
67    pub policy: RedactionRule_Policy,
68}
69
70/// How the field is treated.
71#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
72pub enum RedactionRule_Policy {
73    #[serde(rename = "keep")]
74    Keep,
75    #[serde(rename = "hash")]
76    Hash,
77    #[serde(rename = "drop")]
78    Drop,
79}