trust_graph_distro_test/
lib.rs1use serde::Deserialize;
2use lazy_static::lazy_static;
3
4pub const TRUST_GRAPH_WASM: &'static [u8] =
5 include_bytes!("../trust-graph-service/trust-graph.wasm");
6pub const SQLITE_WASM: &'static [u8] = include_bytes!("../trust-graph-service/sqlite3.wasm");
7pub const CONFIG: &'static [u8] = include_bytes!("../trust-graph-service/Config.toml");
8
9pub const KRAS_CERTS_JSON: &'static str = include_str!("../trust-graph-service/on_start.json");
10
11pub mod build_info {
12 include!(concat!(env!("OUT_DIR"), "/built.rs"));
13}
14
15pub use build_info::PKG_VERSION as VERSION;
16
17pub fn modules() -> std::collections::HashMap<&'static str, &'static [u8]> {
18 maplit::hashmap! {
19 "sqlite3" => SQLITE_WASM,
20 "trust-graph" => TRUST_GRAPH_WASM,
21 }
22}
23
24#[derive(Deserialize)]
25pub struct Cert {
26 pub sig_type: String,
27 pub expires_at: u64,
28 pub issued_at: u64,
29 pub issued_for: String,
30 pub signature: String,
31}
32
33#[derive(Deserialize)]
34pub struct CertChain {
35 pub chain: Vec<Cert>,
36}
37
38#[derive(Deserialize)]
39pub struct Certs {
40 pub certs: Vec<CertChain>,
41}
42
43lazy_static! {
44 static ref KRAS_CERTS: Certs = serde_json::from_str(&KRAS_CERTS_JSON).unwrap();
45}