ndmitchell / neil

General tools for Neil
Other
38 stars 16 forks source link

Use 'netrc' rather than requiring password entry #21

Open orome opened 9 years ago

orome commented 9 years ago

Could this (miraculous) tool be tweaked so that it uses netrc? I'd like to avoid having to enter my password (which I can't recall or easily type) each time I use it.

ndmitchell commented 9 years ago

I'm a Windows user, so have no idea about netrc. What does it give me? How does it work? Can you run netrc to get the password back in plain text? If not, how do I pass the password on to Hackage?

I'm happy to take a pull request, as long as it continues to work for people who don't have netrc configured.

orome commented 9 years ago

I'm not much of an expert either. It pulls credentials from a file. E.g., curl ... --netrc doesn't need a username or password to work. I'm not enough of an expert to generate a pull request, but I'll have a look and see if it turns out to be simple. If I were you, I'd reject it though, since it's a security thing.

ndmitchell commented 9 years ago

I'm not averse to calling curl with --netrc, and if it fails, trying again with a password request. I can't see how that is harmful (I ask for the password in less situations, which seems better to me - I'd rather people didn't type their password into prompts I wrote!).

ndmitchell commented 9 years ago

If you report that --netrc to curl and no password works thats enough information for me to give it a whirl, as long as you can test the result (although pull requests are always most welcome!)

orome commented 9 years ago

Cool. Thanks!