Bind local config trust to approved settings

Merged
RO
22d ago
+437-20

Summary

Bind local and repository configuration trust to the security-sensitive settings that were explicitly approved, rather than trusting a file path indefinitely. A later change to connection settings no longer silently inherits approval and redirects authenticated requests.

  • Store a SHA-256 digest of trust-gated settings and verify the exact bytes parsed by the config loader.
  • Keep approval across formatting changes and changes to ordinary top-level defaults such as project_id and todolist_id.
  • Ignore changed or legacy path-only approvals until the configuration is reviewed and trusted again.
  • Report each recorded approval's current trust status in basecamp config trust --list.
  • Add credential-leak and trust-invalidation regressions, fix local smoke fixtures, and document upgrade behavior.

Upgrade behavior

Previously trusted local and repository configs must be reviewed and trusted again with basecamp config trust <path>. Until then, trust-gated settings—including base_url, profiles, and default_profile—are ignored with a warning. Other configuration layers and ordinary repository defaults still apply, so users should verify the effective server address, account, and project before making changes.

Validation

  • Confirmed the credential-leak regression fails without the fix and passes with it.
  • bin/ci.
  • Race tests for the config and command packages, plus targeted race coverage for the final changes.
  • Both local configuration smoke tests against the built binary.
  • Independent code review and follow-up review; no blocking findings.

Summary by cubic

Binds local and repo config trust to the security-sensitive settings that were approved, so a later change to connection settings no longer silently keeps trust and redirects authenticated requests.

  • Records a SHA-256 digest of trust-gated settings and verifies the exact bytes the config loader parsed, so pull-request checkouts that rewrite the file lose trust.
  • Rejects approvals for malformed documents and invalidates existing ones with trailing JSON or garbage; unknown settings fail closed.
  • Keeps trust across formatting changes and changes to ordinary defaults like project_id and todolist_id.
  • Legacy path-only approvals trust nothing until the config is reviewed and trusted again; basecamp config trust --list reports each approval's current status.
  • Adds credential-leak and trust-invalidation regression tests, fixes local smoke fixtures, and documents the upgrade behavior.

Upgrade behavior

Previously trusted local and repo configs must be reviewed and trusted again with basecamp config trust <path>. Until then, trust-gated settings (base_url, profiles, default_profile, cache_dir, cache_enabled, and LLM provider, endpoint, model, and budget settings) are ignored with a warning; ordinary repo defaults and other configuration layers still apply, so verify the effective server address, account, and project with basecamp config show before making changes.