neil icon indicating copy to clipboard operation
neil copied to clipboard

Use 'netrc' rather than requiring password entry

Open orome opened this issue 10 years ago • 5 comments

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.

orome avatar Sep 27 '15 17:09 orome

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.

ndmitchell avatar Sep 27 '15 20:09 ndmitchell

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.

orome avatar Sep 27 '15 20:09 orome

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 avatar Sep 27 '15 20:09 ndmitchell

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!)

ndmitchell avatar Sep 27 '15 20:09 ndmitchell

Cool. Thanks!

orome avatar Sep 27 '15 20:09 orome