cli: add TLS flags, keep secrets out of arguments, and read environment variables
Maintainers usually reply within 2 days
@ByteBaker is already working on this.
Since Oct 22, 2026.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- authentication, cli, security
Research direction
Start with core/cli/src/credentials.rs and the ArgsOptional definitions in core/common/src/types/args/mod.rs; then trace the referenced TLS paths in core/sdk/src/client_provider.rs and core/sdk/src/tcp/tcp_client.rs. Review how context create, context delete, and the data seeder use these arguments, and inspect workspace Cargo.toml and SERVER_PROCESS_ENV_VARS in core/configs/src/server_config/server.rs. Done means the proposed TLS, secret-storage, and environment-variable behaviors work together, with relevant tests covering the new options and credential precedence.
Written by the indexing model from the issue text.
Description
Problem
- TLS over TCP: the CLI always validates the server certificate (
core/sdk/src/client_provider.rs:141), and it trusts only the built-inwebpki_roots(core/sdk/src/tcp/tcp_client.rs:1219). The SDKArgshastcp_tls_ca_file(core/common/src/types/args/mod.rs:269), but the CLI flags inArgsOptional(:29) do not. So the CLI cannot reach a TCP TLS server with a self-signed or private CA certificate. - TLS over WebSocket:
ArgsOptionalhas none of thewebsocket_tls_*fields (:344-353), so the CLI cannot enable WebSocket TLS.context createhas no WebSocket address flag. TLS keys that you add tocontexts.tomlby hand are ignored. - Secrets:
user createtakes the password only as a positional argument, so the password goes into shell history.context createstores the password and the token as plaintext in~/.iggy/contexts.toml(mode 0600 on Unix). PATs and login sessions already use the OS keyring. - Environment: the only Iggy variables that the CLI reads are
IGGY_HOMEand the pairIGGY_USERNAMEandIGGY_PASSWORD, and--helplists none of them. No variable holds a token. So a CI job passes the token with-t, where the process list shows it, or writes it tocontexts.toml.
Proposal
- Add
--tcp-tls-ca-fileand the--websocket-tls-*flags. Validate WebSocket certificates by default, as TCP does. Today the WebSocket default is off (core/common/src/types/args/mod.rs:418). - Remove the
localhostdefault of the TLS domain (:389), so that the SDK uses the host of the server address (core/sdk/src/tcp/tcp_client.rs:1234). - Flatten
ArgsOptionalinto thecontext createarguments, so that a context can hold every connection flag. - If the
user createpassword is missing, prompt on a TTY or read one line from stdin, like-p(core/cli/src/credentials.rs:126). - Store context secrets in the keyring, keyed by
IGGY_HOMEand the context name, and remove them oncontext delete. If no keyring is available, keep the current file. - Read
IGGY_TOKENnext to theIGGY_USERNAMEandIGGY_PASSWORDpair (core/cli/src/credentials.rs:148). The flags win over it, and it wins over the pair. - Give the connection flags
envattributes with explicit names andhide_env_values, throughmut_argin the CLI. The data seeder also usesArgsOptional. This needs the clapenvfeature in the workspaceCargo.toml.
Notes
- Keep the credential variables in
credentials.rs. In its conflict rules, clap treats an environment value like a flag. If-ureadsIGGY_USERNAMEthrough clap,-tfails while that variable is set. - Pick the variable names by hand. Names that come from the flags collide with server variables, for example
IGGY_TCP_TLS_ENABLEDandIGGY_ENCRYPTION_KEY. - A release server warns about unknown
IGGY_*variables, and a debug build refuses to boot (core/configs/src/configs_impl/file_provider.rs:130). Add each new name toSERVER_PROCESS_ENV_VARS(core/configs/src/server_config/server.rs:50).
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 548
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 194
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iggy
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 2 days
-
go good first issue test
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
good first issue java test
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
good first issue javascript test
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
Similar issues
-
bug triaged tui ux wontfix
Difficulty 2/5 Half a day Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
bevyengine/bevy#26642 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day