Add managed enterprise config#70
Conversation
Close #51 by reading managed macOS preferences from the dev.omt.apw domain before user config, surfacing per-setting provenance in doctor JSON, and documenting the MDM mobileconfig payload. Tests cover managed-over-user precedence and doctor provenance.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 755627de56
ℹ️ 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".
| crate::utils::read_config_file() | ||
| .map(|config| config.supported_domains) | ||
| .unwrap_or_default() |
There was a problem hiding this comment.
Prevent doctor from mutating config on read failures
When APW_AASA_DOMAINS is unset, this check now calls read_config_file(), which can invoke clear_config() on malformed/unsupported user config and delete ~/.apw/config.json. That makes apw doctor destructive: simply running diagnostics can erase operator state instead of just reporting it. This is reproducible with an invalid JSON config file and no env override, and should be avoided by using a non-destructive read path for supportedDomains.
Useful? React with 👍 / 👎.
Summary
dev.omt.apwdomain before~/.apw/config.json.apw doctor --jsonthrough amanaged-configcheck..mobileconfigpayload and links it from the docs index.supportedDomainsanddisableDemo, and lets associated-domain doctor checks consume configured domains.supportedDomainsare read from managed preferences or a best-effort user-config parse.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 utils::tests::supported_domain_probe_read -- --nocapturecargo test --manifest-path rust/Cargo.toml doctor::tests::associated_domains_check_skipped_when_env_unset -- --nocapturecargo test --manifest-path rust/Cargo.toml read_config_applies_managed_preferences_before_user_config -- --nocapturecargo test --manifest-path rust/Cargo.toml config_provenance_reports_specific_setting_sources -- --nocapturecargo test --manifest-path rust/Cargo.toml managed_config_check_reports_setting_provenance_in_json -- --nocapturecargo test --manifest-path rust/Cargo.toml managed_preferences_do_not_mask_invalid_user_config -- --nocapturebash scripts/ci/run-fast-checks.shgit diff --checkcargo test --manifest-path rust/Cargo.toml(outside sandbox; sandboxed local sockets fail withOperation not permitted)Notes