use std::collections::BTreeMap;
use serde::{Deserialize, Serialize};
use serde_json::{Map, Value};
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct ServiceInfo {
pub id: String,
pub title: String,
pub description: String,
pub details: String,
pub version: String,
pub license: String,
pub url: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct Health {
pub status: String,
pub status_code: u16,
pub uptime: f64,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Liveness {
pub status: String,
pub uptime: u64,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct ReadinessChecks {
pub accepting: bool,
pub key_store: bool,
#[serde(flatten)]
pub other: BTreeMap<String, bool>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct Readiness {
pub status: String,
pub checks: ReadinessChecks,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct Algorithms {
pub encryption: Vec<String>,
pub hashing: Vec<String>,
pub kdf: Vec<String>,
pub mac: Vec<String>,
pub signing: Vec<String>,
pub key_exchange: Vec<String>,
pub post_quantum: Vec<String>,
#[serde(flatten)]
pub other: BTreeMap<String, Vec<String>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct DeprecationEntry {
pub algorithm: String,
pub category: String,
pub sunset_date: String,
pub recommended_migration: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct InventoryEntry {
pub package: String,
pub version: String,
pub status: String,
pub fips_compliance: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct DoraCompliance {
pub standard: String,
pub article: String,
pub status: String,
pub disclaimer: String,
pub timestamp: String,
pub active_primitives_count: u64,
pub post_quantum_primitives_count: u64,
pub quantum_resistance_ratio: f64,
pub cryptographic_inventory: Vec<InventoryEntry>,
pub algorithm_deprecation_schedule: Vec<DeprecationEntry>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct CbomProperty {
pub name: String,
pub value: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[non_exhaustive]
pub struct CbomComponent {
#[serde(rename = "type", default, skip_serializing_if = "Option::is_none")]
pub kind: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<Vec<CbomProperty>>,
#[serde(flatten)]
pub other: Map<String, Value>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct Cbom {
pub bom_format: String,
pub spec_version: String,
pub serial_number: String,
pub version: u64,
pub metadata: Map<String, Value>,
pub components: Vec<CbomComponent>,
#[serde(flatten)]
pub other: Map<String, Value>,
}