ssh agent + iterm + bash-git-prompt : authorization prompt shown every 5min

Options
garz75
garz75
Community Member

Hello,

I have configured the 1password SSH agent and uses it to store the SSH keys used to authenticate with our GIT repo (Gitlab.com). Everything works as advertised, I configured the agent to ask approval for each application, so I get the prompt the first time I git pull in an iTerm terminal.

However, in my bash setup, if I activate the bash-git-prompt (https://github.com/magicmonty/bash-git-prompt, see screenshot below), then the agent authorisation prompt gets displayed "randomly", when the bash prompt is refreshed within a repository. By randomly I mean not every time the bash prompt is displayed (e.g. after each command), but about every 5 minutes.

I looked a bit into the source of this bash extension, it hooks with the PROMPT_COMMAND and PS1 bash variables. There is the GIT_PROMPT_FETCH_TIMEOUT variable (in minutes), that is used to git fetch the repo with that interval. I would expect that the authorisation I give when I open the terminal should apply to this git command run in the same bash session... However the actual git fetch command is run asynchronously in a subshell, with the disown command that removes the bash job from the job list :

        async_run "git fetch --quiet"
        disown -h
function async_run() {
  {
    eval "$@" &> /dev/null
  }&
}

I suspect that 1password does not understand that this "disowned" job/process is part of the bash session : for me 1password should not prompt for authorisation in this case.

Any help is appreciated.

Thank you in advance

  • iTerm version: Build 3.5.0beta9
  • bash-git-prompt version: 2.7.1 (from brew)


1Password Version: 1Password for Mac 8.10.3 (81003012)
Extension Version: Not Provided
OS Version: Mac 8.10.3
Browser:_ Not Provided
Referrer: forum-search:ssh key iterm

Comments

  • @garz75 It seems like every request indeed gets identified as a new application. To solve this, you could consider using the new Approve for all applications checkbox to remove the per-application part of the authorization model.

  • garz75
    garz75
    Community Member
    Options

    Thanks for the tip. The 1P update that introduced this feature rolled out just days after I reported the issue and it did indeed fixed the issue.

  • Great!

This discussion has been closed.