MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / init_security_buses

Function init_security_buses

nodedb/src/control/state/buses_init.rs:17–30  ·  view source on GitHub ↗

Construct both security buses, subscribe the consumer receivers, spawn the audit-log consumer task, and return the three values that `SharedState` fields require. `session_registry` is shared with the consumer so hard-revoke events drive kill signals before audit rows are written.

(
    audit: Arc<Mutex<AuditLog>>,
    session_registry: Arc<SessionRegistry>,
)

Source from the content-addressed store, hash-verified

15/// `session_registry` is shared with the consumer so hard-revoke events drive
16/// kill signals before audit rows are written.
17pub(super) fn init_security_buses(
18 audit: Arc<Mutex<AuditLog>>,
19 session_registry: Arc<SessionRegistry>,
20) -> (
21 SessionInvalidationBus,
22 UserChangeBus,
23 tokio::task::JoinHandle<()>,
24) {
25 let (si_bus, si_rx) = SessionInvalidationBus::new();
26 let (uc_bus, uc_rx) = UserChangeBus::new();
27 let handle =
28 crate::control::security::buses::spawn_bus_consumer(si_rx, uc_rx, audit, session_registry);
29 (si_bus, uc_bus, handle)
30}

Callers 2

openMethod · 0.85
new_innerMethod · 0.85

Calls 1

spawn_bus_consumerFunction · 0.85

Tested by

no test coverage detected