Commit d7752f9
fix: resolve macOS location filtering failures with symlink canonicalization
Fixed location-based credential filtering on macOS where /var is a symlink
to /private/var, causing path mismatches between stored and filtered paths.
Root cause:
- Usage tracking stored paths from os.Getwd() as /var/folders/...
- Location filtering resolved paths to /private/var/folders/...
- Paths didn't match despite being the same directory
Changes:
1. internal/vault/vault.go (lines 614-625)
- Resolve symlinks when recording usage locations
- Use filepath.EvalSymlinks() to get canonical path
- Ensures stored paths are in canonical form
2. cmd/list.go (lines 175-221)
- Resolve symlinks in filterCredentialsByLocation
- Apply EvalSymlinks to both filter path and credential locations
- Compare canonical paths instead of raw paths
This ensures both stored and filtered paths are in canonical form,
fixing all location filtering tests on macOS.
Fixes:
- TestListByLocation/T037_Location_Exact_Path
- TestListByLocation/T039_Location_Recursive
- TestListByLocation/T041_Location_JSON_Format
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 0e0b82c commit d7752f9
2 files changed
+24
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
182 | 189 | | |
183 | 190 | | |
184 | 191 | | |
| |||
191 | 198 | | |
192 | 199 | | |
193 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
194 | 208 | | |
195 | 209 | | |
196 | 210 | | |
197 | 211 | | |
198 | 212 | | |
199 | | - | |
| 213 | + | |
200 | 214 | | |
201 | 215 | | |
202 | 216 | | |
203 | 217 | | |
204 | | - | |
| 218 | + | |
205 | 219 | | |
206 | 220 | | |
207 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
611 | 611 | | |
612 | 612 | | |
613 | 613 | | |
614 | | - | |
| 614 | + | |
| 615 | + | |
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
618 | 625 | | |
619 | 626 | | |
620 | 627 | | |
| |||
0 commit comments