Skip to main content

Module auth_session

Module auth_session 

Source
Expand description

In-memory manager for pre-launch OAuth sessions.

See docs/specs/SPEC_PRE_LAUNCH_OAUTH_FLOW_2026_05_14.md §7.

Each session represents one user-initiated “Connect with OAuth” attempt. The frontend creates a session via start_session, polls via poll_session, optionally pastes a callback URL (the auth.submitcallback handler forwards it via send_to_stdin), and cancels via cancel_session.

PR A scope: the session-state machine + per-line stdout interpretation + lifecycle (timeout, cancel, cleanup). The actual CLI spawn lives in the handler (server/identity_auth_spawn.rs, so it can use AppState’s CLI resolver) but emits frames into this module via record_line / finish_success / finish_failure. That keeps this module pure and testable.

Structs§

AuthSessionManager
PollSessionResult
Snapshot returned by poll_session. Mirrors AuthSessionStatus plus the provider id for renderer dispatch.
StartSessionResult
Public-facing handle returned by start_session. The handler owns the spawned CLI’s child handle (so it can stdin-inject the pasted callback URL and kill on cancel); this manager owns the session state.

Enums§

AuthSessionStatus