1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 11:31:46 +00:00

feat(analyze): safer deletion with Trash and two-key confirm

- Change delete confirmation from double-delete to Delete→Enter
- Move files to macOS Trash instead of permanent deletion
- Allow file recovery from Trash if accidentally deleted
- Update UI prompts to show 'Press Enter to confirm'
- Skip Finder-dependent tests in CI environments
- Update SECURITY_AUDIT.md with new safety mechanisms

Closes #288
This commit is contained in:
Tw93
2026-01-10 07:24:58 +08:00
parent 3507870275
commit ebb4f7a1e9
6 changed files with 129 additions and 55 deletions

View File

@@ -123,7 +123,8 @@ The analyzer (`mo analyze`) uses a distinct security model:
- Runs with standard user permissions only.
- Respects macOS System Integrity Protection (SIP).
- Requires explicit user confirmation for all deletions.
- **Two-Key Confirmation:** Deletion requires ⌫ (Delete) to enter confirmation mode, then Enter to confirm. Prevents accidental double-press of the same key.
- **Trash Instead of Delete:** Files are moved to macOS Trash using Finder's native API, allowing easy recovery if needed.
- OS-level enforcement (cannot delete `/System` due to Read-Only Volume).
**Code:** `cmd/analyze/*.go`