fix(import-url): validate artifact URL scheme - #560
Open
dipak0000812 wants to merge 1 commit into
Open
dipak0000812 wants to merge 1 commit into
dipak0000812 wants to merge 1 commit into
Conversation
Signed-off-by: Dipak Dhangar <dhangardip09@gmail.com>
dipak0000812
requested review from
Harsh4902,
lbroudoux and
yada
as code owners
September 30, 2026 16:07
|
Welcome to the Microcks community! 💖 Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly. Hope you have a great time there! |
Contributor
|
LGTM, this matches what I proposed in #534. Thanks for picking it up, @dipak0000812 |
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.
Description
Fixes #534
When
import-urlreceives an artifact argument without anhttp://orhttps://prefix,parseImportURLArgpreviously returned the input unchanged and it was passed tomc.DownloadArtifact, resulting in a misleading server or connection error.This change:
parseImportURLArg.errors.KindUsageerror when the input does not start withhttp://orhttps://.import-url'sRunE.ftp://,file:///), empty input, and the reported issue syntax.Testing
go test -v ./cmd -run "TestImportURL|TestParseImportURLArg"go test ./...go vet ./...git diff --checkAI Assistance Disclosure
AI assistance was used minimally during development for codebase/policy lookup and review. The implementation, tests, and final verification were performed and reviewed by the author.