Skip to content

bug: import-url doesn't validate URL scheme, fails with misleading error instead #534

Open

Description

@Syedowais312

Describe the bug

parseImportURLArg in cmd/import_url.go only parses the :mainArtifact:secret suffix when the input starts with http:// or https://. If it doesn't, there's no else, the string just passes through unchanged and gets sent straight to mc.DownloadArtifact(...), which then fails with an unrelated, confusing error.

How to Reproduce?

./microcks import-url "spec.yaml:true:mysecret" 

Actual behavior

Image

Expected behavior

Something like:

Error: invalid artifact URL 'spec.yaml:true:mysecret': must start with http:// or https://

Microcks version or git rev

1.0.3

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

Fix for this would be to validate the scheme at the top of parseImportURLArg and return an error instead of silently falling through, then propagate it in RunE.

Activity

  1. Vaishnav88sk commented on Sep 19, 2026

    @Vaishnav88sk
    Contributor

    Valid ✔️ ; thank you for reporting.

  2. added this to the Next milestone on Sep 22, 2026
  3. Harsh4902 commented on Sep 22, 2026

    @Harsh4902
    Member

    @Syedowais312 Feel free to raise PR for this.

  4. dipak0000812 commented on Sep 29, 2026

    @dipak0000812

    Hey @Harsh4902
    I'm thinking of picking up #534. I'll check the current implementation, make the fix and add tests. Let me know if there's anything I should consider before starting.

  5. Syedowais312 commented on Sep 30, 2026

    @Syedowais312
    ContributorAuthor

    Hey @Harsh4902 , sorry for the delay, I've been busy with college work for the past two weeks and couldn't get time to look into this. I see @dipak0000812 has made a PR (#560). I've checked it and it looks fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions