Skip to content

Conversation

mikemccracken
Copy link
Contributor

Adds support for authenticating to http servers using basic auth by checking for matching credentials in the containers/auth.json file supported by the containers/image library for use in authenticating to registries.

What type of PR is this?

This is a feature PR!

Which issue does this PR fix:

Fixes #710

What does this PR do / Why do we need it:

allows importing from authenticated hosts! we need that!

Testing done on this change:

See the test added in CI

Automation added to e2e:

none

Will this break upgrades or downgrades?

no, no change to CLI or stackerfile format!

Does this PR introduce any user-facing change?:

Now imports from http servers that require basic auth can be supported by providing the auth in containers/auth.json

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

You bet I do ✅

Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 47.82609% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.41%. Comparing base (035f7e7) to head (0f10ac2).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
pkg/stacker/network.go 47.82% 9 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #712      +/-   ##
==========================================
- Coverage   60.51%   60.41%   -0.11%     
==========================================
  Files          59       59              
  Lines        6461     6477      +16     
==========================================
+ Hits         3910     3913       +3     
- Misses       1906     1916      +10     
- Partials      645      648       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

url: ${{BUSYBOX_OCI}}
imports:
- path: http://localhost:9999/importme
credential: mytestcredential
Copy link
Contributor

@rchincha rchincha Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this ("credential") do? From code, it looks like we are just using hostname as the key to lookup credentials?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, thanks - that was from an earlier approach. I'll remove this

Adds support for authenticating to http servers using basic auth by
checking for matching credentials in the containers/auth.json file
supported by the containers/image library for use in authenticating to
registries.

Signed-off-by: Michael McCracken <mikmccra@cisco.com>
@mikemccracken mikemccracken force-pushed the 2025.08.11/main/creds-import branch from e5bb0fa to 0f10ac2 Compare August 12, 2025 16:47
Copy link
Contributor

@rchincha rchincha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hallyn hallyn merged commit 0c78c6e into project-stacker:main Aug 12, 2025
11 of 13 checks passed
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

Successfully merging this pull request may close these issues.

Feat: support authentication for remote imports
3 participants