Commit f1efc2d
committed
fix(cli): address James's review notes on stash env (#682)
- Note 2: treat an ABSENT access-key role as member (server default) rather
than skipping the check — `(role ?? 'member')` — so the documented
'verified on the response' guarantee doesn't depend on the field always
being present.
- Note 3: only append the 'name already taken, use --name' hint on 400/409
(where duplicates land), not every non-403 — a 500 no longer carries a
misleading suggestion.
- Note 4 (defense-in-depth): reject any server-provided emitted value
(CRN/region, client id, access key) that contains a control character,
closing the dotenv line-injection surface the name guard already covered.
clientKey is hex by construction.
Tests: absent-role → success; 500 omits the --name hint (keeps the
leftover-client note); a newline in the server region → refused, no
injected line on stdout. 27 env unit tests, suite 540/62 green.
Note 1 (CRN round-trip) needs no code change — the pre-merge live smoke
already inits a wasm-inline client with the emitted workspaceCrn (see PR
comment); replying there.
Claude-Session: https://claude.ai/code/session_01MxTTPaPP16m6br7Hoab94w1 parent 5dbe58a commit f1efc2d
2 files changed
Lines changed: 75 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
341 | 354 | | |
342 | 355 | | |
343 | 356 | | |
| |||
433 | 446 | | |
434 | 447 | | |
435 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
436 | 482 | | |
437 | 483 | | |
438 | 484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
453 | 457 | | |
454 | 458 | | |
455 | 459 | | |
456 | 460 | | |
457 | 461 | | |
458 | 462 | | |
459 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
460 | 469 | | |
461 | 470 | | |
462 | 471 | | |
463 | 472 | | |
464 | 473 | | |
465 | 474 | | |
466 | | - | |
| 475 | + | |
467 | 476 | | |
468 | 477 | | |
469 | 478 | | |
470 | 479 | | |
471 | 480 | | |
472 | 481 | | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
473 | 496 | | |
474 | 497 | | |
475 | 498 | | |
| |||
0 commit comments