ROX-32532: Auto-detect registry auth type via /v2/ probe - #22747
Conversation
Update docker-registry-client to consume the fix/proactive-bearer-token-injection branch which adds WrapTransportWithDetection. This function probes /v2/ to detect whether a registry requires bearer or basic auth, avoiding spurious Basic auth headers to registries that reject them. A feature flag ROX_REGISTRY_AUTH_DETECTION (enabled by default) gates the new behavior at both call sites (docker config transport and cosign signature fetcher). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughThe change adds an enabled-by-default registry authentication detection flag. Docker and Cosign registry transports use ChangesRegistry authentication detection
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This update documents the registry authentication detection feature and introduces no runtime behavior changes in the reviewed increment. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
🚀 Build Images ReadyImages are ready for commit 1ba16dd. To use with deploy scripts: export MAIN_IMAGE_TAG=5.0.x-244-g1ba16dd13f |
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #22747 +/- ##
==========================================
- Coverage 51.78% 51.74% -0.05%
==========================================
Files 2893 2893
Lines 182488 182526 +38
==========================================
- Hits 94510 94452 -58
- Misses 79691 79766 +75
- Partials 8287 8308 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Description
Update
docker-registry-clientto consume the update which addsWrapTransportWithDetection(stackrox/docker-registry-client#24). This function probes /v2/ to detect whether a registry requires bearer or basic auth, avoiding spurious Basic auth headers to registries that reject them.A feature flag
ROX_REGISTRY_AUTH_DETECTION(enabled by default) gates the new behavior at both call sites (docker config transport and cosign signature fetcher).User-facing documentation
Testing and quality
Automated testing
How I validated my change
Deployed ACS on a local CRC cluster with Prometheus scraping Central's monitoring port. Created a private repo (
quay.io/ykovalev/auth-test) and configured an authenticated docker-type integration in ACS.Triggered 10 unique image scans per scenario and compared
rox_central_registry_client_requests_totalmetrics:With the fix enabled, per-request 401s from Basic auth being sent to Bearer-only registries drop to ~0. The startup 401s are one-time /v2/ auth-detection probes (one per integration) that don't grow with usage. Disabling the feature flag restores the old behavior, confirming it works as a kill switch.