fix(auth): dual-write credentials to keyring AND file#44
Merged
Conversation
The Save path used to delete the JSON credentials file whenever the keyring write succeeded. That left macOS users with a working CLI but a permanently broken `grounds push` flow, because the grounds-push Gradle plugin's CredentialResolver only reads the JSON file (it doesn't link go-keyring). Save now writes to both backends every time and only fails when both backends fail (so Linux CI hosts without a secret service still work via the file path alone). Read still prefers the keyring on platforms that have one — that remains the canonical store; the file is just a mirror so cross-tool consumers (Gradle plugin today, anything else tomorrow) don't need to shell out to `security find-generic-password` to bootstrap. Closes the gap reported on the multi-plugin-sample push 2026-05-08. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CLI used to delete the JSON credentials file on every successful keyring write. That broke `grounds push` on macOS, because the grounds-push Gradle plugin's `CredentialResolver` only reads the JSON file — `go-keyring` is Go-only.
After this PR, every `Save()` writes to both backends. Read still prefers keyring (canonical), file is the mirror.
Behaviour change
Test plan
Memory
Updates the "grounds-push Keychain gap" note — that workaround is no longer needed once this lands and rolls out.