pub struct AppState {
pub responder: Arc<ResponderState>,
pub live_signers: Arc<RwLock<HashMap<String, Arc<LiveSignerState>>>>,
pub signer: Option<Arc<SignerContext>>,
pub gossip: Option<Arc<GossipNode>>,
pub admin: Arc<AdminState>,
pub forward_clients: Arc<HashMap<String, Client>>,
}Fields§
§responder: Arc<ResponderState>§live_signers: Arc<RwLock<HashMap<String, Arc<LiveSignerState>>>>§signer: Option<Arc<SignerContext>>§gossip: Option<Arc<GossipNode>>Handle to the running gossip node, when this process participates in the
SWIM mesh. None when gossip is disabled — admin fleet endpoints then
report an empty/disabled roster instead of members and generations.
admin: Arc<AdminState>§forward_clients: Arc<HashMap<String, Client>>Startup-validated outbound clients for nonce forwarding (F10/S8),
keyed by CA label. Built once by forwarding::build_forward_clients;
each forward-enabled CA gets exactly one client under its own trust
policy, so two CAs can never share (or silently overwrite) roots.
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(responder: ResponderState, config: Config) -> Result<Self, String>
pub fn new(responder: ResponderState, config: Config) -> Result<Self, String>
Fallible since F10: building the per-CA forwarding clients validates
the forward_ca material at startup, so an unreadable, empty, or
malformed root bundle (or a root pinned to a non-HTTPS target) fails
here instead of degrading the forward channel at request time.
Sourcepub fn forward_client_for(&self, label: &str) -> Option<&Client>
pub fn forward_client_for(&self, label: &str) -> Option<&Client>
Outbound forwarding client for a CA label (F10/S8). None when the CA
has no client — a forwarding lookup without one is a configuration
mismatch the handler reports, never a cross-CA trust fallback.
Sourcepub fn with_live_signer(self, live: LiveSignerState) -> Self
pub fn with_live_signer(self, live: LiveSignerState) -> Self
Single-CA compatibility builder; never provides a cross-CA fallback.
pub fn with_live_signer_for(self, label: &str, live: LiveSignerState) -> Self
pub fn live_signer_for(&self, label: &str) -> Option<Arc<LiveSignerState>>
pub fn reload_live_signer(&self, ca: &CaConfig) -> Result<(), String>
Sourcepub fn with_signer_context(self, ctx: SignerContext) -> Self
pub fn with_signer_context(self, ctx: SignerContext) -> Self
Attach the shared on-demand signing context. The returned Arc is also
cloned into the background signer loop so both paths share one mutex.
Sourcepub fn with_gossip(self, gossip: Arc<GossipNode>) -> Self
pub fn with_gossip(self, gossip: Arc<GossipNode>) -> Self
Attach a handle to the running gossip node so admin fleet endpoints can read membership and the generation table, and so the signer path can announce new generations.