-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retrieve auth token from git credential helper #83
Comments
Interesting. I can see the problem. I'm not sure if just using git credentials is a user friendly solution. One, because the user has to set something up, or credentials are not persisted. Two, because it overlaps with other use cases. A user may have stored some GitHub credentials in git-credentials already (maybe to be able to I looked at the GitHub CLI tool ( I'll have another think... |
Yeah, I don't think it necessarily has to be git-credentials, just some kind of centralized storage. (1) because of the security angle, and (2) because it's more convenient, like if you have multiple repos where you're using spr. |
Related to this, it would be great if we could configure the token to be fetched via a simple command -- my personal preference for this would be to store it in 1password and use their shell command |
Git has a way to store repo credentials, which includes GitHub tokens; spr should have a way to use that, instead of needing
spr.githubAuthToken
. This would avoid having copies of tokens all over the place in.git/config
files.In my global .gitconfig:
The
store
helper by default stores credentials in~/.git-credentials
, which looks like:Then this code retrieves credentials for the repo at the URL you pass to
CredentialHelper::new
:Which outputs:
The text was updated successfully, but these errors were encountered: