Repository navigation
Conversation
Buildx set input.git.host from the git URL exactly as written, so a policy that denies input.git.host == "github.com" didn't match GitHub.com, github.com. or github.com:443 and let the source through. Normalize the git host the same way as input.http.host. Lowercase it, IDNA-encode non-ASCII names, strip a trailing dot, and drop the default port for the remote's scheme: http, https, ssh or git. Do this for the host from the source identifier and for the one from the full remote URL attribute. input.git.remote and input.git.fullURL keep the original URL. Fixes docker#4165 Signed-off-by: Eshan05 <nahareshan05@gmail.com>
This branch has not been deployed
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.
fixes #4165
Buildx set
input.git.hostfrom the git URL exactly as written, so a policy that deniesinput.git.host == "github.com"didn't matchGitHub.com,github.com.orgithub.com:443and let the source through.The git host now goes through the same normalization as
input.http.host. Buildx lowercases it, IDNA-encodes non-ASCII names, strips a trailing dot, and drops the default port for the remote's scheme: 443 for https, 80 for http, 22 for ssh and 9418 for git. This applies to the host from the source identifier and to the one from the full remote URL attribute.input.git.remoteandinput.git.fullURLkeep the original URL.Policies that matched a mixed-case host or an explicit default port need to use the normalized host. An invalid git host or port is now an error, same as for HTTP sources.