GoogleContainerTools / jib

🏗 Build container images for your Java applications.
Apache License 2.0
13.64k stars 1.44k forks source link

Support custom http headers in auth scope #4199

Open dzikoysk opened 7 months ago

dzikoysk commented 7 months ago

Environment:

Description of the issue:

As a user, I'd like to specify additional headers for a http client that is used by jib. In my case, it's required to properly access the private docker registry, where the additional access token is utilized by a security layer. It's also not something specific to my setup, any user using tunnel-like services (e.g. Cloudflare One) will run into this problem.

Expected behavior:

Headers defined in to/from configuration scope should be attached to the request. Something like this would be good enough to be fair:

jib {
    to {
       // [...]
        auth {
            addHeader("XXX-Client-Id", "abc")
            addHeaeer("XXX-Access-Key", "cdf")
        }