goomph icon indicating copy to clipboard operation
goomph copied to clipboard

Add support for url-based HTTP authentication on p2bootstrapUrl

Open minhphamswe opened this issue 4 years ago • 1 comments

At work we have been using an internal artifact repository to supply the Goomph P2 bootstrap package. We had our project set up like so:

goomph_override_p2bootstrapUrl = 'https://intranet/goomph-p2-bootstrap/4.7.2/goomph-p2-bootstrap-4.7.2.zip'

This worked flawlessly for months, until just recently. The internal artifact repository started requiring authentication for all access. We figured we could add username and password to the URL like so:

goomph_override_p2bootstrapUrl = "https://${username}:${password}@intranet/goomph-p2-bootstrap/4.7.2/goomph-p2-bootstrap-4.7.2.zip".toString()

This didn't work as we expected though. We kept getting HTTP 401 Unauthorized from the internal repository. The error message included the URL it attempted to use, and that URL works just fine when using cURL, so I'm guessing the issue is with okhttp3 somewhere.

We are using goomph version 3.29.1

minhphamswe avatar Jun 18 '21 22:06 minhphamswe

The download call is initiated here:

https://github.com/diffplug/goomph/blob/d9199e2966d3a009ebb442e4d60da2f6a19314b6/src/main/java/com/diffplug/gradle/p2/P2BootstrapInstallation.java#L90-L96

And then implemented here:

https://github.com/diffplug/goomph/blob/d9199e2966d3a009ebb442e4d60da2f6a19314b6/src/main/java/com/diffplug/gradle/FileMisc.java#L54-L72

Happy to merge a PR which adds support for authentication.

nedtwigg avatar Jun 20 '21 16:06 nedtwigg

Strongly recommend migrating to dev.equo.ide or dev.equo.p2deps. I'm not positive this particular issue is solved there, but even if it isn't it will be a lot easier to fix under the EquoIDE approach rather than the Goomph approach. https://github.com/equodev/equo-ide/tree/main/plugin-gradle

nedtwigg avatar Mar 01 '23 00:03 nedtwigg