fix(keyring): bump keyring operation timeout from 3s to 60s#758
Open
hestad wants to merge 1 commit into
Open
Conversation
The 3s timeout doesn't leave enough time to answer an interactive macOS keychain prompt (e.g. when the cli.nais.io item requires the keychain password per access). Mirrors the same change in cli/cli@0ca080da, which this file was borrowed from.
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.
Problem
On macOS,
zalando/go-keyringshells out to/usr/bin/security, which can trigger an interactive keychain prompt — for example when thecli.nais.iokeychain item's ACL is set to require the keychain password per access (a common workstation-hardening setup), or after a Homebrew upgrade changes the binary so the ACL no longer matches.internal/keyring/keyring.gowraps every keyring operation in a hardcoded 3-second timeout, so every authenticated command fails withbefore the user can possibly type their password. The abandoned goroutine also orphans the
securityprocess, leaving a stale password prompt on screen after the CLI has exited.Fix
Bump the timeout from 3s to 60s in
Get,SetandDelete.This mirrors upstream: the file is borrowed from
cli/cli, which made the exact same change for the same reason in cli/cli@0ca080da ("Bump keyring operation timeout from 3s to 60s — the 3-second timeout doesn't leave enough time to respond to an interactive unlock prompt").The timeout still guards against a genuinely hung keyring backend (the original motivation, cli/cli#7580); it just no longer races the user's typing speed.
Repro
cli.nais.ioitem's access control.nais postgres proxy ….