Simulating the Workload API (for local dev without SPIRE)
When SPIRE isn't running (i.e., now), you can simulate the response:
pub struct SimulatedWorkloadApi {
svid: X509Svid,
}
impl SimulatedWorkloadApi {
pub fn fetch(&self) -> &X509Svid { &self.svid }
}
pub struct X509Svid {
pub spiffe_id: String,
pub cert_der: Vec<u8>,
pub key_der: Vec<u8>,
pub bundle_der: Vec<Vec<u8>>,
}
This abstraction lets you write your mTLS code against the simulated API now,
and swap in the real spiffe crate client when SPIRE is running.