quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.58k stars 2.63k forks source link

Quarkus CLI fails to work with encryption keys starting with "-q" #43336

Open mocenas opened 2 days ago

mocenas commented 2 days ago

Describe the bug

Using quarkus CLI to encrypt config fails, when manually specifying encryption key, starting with "-q". Like:

$: quarkus config encrypt --key=-qwi5grDHLU05KegUhfNNeA  "Joe Biden"
[ERROR] ❗  Expected parameter for option '--key' but found '-qwi5grDHLU05KegUhfNNeA'

This doesn't happen if I change either dash or "q" to anything else.

Also this "unusable" key was automatically generated using quarkus config encrypt whatever. CLI printed out The secret whatever was encrypted to ... with the generated encryption key (base64): -qwi5grDHLU05KegUhfNNeA.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

Quarkus version or git rev

Quarkus cli 3.14.4

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

quarkus-bot[bot] commented 2 days ago

/cc @ebullient (cli), @maxandersen (cli)

ebullient commented 20 hours ago

Does that happen if you quote the value?

mocenas commented 19 hours ago

Does that happen if you quote the value?

Yes it does:

$: quarkus config encrypt --key="-qwi5grDHLU05KegUhfNNeA"  "Joe Biden"
[ERROR] ❗  Expected parameter for option '--key' but found '-qwi5grDHLU05KegUhfNNeA'

$: quarkus config encrypt "--key=-qwi5grDHLU05KegUhfNNeA"  "Joe Biden"
[ERROR] ❗  Expected parameter for option '--key' but found '-qwi5grDHLU05KegUhfNNeA'
maxandersen commented 13 hours ago

Which os/shell are you using ?

mocenas commented 1 hour ago

Which os/shell are you using ?

linux/bash