Commit dfa629c
committed
fix(auth): --profile matches against directory path, not just display name
User reported `--profile "Profile 6"` failing because kooky returns
the human display name (e.g. "Tammie") as `Browser.Profile()`, not
the directory ("Profile 6"). The on-disk directory only appears in
the cookie file path. Users see "Profile 6" in the path output and
expect to be able to pass it as --profile, so make that work.
internal/browsercookies.profileMatches:
Substring-match the user's `--profile` argument against EITHER
the human profile name (e.g. "Tammie", "Default") OR the cookie
file path (e.g. ".../Chrome/Profile 6/Cookies"). Case-insensitive
on both. The kooky-traversal call now goes through this helper.
Both forms now work:
x auth import --profile Tammie
x auth import --profile tammie
x auth import --profile "Profile 6"
x auth import --profile "profile 6"
Plus a TestProfileMatches with eight cases pinning the rule (display
name match, substring match, path match, and three negative cases).1 parent 6613b98 commit dfa629c
2 files changed
Lines changed: 48 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
108 | | - | |
| 109 | + | |
109 | 110 | | |
110 | 111 | | |
111 | | - | |
| 112 | + | |
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
199 | 216 | | |
200 | 217 | | |
201 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
0 commit comments