dgtized / github-clone.el

Fork and clone Github projects from Emacs
58 stars 14 forks source link

Prevent storing the password #9

Closed cwittern closed 8 years ago

cwittern commented 8 years ago

After prompting the user for gh account and pw, these and the oauth-token are stored in ~/.gitconfig. This is fine for account name and token, but I'd rather avoid storing the password, and apparently after getting the token it is not needed anymore.
Now it seems that gh.el has the option to remember or not remember the password, but I can't figure out how to do pass that option from github-clone. (Frankly, all this eieio stuff is way over my head:-(. Is that possible?

dgtized commented 8 years ago

I'm only storing the oauth-token in my ~/.gitconfig.private and then referencing it using an include:

[include]
  path = ~/path/to/your/private/gitconfig

I don't think it can use the username/password to access the API, so while it needs those to initially create the oauth token automatically you can either skip that step and generate a token yourself, or just delete the stored password after.

cwittern commented 8 years ago

Well, I ended up doing the following:

(defun mandoku-gh-dont-save-password (orig-fun &rest args) (if (equal "password" (car args )) (message "we do not save the password.") (apply orig-fun args))) (advice-add 'gh-set-config :around #'mandoku-gh-dont-save-password)

This allows me to generate the oauth token automatically, but avoids storing the password. It's a hack, but hey, it does what I need.

dgtized commented 8 years ago

Sorry a little confused. I only use the password prompt to create a new token (and have had poor luck with that and created the token manually) but I've only done that when I needed to cycle the keys. Confused why it's such a concern that it's saving the password if you are just going to delete it from the config file anyway. Regardless, it sounds like your issue is resolved, so is it alright if I close this?

cwittern commented 8 years ago

Yeah, well I have a work around, so for me the problem is solved. You might as well close the issue -- whoever wants to use this will still find it here.