Skip to main content

tf_types/generated/
proofrpc.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/// One RPC method.
9#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
10pub struct Method {
11    /// Method name, camelCase or snake_case, starts with a lowercase letter.
12    pub name: String,
13    /// Streaming mode. unary: one request → one response. server-streaming: one request → many. client-streaming: many → one. bidi-streaming: many ↔ many. subscribe: one subscribe → many events with optional ack. command-channel: long-lived control with backpressure. bulk-transfer: chunked binary with content-hashing. telemetry: push-only with priority class. remote-shell: stdin/stdout stream. agent-session: bidi stream that carries the chain of responsibility. http-bridge: bidi stream that carries HTTP/1.1 or HTTP/2 frames (headers, chunks, trailers) for cross-site proxying.
14    pub kind: Method_Kind,
15    /// What this method does.
16    #[serde(skip_serializing_if = "Option::is_none", default)]
17    pub description: Option<String>,
18    /// Inline JSON Schema describing the request body. Must be type:object with properties.
19    pub request: serde_json::Value,
20    /// Inline JSON Schema describing the response body (or stream element for server-streaming).
21    pub response: serde_json::Value,
22    /// Name of the TrustForge capability required to invoke.
23    pub capability: ActionName,
24    /// Risk class assigned to this method.
25    pub risk: RiskClass,
26    /// Proof level at which successful calls are emitted.
27    #[serde(skip_serializing_if = "Option::is_none", default)]
28    pub proof: Option<ProofLevel>,
29    /// Approval requirement for invocations; defaults to none.
30    #[serde(skip_serializing_if = "Option::is_none", default)]
31    pub approval: Option<ApprovalRequirement>,
32    /// Names of policy hooks the daemon must consult before this method runs.
33    #[serde(skip_serializing_if = "Option::is_none", default)]
34    pub policy_hooks: Option<Vec<String>>,
35    /// Optional human-readable denial reason if the method is forbidden in this trust domain.
36    #[serde(skip_serializing_if = "Option::is_none", default)]
37    pub denial: Option<String>,
38    /// Priority class for streaming methods (TF-0011).
39    #[serde(skip_serializing_if = "Option::is_none", default)]
40    pub streaming_priority: Option<Method_StreamingPriority>,
41    /// Conformance vector files this method participates in.
42    #[serde(skip_serializing_if = "Option::is_none", default)]
43    pub conformance_tests: Option<Vec<String>>,
44}
45
46/// Streaming mode. unary: one request → one response. server-streaming: one request → many. client-streaming: many → one. bidi-streaming: many ↔ many. subscribe: one subscribe → many events with optional ack. command-channel: long-lived control with backpressure. bulk-transfer: chunked binary with content-hashing. telemetry: push-only with priority class. remote-shell: stdin/stdout stream. agent-session: bidi stream that carries the chain of responsibility. http-bridge: bidi stream that carries HTTP/1.1 or HTTP/2 frames (headers, chunks, trailers) for cross-site proxying.
47#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
48pub enum Method_Kind {
49    #[serde(rename = "unary")]
50    Unary,
51    #[serde(rename = "server-streaming")]
52    ServerStreaming,
53    #[serde(rename = "client-streaming")]
54    ClientStreaming,
55    #[serde(rename = "bidi-streaming")]
56    BidiStreaming,
57    #[serde(rename = "subscribe")]
58    Subscribe,
59    #[serde(rename = "command-channel")]
60    CommandChannel,
61    #[serde(rename = "bulk-transfer")]
62    BulkTransfer,
63    #[serde(rename = "telemetry")]
64    Telemetry,
65    #[serde(rename = "remote-shell")]
66    RemoteShell,
67    #[serde(rename = "agent-session")]
68    AgentSession,
69    #[serde(rename = "http-bridge")]
70    HttpBridge,
71}
72
73/// Priority class for streaming methods (TF-0011).
74#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
75pub enum Method_StreamingPriority {
76    #[serde(rename = "P0")]
77    P0,
78    #[serde(rename = "P1")]
79    P1,
80    #[serde(rename = "P2")]
81    P2,
82    #[serde(rename = "P3")]
83    P3,
84    #[serde(rename = "P4")]
85    P4,
86    #[serde(rename = "P5")]
87    P5,
88}
89
90/// Declarative RPC service definition consumed by tf-schema codegen --target rpc-ts|rpc-rust. See TF-0007.
91#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
92pub struct Proofrpc {
93    /// Version of the proofrpc service descriptor schema.
94    pub rpc_version: Proofrpc_RpcVersion,
95    /// PascalCase service identifier used by generated client and server types.
96    pub service_id: String,
97    /// Human-readable description of the service.
98    #[serde(skip_serializing_if = "Option::is_none", default)]
99    pub description: Option<String>,
100    /// Methods exposed by this service.
101    pub methods: Vec<Method>,
102}
103
104/// Version of the proofrpc service descriptor schema.
105#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
106pub enum Proofrpc_RpcVersion {
107    #[serde(rename = "1")]
108    V1,
109}