Commit 854e0ab
pkg/llm: implement OIDC token source and thv llm token command (#5033)
* pkg/llm: implement OIDC token source and thv llm token command
Adds a three-tier TokenSource (in-memory → cached refresh token →
browser OIDC+PKCE flow) for the LLM gateway. Access tokens are held
in memory only; refresh tokens are persisted via ScopeLLM secrets.
A 30 s preemptive refresh window avoids gateway rejections on expiry.
thv llm token is now fully implemented: non-interactive, prints a
fresh JWT to stdout with all other output on stderr, suitable for use
as apiKeyHelper or auth.command in Claude Code / Cursor.
Part of #5028
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* changes from review
---------
Co-authored-by: taskbot <taskbot@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent ee6a892 commit 854e0ab
3 files changed
Lines changed: 1054 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
203 | 204 | | |
204 | 205 | | |
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 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
206 | 244 | | |
207 | 245 | | |
208 | 246 | | |
| |||
287 | 325 | | |
288 | 326 | | |
289 | 327 | | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
| 328 | + | |
| 329 | + | |
295 | 330 | | |
296 | 331 | | |
297 | 332 | | |
| |||
0 commit comments