Skip to content

Conversation

@gcp
Copy link
Contributor

@gcp gcp commented Feb 10, 2026

No description provided.

gcp added 4 commits February 10, 2026 08:24
Define NS_WIDGET_OS_SESSION_END_OBSERVER_TOPIC,
NS_WIDGET_OS_USER_SWITCH_OBSERVER_TOPIC, and
NS_WIDGET_SCREEN_LOCKED_OBSERVER_TOPIC in nsIWidget.h, following the
existing pattern of sleep/wake observer topics.
Extend WinEventObserver to register for session notifications via
WTSRegisterSessionNotification, and fire screen-locked on
WTS_SESSION_LOCK and os-user-switch on WTS_CONSOLE_DISCONNECT.

Fire os-session-end in the WM_ENDSESSION handler in nsWindow.cpp
before the shutdown sequence begins, for logoff and OS shutdown events.
Register NSWorkspace notification observers in AppShellDelegate for
SessionDidResignActive (os-user-switch), WillPowerOff (os-session-end),
and ScreensDidSleep (screen-locked).

Fire os-session-end in MacApplicationDelegate's
applicationShouldTerminate: before quit-application-requested to catch
OS-initiated termination.
Extend DBusSessionSleepCallback to handle PrepareForShutdown signal
from login1.Manager, firing os-session-end.

Add login1.Session proxy to monitor the Active property for user
switching (os-user-switch), and org.freedesktop.ScreenSaver proxy to
listen for ActiveChanged signal (screen-locked).

Update DBusConnectClientResponse to dispatch by interface name to
support the new proxies alongside the existing ones.
@gcp gcp self-assigned this Feb 10, 2026
@gcp gcp changed the title WIP: OS session event detection + logout Bug 2005206 - OS session event detection + logout Feb 10, 2026
@gcp gcp force-pushed the os-session-event-detection branch from 692ce4c to aa95b8d Compare February 10, 2026 22:18
gcp added 2 commits February 10, 2026 23:21
New module that listens for os-session-end, os-user-switch, and
screen-locked observer topics and triggers the enterprise sign-out flow.

os-session-end always signs out. os-user-switch is controlled by the
enterprise.signoutOnUserSwitch pref (default: true). screen-locked is
controlled by the enterprise.signoutOnScreenLock pref (default: false).

The sign-out flow performs best-effort server-side token revocation
before clearing local tokens and handing off to FELT.
Integration tests covering all OS event scenarios: os-session-end
triggers signout unconditionally, os-user-switch respects pref,
screen-locked respects pref, and server-side logout is called.

Events are simulated via Services.obs.notifyObservers from chrome
context, exercising the full EnterpriseSessionObserver flow.
@gcp gcp force-pushed the os-session-event-detection branch from aa95b8d to cc02111 Compare February 10, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant