pub struct AppState {Show 15 fields
pub store: Store,
pub sessions_ks: KeyspaceHandle,
pub acl_ks: KeyspaceHandle,
pub dids_ks: KeyspaceHandle,
pub config: Arc<AppConfig>,
pub did_resolver: Option<DIDCacheClient>,
pub secrets_resolver: Option<Arc<ThreadedSecretsResolver>>,
pub identity: Option<Arc<ServiceIdentity>>,
pub didcomm_service: Arc<OnceLock<DIDCommService>>,
pub jwt_keys: Option<Arc<JwtKeys>>,
pub signing_key_bytes: Option<[u8; 32]>,
pub http_client: Client,
pub stats_collector: Option<Arc<StatsCollector>>,
pub did_cache: Arc<ContentCache>,
pub trusted_proxy_cidrs: Arc<Vec<IpNetwork>>,
}Fields§
§store: Store§sessions_ks: KeyspaceHandle§acl_ks: KeyspaceHandle§dids_ks: KeyspaceHandle§config: Arc<AppConfig>§did_resolver: Option<DIDCacheClient>§secrets_resolver: Option<Arc<ThreadedSecretsResolver>>§identity: Option<Arc<ServiceIdentity>>The service’s own DID identity: every generation of key material still
honoured, and the kids each one answers to. did_resolver and
secrets_resolver above are cheap clones taken from this; it is the
source of truth for which kids they answer to, and the listener’s
profile is built from it so the two cannot drift apart.
didcomm_service: Arc<OnceLock<DIDCommService>>The running messaging service, once started.
Lifted into AppState (it used to be a local in run(), unreachable at
runtime) so listeners can be hot-swapped without bouncing the process:
remove_listener / add_listener take &self, which is what lets a
rotation rebuild the profile in place. A OnceLock suffices precisely
because the service is never replaced — only its listeners are.
jwt_keys: Option<Arc<JwtKeys>>§signing_key_bytes: Option<[u8; 32]>§http_client: Client§stats_collector: Option<Arc<StatsCollector>>§did_cache: Arc<ContentCache>In-memory cache for DID content (did.jsonl). TTL-based eviction on read.
trusted_proxy_cidrs: Arc<Vec<IpNetwork>>Parsed server.trusted_proxy_cidrs — peers inside this set
have their Forwarded / X-Forwarded-Host headers honoured
for request-host detection (multi-domain, T19/T21).
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn require_didcomm_auth(
&self,
) -> Result<(&DIDCacheClient, &ThreadedSecretsResolver, &JwtKeys), AppError>
pub fn require_didcomm_auth( &self, ) -> Result<(&DIDCacheClient, &ThreadedSecretsResolver, &JwtKeys), AppError>
Unwrap the DIDComm auth components, returning an error if any are not configured.