Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP_AUTH - Allow auth for multiple subdomains #1385

Open
Kevin-Molina opened this issue Nov 5, 2024 · 0 comments
Open

HTTP_AUTH - Allow auth for multiple subdomains #1385

Kevin-Molina opened this issue Nov 5, 2024 · 0 comments

Comments

@Kevin-Molina
Copy link
Contributor

Kevin-Molina commented Nov 5, 2024

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:

env := os.Getenv("HTTP_AUTH")
parts := strings.Split(env, ":")
if len(parts) != 4 || parts[0] != "basic" {
return nil
}
if req.URL.Host == parts[1] {
req.SetBasicAuth(parts[2], parts[3])
}

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:

  • aaa.domain.com
  • bbb.domain.com

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant