refactor: modernize UserItem.CSVImport - use csv module for parsing
還沒有人認領這個 Issue。
評估
研究方向
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
- 分支
- 444
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
tableau/server-client-python 的其他 Issue
-
WorkbookItem.update() always sends an empty <dataAccelerationConfig/> even when never set可能已有人在做 @jacalata 於 15 天前認領。 未關閉in-progress
難度 2/5 1-3 小時 新手友好度 78/100
tableau/server-client-python#1884 ·
-
難度 2/5 1-3 小時 新手友好度 70/100
tableau/server-client-python#1865 ·
-
security: _validate_import_line_or_throw logs credential fields at DEBUG level可能已有人在做 @jacalata 於 56 天前認領。 未關閉in-progress
難度 2/5 1-3 小時 新手友好度 78/100
tableau/server-client-python#1829 · 1 則留言 ·
-
enhancement gap needs investigation stale
難度 2/5 1-3 小時 新手友好度 68/100
tableau/server-client-python#1322 · 2 則留言 ·
-
[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 則留言 ·
查看 tableau/server-client-python 的全部 Issue
相似的 Issue
-
難度 1/5 1 小時以內 新手友好度 60/100
521xueweihan/HelloGitHub#3924 ·
-
難度 2/5 1-3 小時 新手友好度 67/100
wilbowes/EchoMuse#869 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
-
namespace operations
難度 1/5 1 小時以內 新手友好度 72/100
EclipseFdn/open-vsx.org#14043 ·
維護者通常 1 天內回覆
-
test: TestServeUntilStale races the server's close against the client's sendall (BrokenPipeError under load)可能已有人在做 @evoludigit 今天認領。 未關閉
難度 1/5 1 小時以內 新手友好度 89/100
維護者通常 1 天內回覆