chainguard-dev / apko

Build OCI images from APK packages directly without Dockerfile
https://apko.dev
Apache License 2.0
1.21k stars 125 forks source link

HTTP_AUTH - Allow auth for multiple subdomains #1385

Open Kevin-Molina opened 3 weeks ago

Kevin-Molina commented 3 weeks ago

Right now, the HTTP_AUTH environment variable can be used to provide authentication.

At present, it is of the form: basic:<HOST>:<USER>:<TOKEN>

Reference: https://github.com/chainguard-dev/apko/blob/70d6b1a3ebe5f8fd8bbd321f02230315a5f1e06d/pkg/apk/auth/auth.go#L68-L75

Since the check is a straight equality check against the full host value, I cannot pull from both of these host values with auth at the same time:

I'd like to be able to support pulling with auth from multiple subdomains under a given domain. I'm also happy to contribute this, but wanted to ask for input / get a green light.

Thanks!