You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/authentication.md
+9-3Lines changed: 9 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,13 @@ sequenceDiagram
13
13
participant DB as Database
14
14
15
15
CLI->>Web: POST /api/auth/cli/code {fingerprintId}
16
-
Web->>Web: Generate auth code (1h expiry)
17
-
Web->>CLI: Return login URL
16
+
Web->>Web: Generate signed auth payload (1h expiry)
17
+
Web->>DB: Store payload behind opaque browser token
18
+
Web->>CLI: Return login URL with opaque token
18
19
CLI->>CLI: Open browser
19
20
Note over Web: User completes OAuth
21
+
Web->>DB: Resolve opaque token to signed payload
22
+
Web->>DB: Mark opaque token consumed
20
23
Web->>DB: Check fingerprint ownership
21
24
Web->>DB: Create/update session
22
25
loop Every 5s
@@ -64,11 +67,14 @@ sequenceDiagram
64
67
### 4. Failure: Invalid/Expired Code
65
68
66
69
- Auth code validation fails or expired (1h limit)
70
+
- Opaque browser tokens resolve expired signed payloads before returning the expired-code error
67
71
- Returns authentication error
68
72
69
73
## Security Features
70
74
71
-
- Auth codes expire after 1 hour
75
+
- Signed auth payloads expire after 1 hour
76
+
- Browser login URLs use opaque 43-character tokens instead of exposing the signed auth payload
77
+
- Opaque browser tokens are stored in `verificationToken` under `cli-login:<token>` and atomically moved to `cli-login-consumed:<token-hash>` when onboarding resolves them; consumed markers scrub the signed auth payload from the `token` column
72
78
- Fingerprint uniqueness: hardware info + 8 random bytes
Copy file name to clipboardExpand all lines: docs/testing.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,3 +9,37 @@ CLI hook testing note: React 19 + Bun + RTL `renderHook()` is unreliable; prefer
9
9
## CLI tmux Testing
10
10
11
11
For testing CLI behavior via tmux, use the helper scripts in `scripts/tmux/`. These handle bracketed paste mode and session logging automatically. Session data is saved to `debug/tmux-sessions/` in YAML format and can be viewed with `bun scripts/tmux/tmux-viewer/index.tsx`. See `scripts/tmux/README.md` for details.
If a change can be verified with a small local harness instead of a live model-backed CLI run, run that harness inside tmux too. This still checks terminal rendering and produces a capture:
When verifying UI output, prefer checking the saved capture file for concrete strings that should and should not appear. For example, after expanding a code-searcher agent, check that the capture shows the search summary but not raw structured payload keys like `results:` or `stdout:`.
0 commit comments