microcks / microcks/microcks-cli

bug: `import-url` drops secret and breaks URL if secret resembles a boolean

Aperta Adatta ai principianti
#524 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
Go
Stelle
52
Fork
68
Merge medio
6h 54m
PR unite (30g)
10

Descrizione

Describe the bug

When using the import-url command with a URL that includes a primary flag and a secret, the internal parseImportURLArg logic splits the string by : and searches backward for the boolean flag. If the provided secret is a string that parses as a boolean (e.g. true, false, 1, 0), the parser incorrectly consumes the secret as the primary flag.

Expected behavior

The command should correctly parse the URL, the boolean primary flag, and the secret string, even if the secret text happens to resemble a boolean value.

Actual behavior

The secret is dropped entirely, the boolean primary flag is ignored, and the parsed URL incorrectly retains the boolean string at the end, causing the import to fail.

How to Reproduce?

Reproducer:

  1. Run a dry run or import using a boolean-like secret:
    microcks import-url "http://example.com/api:true:false"
  2. Observe that the logic parses the URL as http://example.com/api:true, the primary flag as false, and the secret as empty.
Microcks version or git rev

main (Latest)

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

CLI

Additional information

This is a great good first issue to refactor the parseImportURLArg function in cmd/importURL.go to safely separate the URL, flag, and secret without relying on backward boolean parsing.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia in cmd/importURL.go e analizza parseImportURLArg, quindi riproduci il problema con microcks import-url "http://example.com/api:true:false". Assicurati che il parser mantenga l’URL, il flag primario e il secret di tipo booleano, e verifica che il dry run o l’importazione non omettano più il secret né corrompano l’URL.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
go
Ambito
cli
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
88/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.