refactor: modernize UserItem.CSVImport - use csv module for parsing
まだ誰も着手していません。
評価
調査の方向性
Start with UserItem.CSVImport, validate_file_for_import, _validate_import_line_or_throw, and create_user_from_line, then inspect test_password_with_comma_partially_masks. Done means parsing and username extraction use csv handling, and empty-input and too-many-column errors follow one convention.
索引モデルが issue の本文から書いたものです。
説明
UserItem.CSVImport has some internal design smells worth cleaning up.
1. Use the csv module for parsing. Today the code does line.split(","), which misaligns whenever a field contains a comma - a password like "my,pa\$\$w0rd", a display name like "Smith, John". The column-1 mask added in #1829 only covers what lands in column 1; bytes that spill into column 2+ still leak (see test_password_with_comma_partially_masks). csv.reader also handles quoted values, CRLF, and BOM deliberately rather than coincidentally.
2. Consolidate two username extractions. validate_file_for_import uses line.partition(",")[0].strip(), while _validate_import_line_or_throw uses list(map(str.strip, line.split(",")))[USERNAME]. Same result today, but a maintenance hazard. A csv.reader migration collapses both.
3. Align error handling in create_user_from_line. It returns None for empty input but raises ValueError for too many columns. Pick one convention.
🤖 Generated with Claude Code
- 主要言語
- Python
- スター
- 716
- フォーク
- 446
- 平均マージ
- 8日 8時間
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tableau/server-client-python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
tableau/server-client-python#1865 ·
-
in-progress
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
tableau/server-client-python#1829 · コメント 1 件 ·
-
enhancement gap needs investigation
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tableau/server-client-python#1322 · コメント 1 件 ·
-
[Type2] Allow Incremental Refresh type schedules to be added via `server.schedules.add_to_schedule` オープンhelp wanted Server-Side Enhancement ui-exists
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tableau/server-client-python#1101 · コメント 3 件 ·
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tableau/server-client-python#783 · コメント 5 件 ·
tableau/server-client-python の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
canonical/paas-charm#368 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
tech debt
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
StevenBlack/hosts#3256 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
qualcomm/qai-appbuilder#275 ·