Remove username/password support; always use tokens.#90
Remove username/password support; always use tokens.#90guybedford merged 3 commits intojspm:masterfrom tamird:token-auth
Conversation
|
There's a lot of duplication here - I'm sure it can be cleaned up some, but I'd like to leave that to you @guybedford since I don't really know what I'm doing in JS :) I tested this locally with a token that doesn't have public_repo and things worked. |
|
Thanks, this looks good to me. The thing is, we need to retain backwards-compatibility - password authentication can't just be removed! So the prompt could perhaps read I know it's a bit of work with all that, but backwards-compatibility is the cost having users :) |
|
OK I've refactored this a bit to reduce the duplication. Perhaps you could help with the backwards compatibility bit? |
|
|
||
| function readNetrc(hostname) { | ||
| hostname = hostname || 'github.com'; | ||
| var creds = netrc[hostname]; |
There was a problem hiding this comment.
All this deleted code needs to remain.
|
OK, seems to me we can remove all the code that permits the old configuration to go in, we just need to keep the ability to read the old config. Updated. |
|
We can definitely support the better token approach here, but I can't merge this as the prompts are part of the API, we can't just remove them in this version as it will break documented workflows. |
|
Ah I might just revert the prompts. I'll let you know when I've done that.
|
|
Reverted the prompts! @guybedford PTAL |
|
Thanks! This looks great. I think we should be able to alter the configuration prompts though - where it says enter your token or username, we can check if they entered a token and then skip asking for a password and set the auth object to a token mode already. Let me know if that makes sense? |
|
Done. |
|
Excellent, thank you again for your contributions! |
|
Thanks! Could you cut a new release with this? |
|
Sure, I have done a 0.13.14. |
Fixes #89.