tomtom-international / asciidoxy

AsciiDoxy generates API documentation from Doxygen XML output to AsciiDoc.
Apache License 2.0
31 stars 10 forks source link

fix: add netrc auth for sources #72

Closed AndreyNautilus closed 1 year ago

AndreyNautilus commented 1 year ago

I implemented the approach we discussed in the chat, but now I start to think that this is maybe not the correct interface. I don't think users should explicitly specify that they want to use netrc file for authentication for http sources:

authentication:
  type: "basic_netrc"

Netrc file is more a system level configuration rather than application level, so users should not explicitly declare it. If netrc file is configured it should just work. We can try to fetch credentials from netrc file for every download request in HttpPackageSpec - that shouldn't affect the performance too much. On the other size, for other auth methods, like "basic auth" users indeed should explicitly provide required data:

authentication:
  type: "basic"
  login: "ENV: <env variable name>"
  password: "ENV: <env variable name>"

So, I suggest to drop "basic_netrc" configuration and assume it's always enabled.

I'll add tests when we agree with the approach.

RobvanderMost-TomTom commented 1 year ago

Yes, I think it makes sense to support netrc as default without configuration. And when the authentication type is explicitly overrideen we would then not read from netrc.

RobvanderMost-TomTom commented 1 year ago

Could you please target branch develop-0.8.x? Then I can make a proper 0.8.x release afterwards.