Summary
- Check for an existing valid Caution session at the start of
caution init --byoc - Avoid reading/parsing BYOC credential material before the login/session check succeeds
- Add a regression test that an unauthenticated BYOC init fails with the login error before touching a missing credentials file
Fixes #320
Test plan
cargo test -p cli init_byoc_requires_login_before_reading_credentials_file -- --nocapturecargo test -p cli init_byoc -- --nocapturecargo clippy -p cli --all-targets(passes; existing clippy warnings remain)git diff --checkrustfmt --edition 2021 --check src/cli/src/lib.rs(fails because this file already uses Rust 2024 let chains)rustfmt --edition 2024 --check src/cli/src/lib.rs(fails due pre-existing formatting drift in unrelated sections; not applied to avoid large unrelated formatting churn)
## Summary
- Check for an existing valid Caution session at the start of `caution init --byoc`
- Avoid reading/parsing BYOC credential material before the login/session check succeeds
- Add a regression test that an unauthenticated BYOC init fails with the login error before touching a missing credentials file
Fixes #320
## Test plan
- `cargo test -p cli init_byoc_requires_login_before_reading_credentials_file -- --nocapture`
- `cargo test -p cli init_byoc -- --nocapture`
- `cargo clippy -p cli --all-targets` (passes; existing clippy warnings remain)
- `git diff --check`
- `rustfmt --edition 2021 --check src/cli/src/lib.rs` (fails because this file already uses Rust 2024 let chains)
- `rustfmt --edition 2024 --check src/cli/src/lib.rs` (fails due pre-existing formatting drift in unrelated sections; not applied to avoid large unrelated formatting churn)