Skip to main content

khive_runtime/runtime/
config_access.rs

1use super::*;
2
3impl KhiveRuntime {
4    /// Return the extra-visible namespaces assembled at config load.
5    ///
6    /// OSS dispatch uses this set to widen the default multi-record read scope
7    /// to `['local'] ∪ visible_namespaces`. Writes are unchanged: always
8    /// pinned to `'local'`. This set is also available as gate/cloud policy
9    /// input.
10    pub fn visible_namespaces(&self) -> &[Namespace] {
11        &self.config.visible_namespaces
12    }
13
14    pub(crate) fn install_visibility_receipt_capability(
15        &mut self,
16        ring: crate::credentials::VisibilityReceiptConfig,
17        credentials: Vec<crate::credentials::CredentialConfig>,
18        capability: crate::visibility_receipts::ReceiptCapability,
19    ) {
20        self.config.credentials = credentials;
21        self.config.visibility_receipts = Some(ring);
22        self.visibility_receipts = Arc::new(capability);
23    }
24
25    /// Return a reference to the runtime config.
26    pub fn config(&self) -> &RuntimeConfig {
27        &self.config
28    }
29
30    /// Install the host's full declared SQLite topology before pack registration.
31    pub fn with_declared_backend_db_paths(mut self, paths: Arc<[PathBuf]>) -> Self {
32        self.declared_backend_db_paths = paths;
33        self
34    }
35
36    /// All declared SQLite backend paths known to this runtime's host.
37    pub fn declared_backend_db_paths(&self) -> &[PathBuf] {
38        &self.declared_backend_db_paths
39    }
40}