microsoft / Git-Credential-Manager-for-Windows

Secure Git credential storage for Windows with support for Visual Studio Team Services, GitHub, and Bitbucket multi-factor authentication.
Other
2.87k stars 589 forks source link

Temporary RAM storage needed #878

Closed qt1 closed 4 years ago

qt1 commented 4 years ago

The basic ability of git 'cache' store is to have credentials stored in RAM only (not on hard drive) and to last only for a limited time.

Git-Credential-Manager-for-Windows is the de-facto replacement for cache, so it would be nice to have the same basic ability: not using any long term storage at all and ability to set the time.

Cheers!

dscho commented 4 years ago

The basic ability of git 'cache' store is to have credentials stored in RAM only

Are you referring to https://git-scm.com/docs/git-credential-cache? If so, then...

Git-Credential-Manager-for-Windows is the de-facto replacement for cache

... this is not true. Git Credential Manager for Windows is the de-facto replacement for https://git-scm.com/docs/git-credential-store.

qt1 commented 4 years ago

@dscho - Yes, you are correct, Git-Credential-Manager-for-Windows replaces and extends the functionality of most other credential stores.

Unfortunately I need a short-term credential that should not be stored on the hard drive. It is used for accessing a repository that is managed by a private account that should be kept private (except for that specific repository).

In short, git-credential-cache will do the job but it is not working on Windows and Git-Credential-Manager-for-Windows does run on windows but as far as I know it lacks the functionality fo a simple cache (RAM only storage).

dscho commented 4 years ago

@qt1 it sounds as if you could benefit from using the http.extraHeader config setting which allows e.g. authorizing via a Bearer token by base64-encoding Bearer: <token> and then adding the extra header Authorization: <base64>.

But wait, you say, configuring it via the config is not what you want, as that still means it is on disk? That is true for most config sources, but not for the form git -c http.extraHeader=... <command>. If you cannot change the invocation itself, you could either call the command or script via an alias, or you could set the environment variable that backs the -c option directly: GIT_CONFIG_PARAMETERS='http.extraheader=...' (note that the single quotes are part of the value).

qt1 commented 4 years ago

@dscho Thanks, Seems like the simplest workaround in my vase would be to create another server account.

jrbriggs commented 4 years ago

This isn't a feature that GCM for Windows will support since, as @dscho points out, it's better solved by changing how git is called, so I'm closing this issue.