cli: add TLS flags, keep secrets out of arguments, and read environment variables

オープン
#4,451 コメント 2 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@ByteBaker がすでに取り組んでいます。

2026年10月22日 から。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
30/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

enhancement tui

Problem

  • TLS over TCP: the CLI always validates the server certificate (core/sdk/src/client_provider.rs:141), and it trusts only the built-in webpki_roots (core/sdk/src/tcp/tcp_client.rs:1219). The SDK Args has tcp_tls_ca_file (core/common/src/types/args/mod.rs:269), but the CLI flags in ArgsOptional (:29) do not. So the CLI cannot reach a TCP TLS server with a self-signed or private CA certificate.
  • TLS over WebSocket: ArgsOptional has none of the websocket_tls_* fields (:344-353), so the CLI cannot enable WebSocket TLS. context create has no WebSocket address flag. TLS keys that you add to contexts.toml by hand are ignored.
  • Secrets: user create takes the password only as a positional argument, so the password goes into shell history. context create stores 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_HOME and the pair IGGY_USERNAME and IGGY_PASSWORD, and --help lists 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 to contexts.toml.

Proposal

  • Add --tcp-tls-ca-file and 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 localhost default 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 ArgsOptional into the context create arguments, so that a context can hold every connection flag.
  • If the user create password 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_HOME and the context name, and remove them on context delete. If no keyring is available, keep the current file.
  • Read IGGY_TOKEN next to the IGGY_USERNAME and IGGY_PASSWORD pair (core/cli/src/credentials.rs:148). The flags win over it, and it wins over the pair.
  • Give the connection flags env attributes with explicit names and hide_env_values, through mut_arg in the CLI. The data seeder also uses ArgsOptional. This needs the clap env feature in the workspace Cargo.toml.

Notes

  • Keep the credential variables in credentials.rs. In its conflict rules, clap treats an environment value like a flag. If -u reads IGGY_USERNAME through clap, -t fails 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_ENABLED and IGGY_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 to SERVER_PROCESS_ENV_VARS (core/configs/src/server_config/server.rs:50).
主要言語
Rust
スター
5.3k
フォーク
548
平均マージ
2日 20時間
マージ済み PR(30日)
194

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/iggy のほかの issue

apache/iggy の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。