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>,
)
| 15 | /// `session_registry` is shared with the consumer so hard-revoke events drive |
| 16 | /// kill signals before audit rows are written. |
| 17 | pub(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 | } |
no test coverage detected