Repository navigation
[Host] Check the registry host of a registered image reference - #368
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018g33AUmFi1oi2yVbpcqMKE
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Pull Request
📖 Description
A registered image reference whose registry part was
.,..or another non-host value became the host of the OCI client's request URI, whereUriBuilderthrew aUriFormatExceptionthat no caller caught, so the scan ended as failed. The OCI client now accepts only a registry that is a host with an optional port (Docker's host grammar, at most 200 characters, port 1-65535) and answers every other value as not found without sending a request or logging. The same change fixes registries with a port (localhost:5000,registry.example.com:5000), which previously failed in the URI step and inDockerHubClient.IsSupportedRegistry, andGetTagsAsyncnow checks the registry before normalizing it. Decision record 0014 and the registries, image-catalog and architecture documents describe the behavior.🎫 Issues
Closes #364. Follow-up: #367 (Trivy scan target can begin with a dash).
💬 Reviewer Notes
Security area: Registry and Docker Hub calls. The guard is
OciRegistryClient.CreateRegistryUri;DockerHubClient.IsSupportedRegistryonly stops throwing for host-less URI forms and serves the same hosts as before.📑 Test Plan
New tests in
OciRegistryClientTestscover the refused forms forGetTagAsync,GetTagsAsync,GetImageConfigurationAsyncandResolveBaseImagesAsync, the 201-character and port 0 cases, and registries with a port;DockerHubClientTestscovers host-less values. All tests pass (994 + 21), new and changed code is 100 % covered.✅ Checklist
.squad/stack.md, and the Analyzer gate reports no diagnostic in a changed file..squad/stack.mdpasses (line coverage on new or changed production code and overall).README.md,ARCHITECTURE.md) to reflect my changes..squad/stack.mdprescribes.csharp.instructions.mdare followed.⏭ Next Steps