Skip to content

feat(auth): verify founder sessions through WorkOS AuthKit - #175

Open
nullStack65 wants to merge 4 commits into
release/native-0.1.10from
feat/clo-1108-workos-authkit-phase2
Open

nullStack65 wants to merge 4 commits into
release/native-0.1.10from
feat/clo-1108-workos-authkit-phase2

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Adds opt-in WorkOS AuthKit Google sign-in for T3 Code Web and Desktop. The server verifies the signed code-exchange response and binds the matching enrolled founder to the existing T3 session at issuance. Desktop completes the handoff from the system browser with a single-use proof. Stock mobile pairing and device-key flows retain their wire contracts.

The operator guide lists the exact Dashboard redirects and Infisical bundle, and explains how an external app can use its own WorkOS client. Phase 1 attribution (#173) merges into this branch cleanly in a Git merge simulation.

Verification

  • 74 focused tests passed across server auth, Desktop and Web, including signed JWT rejection, state replay, sender attribution, revocation, and pairing regression.
  • Server, Desktop and Web typechecks, changed-file lint, formatting and staged Gitleaks scan passed. The commit hook's unused-file Knip failures reproduce on the release base. Both commits used a per-command local hook override after the Knip failure was reproduced on the release base. The four affected React Compiler cases passed after the Web fix. Knip reports the same 24 unused exports on the release base. The wider changed-file check also reported a workspace typecheck failure and an agent context budget mismatch.
  • Live WorkOS Google login in Web and Electron, production ingress, and individual external app canaries await the WorkOS Dashboard and environment setup. T3 sessions expire by design at the WorkOS token expiry or 15 minutes, whichever comes first.

Prior art

  • WorkOS hosted AuthKit and jose: adopt the existing authorization-code protocol and JWT verification.
  • T3 SessionStore and Desktop bearer bridge: extend existing infrastructure to keep identity, socket invalidation and pairing in the same session authority.
  • WorkOS Connect: use a distinct OAuth application where an external app needs an OIDC relying party.

Model: gpt-6.2-sol
Task: CLO-1108 Phase 2 implementation
Harness: Codex in T3 Code

Deploy: none

@nullStack65

Copy link
Copy Markdown
Owner Author

FINDING

Single independent auth review on fd434346ef6727fb40f57fb70f7b6ef33f564805 against release base 18cf8f27f1df245acf78bbbbbea34c1475f4585a. Keep draft for F1 and F2. The reviewer recorded 68 focused passes and reproduced the reported Knip, evals typecheck, and context-budget issues on the base. Prior Phase 1 integration proof is tied to its earlier pin. The full Pairing DOM and live canary remain unverified.

{"reviewed_head":"fd434346ef6727fb40f57fb70f7b6ef33f564805","reviewer":"GPT-6.2 Sol via Codex · Magpie (independent T3 delegate)","findings":[{"id":"F1","severity":"critical","summary":"Require verified application binding before accepting an AuthKit session for founder attribution.","outcome":"open"},{"id":"F2","severity":"important","summary":"Apply the existing managed remote-client policy to AuthKit browser issuance.","outcome":"open"}]}

Model: gpt-6.2-sol
Task: implementation
Agent: Codex
Lane: codex
Model: GPT-6 (Codex)
Task: implementation
Agent: Codex
Lane: codex
@nullStack65
nullStack65 force-pushed the feat/clo-1108-workos-authkit-phase2 branch from fd43434 to 037bf3c Compare November 25, 2026 01:56
@nullStack65
nullStack65 marked this pull request as ready for review November 25, 2026 01:56
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

The rebase left `founder` declared twice in the `issue` input type and
spread twice into the session record, failing server typecheck with
TS2300. Keep one declaration and the undefined-aware spread.

Model: Claude Sonnet 5.5
Task: implementation
Agent: Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

FINDING (Re-check)

Focused cross-family PR Reviewer re-check on exact head a19f79ae2bda979d909724dcd2934c66730e78a0 against base release/native-0.1.10. Hold — both prior gate findings (F1 and F2) remain open:

  • F1 (critical, open): apps/server/src/auth/WorkOsAuth.ts (verifyCodeResponse, lines 87–90) still treats missing client_id and aud claims as valid (payload.client_id !== undefined && ..., payload.aud !== undefined && ...), and apps/server/src/auth/WorkOsAuth.test.ts (line 130) explicitly asserts that a JWT omitting client_id (and aud) is accepted for "kameron". Verified application binding is still not required.
  • F2 (important, open): apps/server/src/auth/WorkOsAuth.ts and apps/server/src/auth/workOsHttp.ts do not consult ManagedPolicy / ManagedLimits.allowsRemoteClients before issuing AuthKit browser sessions (and EnvironmentAuth.ts neither gates workOsGoogleSignIn nor revokes workos:* browser sessions when remote clients are disallowed). No managed-policy test exists in WorkOsAuth.test.ts.
  • Recent commits (037bf3cdd2, a19f79ae2b): Both are clean with no regressions (037bf3cdd2 moves setBusy(false) after try/catch in WorkOsSignIn.tsx; a19f79ae2b removes the duplicate founder declaration/spread in SessionStore.ts from the rebase).
{"reviewed_head":"a19f79ae2bda979d909724dcd2934c66730e78a0","reviewer":"Gemini 4 Neon via Antigravity (cross-family PR Reviewer re-check)","findings":[{"id":"F1","severity":"critical","summary":"Require verified application binding before accepting an AuthKit session for founder attribution.","outcome":"open","rechecked_head":"a19f79ae2bda979d909724dcd2934c66730e78a0"},{"id":"F2","severity":"important","summary":"Apply the existing managed remote-client policy to AuthKit browser issuance.","outcome":"open","rechecked_head":"a19f79ae2bda979d909724dcd2934c66730e78a0"}]}

…client policy

F1: reject AuthKit access tokens that do not name this application in
client_id or aud; any claim present must also match.
F2: refuse AuthKit browser sign-in, hide the Google sign-in descriptor flag,
and revoke existing workos browser sessions when managed policy disallows
remote clients.

Model: Claude Sonnet 5.5
Task: CLO-1108
Agent: Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

CONFIRMED (Re-check — route to caller for F1 release)

Focused cross-family PR Reviewer re-check on exact head 43110b99ded1c0f96bcaaabc00ea67c2258affbf (delta a19f79ae2bda..43110b99ded1). Both F1 and F2 are cleanly fixed with no new regressions:

  • F1 (critical, confirmed on 43110b99ded1c0f96bcaaabc00ea67c2258affbf): apps/server/src/auth/WorkOsAuth.ts (boundToClient) fails closed: the JWT must bind config.clientId in client_id or aud, and every present client_id / aud claim must match config.clientId (omitting both or mismatching either fails with 401). Covered by regression tests in apps/server/src/auth/WorkOsAuth.test.ts.
  • F2 (important, confirmed on 43110b99ded1c0f96bcaaabc00ea67c2258affbf): WorkOsAuth.begin and WorkOsAuth.callback fail with 403 when ManagedLimits.allowsRemoteClients(managedPolicy) is false; EnvironmentAuth.ts omits workOsGoogleSignIn from the auth descriptor when remote clients are disallowed; revokePairedClientsThePolicyDisallows revokes workos:* browser-session-cookie sessions while preserving bearer-access-token desktop sessions. Covered by regression tests in WorkOsAuth.test.ts and EnvironmentAuthAdmin.test.ts.
  • Independent test verification (detached worktree at 43110b99ded1c0f96bcaaabc00ea67c2258affbf): vp test run src/auth/WorkOsAuth.test.ts src/auth/EnvironmentAuthAdmin.test.ts src/auth/SessionStore.test.ts — 3 test files, 33/33 tests passed.
{"reviewed_head":"43110b99ded1c0f96bcaaabc00ea67c2258affbf","reviewer":"Gemini 4 Neon via Antigravity (cross-family PR Reviewer re-check)","findings":[{"id":"F1","severity":"critical","summary":"Require verified application binding before accepting an AuthKit session for founder attribution.","outcome":"confirmed","rechecked_head":"43110b99ded1c0f96bcaaabc00ea67c2258affbf"},{"id":"F2","severity":"important","summary":"Apply the existing managed remote-client policy to AuthKit browser issuance.","outcome":"confirmed","rechecked_head":"43110b99ded1c0f96bcaaabc00ea67c2258affbf"}]}

This branch has not been deployed

No deployments
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