Wire supported domains into doctor#76
Conversation
Closes #8. Adds supportedDomains to the v1 config shape, preserves it during config rewrites, and makes apw doctor probe configured AASA domains while retaining APW_AASA_DOMAINS as a CI override. Updates the domain expansion playbook and adds both unit and CLI-level regressions for unreachable configured domains.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d3f3598104
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if let Ok(raw) = std::env::var("APW_AASA_DOMAINS") { | ||
| return parse_domain_list(&raw); | ||
| } | ||
| crate::utils::read_config_file_or_empty().supported_domains |
There was a problem hiding this comment.
Avoid clearing user config during doctor domain discovery
configured_associated_domains() now reads supportedDomains via read_config_file_or_empty(), which internally calls read_config_file(). That read path invokes clear_config() on several validation errors (for example malformed JSON/schema/host/port), so a diagnostic apw doctor run can now delete ~/.apw/config.json (and potentially keychain-backed secret metadata) instead of remaining read-only. This is a regression from the previous env-only path and can cause data loss when users run doctor specifically to troubleshoot config problems.
Useful? React with 👍 / 👎.
Summary
supportedDomainsto the persisted APW config shape and preserves it across config rewrites.apw doctorread configured domains and validate their AASA responses, while retainingAPW_AASA_DOMAINSas a CI/manual override.supportedDomainsare read with a best-effort parse.application/json, or omit a non-emptywebcredentials.appsarray.Closes #8.
Verification
cargo fmt --manifest-path rust/Cargo.toml -- --checkcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warningscargo test --manifest-path rust/Cargo.toml doctor::tests::associated_domains_check_preserves_invalid_config_when_env_unset -- --nocapturecargo test --manifest-path rust/Cargo.toml utils::tests::supported_domain_probe_read_preserves_invalid_user_config -- --nocapturecargo test --manifest-path rust/Cargo.toml doctor::tests -- --nocapturecargo test --manifest-path rust/Cargo.toml --test security_regressions doctor_ci_reports_unreachable_supported_domain_from_config -- --nocapturecargo test --manifest-path rust/Cargo.toml --test security_regressionsbash scripts/ci/run-fast-checks.shgit diff --checkNotes