Repository navigation
🐛 [v6] claude auth: share refreshed logins across per-agent .claude homes and harden shared-home permission handling - #17807
Conversation
…omes and harden shared-home permission handling Top-up of #17767 (v5 squash 0cf675d) onto v6, merged into the credential bridge v6 already carries from #17253/#17590: - keeps v6's dashboard surface (credentialBridgeBroken, resume after sign-in) and the legacy-dir-link rules; - brings the sharedfile-based promotion, owner read through su-exec, newest-expiresAt rule, 5s bridge cadence (HIVE_CLAUDE_CREDENTIAL_BRIDGE_INTERVAL), and the fail-safe handling of an unreadable private file (left in place except on sign-in); - hardens the shared-home permission guard and credential promotion against non-regular files (entrypoint guard, sticky shared dot-dirs, crux/sharedfile writer for the Claude login and Copilot config); - a dashboard sign-in still recovers a shared credential path that is a dangling or self-referencing link (#17590), by unlinking it first. Supersedes #17678 and #17748. (cherry picked from commit 0cf675d) Signed-off-by: Andrew Anderson <andy@clubanderson.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
6d489f9
ℹ️ Sentinel notice — informational; author is trusted (owner), merge is not blockedHive flagged this PR (author @clubanderson, head
Hive did not add the |
Mutation testingHead ❌ gremlins did not produce a report for 1 package(s), so no verdict can be derived from this run (see the job log):
gremlins found 9 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
ℹ️ 1 mutant(s) on added lines were SKIPPED because gremlins v0.6.0 only honours the first
Verdict: |
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Top-up of #17767 (v5) onto v6, merged into the credential bridge v6 already carries from #17253 / #17590 rather than added beside it.
What changes on v6
~/.claude/.credentials.jsonlink with a private0600file, hive reads it (directly, or as the agent's uid through the existingsu-execseam), keeps whichever credential is newer and usable in the shared login, moves the private copy aside as.credentials.json.stale-<UTC>, and restores the link. Runs at launch, everyHIVE_CLAUDE_CREDENTIAL_BRIDGE_INTERVAL(default5s) from the credential watchdog, and after a dashboard sign-in. Memory, transcripts and todos stay per agent; only the login is shared.WriteCredentialsrefuses a token set with no access token.crux/sharedfilewriter (random temp name, descriptor-based metadata, verified before rename, unsafe locations refused and logged once).Supersedes #17678 and #17748.
Validation
Targeted
go testforcrux/agent(bridge, watchdog, snapshot, copilot token),crux/claude,crux/sharedfile,crux/agent/copilottoken,pkg/dashboard;deploy/test_entrypoint_perm_guard.sh50/50;gofmt/go vetclean; sleep ratchet passes.