linkcheck icon indicating copy to clipboard operation
linkcheck copied to clipboard

.netrc authentication?

Open dnwe opened this issue 3 years ago • 2 comments

👋 thanks for the great library (consuming via mdbook)

Might it be possible to read credentials for external sites via a local .netrc file (e.g.,) and then pass those to reqwest to use as basic auth? This is for testing links to external sites that require authentication

dnwe avatar Jan 25 '22 17:01 dnwe

I've never heard of .netrc before now. Do you know how it works or if there are existing crates for using them?

Michael-F-Bryan avatar Jan 26 '22 01:01 Michael-F-Bryan

@Michael-F-Bryan yes it's fairly trivial to parse as it has a well-defined format https://everything.curl.dev/usingcurl/netrc

There are crates available, e.g., https://docs.rs/netrc/0.4.1/netrc/struct.Netrc.html

dnwe avatar Jan 26 '22 13:01 dnwe