microcks / microcks/microcks-cli

import command requires login even when --microcksURL is provided

Open Beginner friendly
#511 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
52
Forks
68
Avg merge
6h 54m
Merged PRs (30d)
10

Description

Describe the bug

microcks import does not seem to handle --microcksURL the same way as import-dir.

I started a local Microcks instance using microcks start, which runs the latest-native image without Keycloak enabled. In this setup, importing through --microcksURL http://localhost:8585 should work without a saved login/config.

import-dir works correctly with an empty config path and imports the artifact successfully. But import with the same server URL and same empty config path fails with:

please login to perform this operation

This is confusing because the command already has the target server from --microcksURL.

Expected behavior

microcks import --microcksURL... should try to use the provided server directly, like --import-dir does. If the server requires authentication, then it
should fail with an auth/API error from the server.

The issue seems to be that cmd/import.go has its own client setup logic, while import-dir uses the shared newCommandClient(globalClientOpts) helper.

Repro
Image
Microcks version or git rev

microcks-cli master branch

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

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cmd/import.go and compare its client setup with import-dir's use of newCommandClient(globalClientOpts). Reproduce the command against a local server using --microcksURL and an empty config path; done means the provided URL is used without requiring a saved login, while authentication-required servers return their auth or API error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.