Repository navigation
Commit 3ce7bec
committed
Secure WebSocket server connections using a session token stored in a lockfile
- Update `websocket-manager.ts` and `websocket-server-process.ts` to implement a secure lockfile handshake where the server writes its PID and a randomly generated session token to a secure file in the extension's secure storage, and the editor reads this lockfile to verify the server's PID and authenticate the WebSocket connection using the token.
├── apps
│ ├── browser
│ │ ├── package.json
│ │ └── src
│ │ ├── background
│ │ │ ├── message-handler.ts
│ │ │ └── websocket.ts
│ │ ├── content-scripts
│ │ │ └── send-prompt-content-script
│ │ │ └── utils
│ │ │ └── add-apply-response-button.ts
│ │ └── manifest.json
│ ├── editor
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── commands
│ │ │ │ └── apply-response-command
│ │ │ │ ├── apply-response-command.ts
│ │ │ │ └── response-processor
│ │ │ │ ├── handlers
│ │ │ │ │ ├── diff-handler.ts
│ │ │ │ │ ├── fast-replace-handler.ts
│ │ │ │ │ ├── patch-repair-handler.ts
│ │ │ │ │ ├── restore-preview-handler.ts
│ │ │ │ │ ├── search-replace-handler.ts
│ │ │ │ │ └── truncated-handler.ts
│ │ │ │ └── response-processor.ts
│ │ │ ├── extension.ts
│ │ │ └── services
│ │ │ ├── websocket-manager.ts
│ │ │ └── websocket-server-process.ts
│ │ └── tsconfig.json
│ └── web
│ └── package.json
├── package.json
└── packages
├── shared
│ ├── package.json
│ └── src
│ ├── constants
│ │ └── websocket.ts
│ └── types
│ └── websocket-message.ts
└── ui
└── package.json1 parent 28d8fb9 commit 3ce7bec
2 files changed
Lines changed: 101 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
79 | 87 | | |
80 | 88 | | |
81 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
85 | 98 | | |
86 | 99 | | |
87 | 100 | | |
88 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
89 | 106 | | |
90 | 107 | | |
91 | 108 | | |
| |||
166 | 183 | | |
167 | 184 | | |
168 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
169 | 197 | | |
170 | 198 | | |
171 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
172 | 231 | | |
173 | 232 | | |
174 | 233 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| 32 | + | |
| 33 | + | |
31 | 34 | | |
32 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
33 | 53 | | |
34 | 54 | | |
35 | 55 | | |
| |||
99 | 119 | | |
100 | 120 | | |
101 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
102 | 130 | | |
103 | 131 | | |
104 | 132 | | |
| |||
316 | 344 | | |
317 | 345 | | |
318 | 346 | | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
319 | 359 | | |
320 | 360 | | |
321 | 361 | | |
| |||
0 commit comments