Commit 31ee186
triton-cli: prompt for TOTP code on 2FA challenge
Regenerates `triton-gateway-client/src/generated.rs` against the
new tritonapi spec (the LoginOutcome enum, LoginVerifyRequest,
ChallengeMethod, and the auth_login_verify operation), and teaches
`triton login --user <name>` to handle the
`LoginOutcome::ChallengeRequired` branch by prompting for an
authenticator code (or reading `TRITON_TOTP_CODE` for non-tty
flows) and exchanging it via `/v1/auth/login/verify` for the
`LoginResponse` the rest of the login pipeline expects.
If the server offers only second-factor methods this CLI does not
recognise (i.e. all entries reduce to `ChallengeMethod::Unknown`),
we refuse before prompting rather than collecting a code we
cannot use.
SSH-key login is unaffected.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 115eec6 commit 31ee186
2 files changed
Lines changed: 437 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
| |||
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
301 | 356 | | |
302 | 357 | | |
303 | 358 | | |
| |||
0 commit comments