auth-go lock dir isolation doesn't cover spawned binaries
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.1k
- Forks
- 475
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 178
Description
Follow-up to #2173, which stopped auth-go's process lock landing in the developer's real user cache under go test.
That fix is in-process only. tokenManagerLockDir (cmd/entire/cli/auth/refresh.go:156) returns testdirs.Dir("authlock"), and testdirs.Dir returns ok=false in a subprocess (internal/testdirs/testdirs.go:26-29). The integration and e2e TestMains set ENTIRE_CONFIG_DIR and XDG_CACHE_HOME but not HOME, and on macOS os.UserCacheDir() ignores XDG_CACHE_HOME - so a spawned entire that reaches a token refresh still writes into the real ~/Library/Caches/auth-go.
userdirs and tokenstore each pair testdirs with an env override (ENTIRE_CONFIG_DIR, ENTIRE_TOKEN_STORE_PATH). This one implements only half that pattern.
Suggested: check an ENTIRE_AUTH_LOCK_DIR env var ahead of testdirs.Dir, and set it in the integration and e2e TestMains alongside the existing isolation vars.
Note the practical exposure is unproven - no spawned binary was observed reaching the lock before failing at the network - but the mechanism is confirmed.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tokenManagerLockDir in cmd/entire/cli/auth/refresh.go and the subprocess behavior in internal/testdirs/testdirs.go. Then inspect the integration and e2e TestMains where ENTIRE_CONFIG_DIR and XDG_CACHE_HOME are set. Done means spawned binaries receive an isolated auth lock directory and token refresh no longer falls back to the developer's real cache.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100