SCIM: a suspended account's open sessions end, and no credential it holds still works (SCIM-52)

The push router records which account each subscription belongs to, and
a new Revoke event drops every subscription the account holds, so its
IMAP IDLE, JMAP event streams and WebSockets on this node end. Other
users' subscriptions to its shared mailboxes stay. Test 28 now checks an
open IDLE is ended, and that the account's password over HTTP and its
own API key, both already cached, are refused on the next request.
This commit is contained in:
2026-09-19 09:42:03 -07:00
parent 940b42f3b4
commit 3ffaee0695
5 changed files with 104 additions and 0 deletions
@@ -49,6 +49,7 @@ pub fn spawn_push_router(inner: Arc<Inner>, mut change_rx: mpsc::Receiver<PushEv
types,
tx,
} => {
let owner = account_ids.first().copied().unwrap_or(u32::MAX);
for account_id in account_ids {
subscribers
.entry(account_id)
@@ -57,10 +58,22 @@ pub fn spawn_push_router(inner: Arc<Inner>, mut change_rx: mpsc::Receiver<PushEv
.push(IpcSubscriber {
types,
tx: tx.clone(),
owner,
});
}
}
// inbuxa: SCIM-52: dropping every sender closes the session's
// channel, which ends it
PushEvent::Revoke { account_id } => {
for subscriber_list in subscribers.values_mut() {
subscriber_list
.ipc
.retain(|subscriber| subscriber.owner != account_id);
}
purge_needed = true;
}
PushEvent::PushServerRegister { activate, expired } => {
for account_id in activate {
subscribers.entry(account_id).or_default().is_push = true;
+2
View File
@@ -28,6 +28,8 @@ const SEND_TIMEOUT: Duration = Duration::from_millis(500);
struct IpcSubscriber {
types: Bitmap<DataType>,
tx: mpsc::Sender<PushNotification>,
// inbuxa: SCIM-52: the account whose session subscribed
owner: u32,
}
#[derive(Debug)]