]> dgit.raspbian.org Git - git-annex.git/commit
cache credentials in memory when doing http basic auth to a git remote
authorJoey Hess <joeyh@joeyh.name>
Fri, 9 Sep 2022 17:53:38 +0000 (13:53 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 9 Sep 2022 18:20:32 +0000 (14:20 -0400)
commit9621beabc46d411c52ab4024b4657fdf406465b5
tree119bc93c5a0e6a3fa89a08d8cbfcec343f0ed09c
parentadb2f5cc004f2d653462d1c42460dc0ab89c7965
cache credentials in memory when doing http basic auth to a git remote

When accessing a git remote over http needs a git credential prompt for a
password, cache it for the lifetime of the git-annex process, rather than
repeatedly prompting.

The git-lfs special remote already caches the credential when discovering
the endpoint. And presumably commands like git pull do as well, since they
may download multiple urls from a remote.

The TMVar CredentialCache is read, so two concurrent calls to
getBasicAuthFromCredential will both prompt for a credential.
There would already be two concurrent password prompts in such a case,
and existing uses of `prompt` probably avoid it. Anyway, it's no worse
than before.
Annex.hs
Annex/Url.hs
CHANGELOG
Git/Credential.hs
doc/todo/not_ask_git_credentials_for_password_per_each_file/comment_3_39ccd0fe773200166d0727dc903c34e3._comment [new file with mode: 0644]