Simpl-Resultat/src-tauri/src/commands
le king fu 17833cf942 feat(gating): auto-update Base+, features[] override fail-closed, dev-override (Rust)
Re-gate auto-update to Base+Premium now that paid activation works
end-to-end (absorbs #271), and align the Rust entitlement layer with the
TS matrix shipped in #297:

- FEATURE_TIERS: auto-update -> [base, premium]; the 'temporarily open'
  carve-out and its test are gone (free_allows_auto_update_temporarily
  -> free_denied_auto_update). Dead rows web-sync, cloud-backup and
  advanced-reports are purged (no call-site anywhere; advanced-reports
  -> Premium contradicted the TS reports-advanced -> Base+ matrix).
  Only auto-update remains on the Rust side.
- features[] override, fail-closed in Free (CWE-863): new
  current_entitlements() resolves the edition AND the signed features[]
  through the same machine-binding path — every downgrade path returns
  ('free', []) so a copied license.key can never keep its signed
  features. check_entitlement combines them via the new pure
  is_entitled(): is_feature_allowed(feature, edition) ||
  features.contains(feature), with a defense-in-depth free short-circuit
  mirroring the TS isEntitled. current_edition() now delegates to
  current_entitlements() — single resolution path, no drift possible.
- dev-override: new Cargo feature (off by default, never in a release
  feature set — CWE-489: debug_assertions could be flipped on a custom
  release build and become a Premium backdoor). Only when compiled in,
  SR_DEV_EDITION forces the edition (free|base|premium) to test tiers
  locally. A feature-off test proves the env var has zero effect in
  normal builds; feature-on companions (env access serialized by a
  mutex) cover cargo test --features dev-override.

No Tauri command signature changes: check_entitlement keeps its
(feature: String) -> Result<bool, String> contract for useUpdater.ts
and ErrorPage.tsx.

Validation: cargo check + cargo test (106 passed, feature off) +
cargo test --features dev-override + npm test (871) + npm run build.

Resolves #301

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 22:35:16 -04:00
..
account_cache.rs feat: HMAC-sign cached account info to close subscription tampering (#80) 2026-04-14 08:07:47 -04:00
auth_commands.rs feat: HMAC-sign cached account info to close subscription tampering (#80) 2026-04-14 08:07:47 -04:00
backup_commands.rs feat(categories): add restore backup banner and permanent restore action (#122) 2026-04-20 21:47:43 -04:00
balance_commands.rs feat(prices): Rust Tauri command fetch_price + tests 2026-04-27 08:23:18 -04:00
entitlements.rs feat(gating): auto-update Base+, features[] override fail-closed, dev-override (Rust) 2026-07-20 22:35:16 -04:00
export_import_commands.rs feat: add data export/import with optional AES-256-GCM encryption (#3) 2026-02-15 11:40:28 +00:00
feedback_commands.rs feat: feedback hub widget in Settings Logs card (#67) 2026-04-17 14:36:26 +00:00
fs_commands.rs feat: implement CSV import wizard with folder-based source detection 2026-02-08 03:38:46 +00:00
license_commands.rs feat(gating): auto-update Base+, features[] override fail-closed, dev-override (Rust) 2026-07-20 22:35:16 -04:00
mod.rs feat(balance): add compute_account_return Tauri command 2026-04-25 16:23:14 -04:00
profile_commands.rs feat(prices): Rust Tauri command fetch_price + tests 2026-04-27 08:23:18 -04:00
return_calculator.rs fix(rust): wrap Modified Dietz formula doc block in text fence (S7) 2026-05-03 16:31:29 -04:00
token_store.rs feat: migrate OAuth tokens to OS keychain via token_store (#78) 2026-04-13 19:41:54 -04:00