HTTP_AUTH - Allow auth for multiple subdomains

Open
#1,385 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go

Research direction

Start in pkg/apk/auth/auth.go at the referenced lines and inspect how HTTP_AUTH host matching currently works. Determine the intended matching rule for aaa.domain.com and bbb.domain.com under one domain, then verify that authenticated pulls from both hosts work without weakening unrelated host checks.

Written by the indexing model from the issue text.

Description

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:

  • 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!

Dominant language
Go
Stars
1.7k
Forks
228
Avg merge
1d 3h
Merged PRs (30d)
62

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from chainguard-dev/apko

All issues in chainguard-dev/apko

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.