Skip to content

v2/rails: native Session (no v1 gem) — graceful sign-out on bad/old session#29

Merged
bradgessler merged 1 commit into
mainfrom
v2-rails-session
Jun 23, 2026
Merged

v2/rails: native Session (no v1 gem) — graceful sign-out on bad/old session#29
bradgessler merged 1 commit into
mainfrom
v2-rails-session

Conversation

@bradgessler

Copy link
Copy Markdown
Contributor

Adds Terminalwire::V2::Rails::Session (JWT-backed client session ported onto the v2 context) and points the v2 shell's session shim at it, so a v2-only app needs no v1 gem for current_user/login/whoami. A missing/tampered/wrong-secret session reads as EMPTY (log in again) instead of raising — v1→v2 migration never crashes a command. Adds the jwt dep. 6 session specs; full suite 96/0.

…ession

Add Terminalwire::V2::Rails::Session: a JWT-backed, client-stored session (v1's
Terminalwire::Rails::Session, ported onto the v2 context's identical file/directory/
storage_path API), and point the v2 shell's `session` shim at it. So a v2-only app
needs no v1 gem for current_user/login/whoami.

Resilient by design: a missing, empty, tampered, or wrong-secret session reads as
EMPTY rather than raising — upgrading v1 -> v2 (or rotating the secret) just signs
the user out ("log in again"), it never crashes a command. Adds the jwt dependency.
Specs: 6 session cases; full suite 96/0.
@bradgessler bradgessler merged commit fbe0b06 into main Jun 23, 2026
@bradgessler bradgessler deleted the v2-rails-session branch June 23, 2026 00:04
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