entireio / entireio/cli

auth-go lock dir isolation doesn't cover spawned binaries

Open
#2,201 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.