crypto_service_sdk/types/
meta.rs1use std::collections::BTreeMap;
6
7use serde::{Deserialize, Serialize};
8use serde_json::{Map, Value};
9
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
12#[non_exhaustive]
13pub struct ServiceInfo {
14 pub id: String,
16 pub title: String,
18 pub description: String,
20 pub details: String,
22 pub version: String,
24 pub license: String,
26 pub url: String,
28}
29
30#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
32#[serde(rename_all = "camelCase")]
33#[non_exhaustive]
34pub struct Health {
35 pub status: String,
37 pub status_code: u16,
39 pub uptime: f64,
41}
42
43#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
45#[non_exhaustive]
46pub struct Liveness {
47 pub status: String,
49 pub uptime: u64,
51}
52
53#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
55#[serde(rename_all = "camelCase")]
56#[non_exhaustive]
57pub struct ReadinessChecks {
58 pub accepting: bool,
60 pub key_store: bool,
62 #[serde(flatten)]
64 pub other: BTreeMap<String, bool>,
65}
66
67#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
70#[non_exhaustive]
71pub struct Readiness {
72 pub status: String,
74 pub checks: ReadinessChecks,
76}
77
78#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
80#[serde(rename_all = "camelCase")]
81#[non_exhaustive]
82pub struct Algorithms {
83 pub encryption: Vec<String>,
85 pub hashing: Vec<String>,
87 pub kdf: Vec<String>,
89 pub mac: Vec<String>,
91 pub signing: Vec<String>,
93 pub key_exchange: Vec<String>,
95 pub post_quantum: Vec<String>,
97 #[serde(flatten)]
99 pub other: BTreeMap<String, Vec<String>>,
100}
101
102#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
104#[serde(rename_all = "camelCase")]
105#[non_exhaustive]
106pub struct DeprecationEntry {
107 pub algorithm: String,
109 pub category: String,
111 pub sunset_date: String,
113 pub recommended_migration: String,
115}
116
117#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
119#[serde(rename_all = "camelCase")]
120#[non_exhaustive]
121pub struct InventoryEntry {
122 pub package: String,
124 pub version: String,
126 pub status: String,
128 pub fips_compliance: String,
130}
131
132#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
135#[serde(rename_all = "camelCase")]
136#[non_exhaustive]
137pub struct DoraCompliance {
138 pub standard: String,
140 pub article: String,
142 pub status: String,
144 pub disclaimer: String,
146 pub timestamp: String,
148 pub active_primitives_count: u64,
150 pub post_quantum_primitives_count: u64,
152 pub quantum_resistance_ratio: f64,
154 pub cryptographic_inventory: Vec<InventoryEntry>,
156 pub algorithm_deprecation_schedule: Vec<DeprecationEntry>,
158}
159
160#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
162#[non_exhaustive]
163pub struct CbomProperty {
164 pub name: String,
166 pub value: String,
168}
169
170#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
172#[non_exhaustive]
173pub struct CbomComponent {
174 #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
176 pub kind: Option<String>,
177 #[serde(default, skip_serializing_if = "Option::is_none")]
179 pub name: Option<String>,
180 #[serde(default, skip_serializing_if = "Option::is_none")]
182 pub version: Option<String>,
183 #[serde(default, skip_serializing_if = "Option::is_none")]
185 pub properties: Option<Vec<CbomProperty>>,
186 #[serde(flatten)]
188 pub other: Map<String, Value>,
189}
190
191#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
195#[serde(rename_all = "camelCase")]
196#[non_exhaustive]
197pub struct Cbom {
198 pub bom_format: String,
200 pub spec_version: String,
202 pub serial_number: String,
204 pub version: u64,
206 pub metadata: Map<String, Value>,
208 pub components: Vec<CbomComponent>,
210 #[serde(flatten)]
212 pub other: Map<String, Value>,
213}