Render a patch's vulnerability labels through one ui helper: scan, get and list each write the CVE-else-advisory rule, and their order, dedup and severity case drifted
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read ui/mod.rs and the referenced helpers in scan/render.rs, get.rs, and list.rs to trace the current label, ordering, deduplication, and severity behavior. Update the render byte tests in scan/render.rs and tests/cli/list_render.rs, and add a unit test for a CVE shared by two advisories. Done means all three commands use the shared UI helpers and the acceptance criteria pass.
索引モデルが issue の本文から書いたものです。
説明
[agent] Filed by the scheduled architecture audit (audit-cli-tests). Register: register comment.
Kind: refactor. Register ID: T28 (its JSON sibling is T02, #1836; its severity sibling is T10).
Problem
The human label of a vulnerability follows one rule: its CVE ids sorted, otherwise the advisory id. That rule is written four times:
- scan: scan/render.rs
vuln_labelL385-L393,`` sorted worst-severity-first bysorted_vulnsL371-L381; - get: get.rs L372-L382, the same body;
- get again:
vuln_labelsL222-L236, which flattens and dedups; - list: list.rs L284-L288, which prints the advisory id with its CVEs in parentheses, unsorted, and sanitized.
The copies have drifted (verified by reading):
- Order. scan orders the
Fixes:list by severity; get orders it by label. - Dedup. scan doesn't dedup, so a CVE shared by two advisories prints twice; get dedups.
- Severity label. get prints it uppercased (get.rs L289). scan's preview prints the raw API label through
ui::severity, which passes unknown labels through unchanged. scan's policy line prints core's canonicalseverity_name, so "medium" appears where the API said "moderate" (policy.rs L752). - Sanitizing. Only list filters the API text (T23).
Proposed change
- Add
ui::vuln_labels(&HashMap<String, VulnerabilityResponse>) -> Vec<String>: CVEs else the id, deduped, in one documented order. - Add one
ui::severity_label(&str)that uses core'sseverity_name. - scan, get and list call these helpers. Delete
render::vuln_label/sorted_vulns, get's two copies and list's inline format.
Size
4 files (ui/mod.rs, scan/render.rs, get.rs, list.rs). Roughly −50 / +25.
Acceptance criteria
- The render byte tests in
scan/render.rsandtests/cli/list_render.rsare updated deliberately, once, to the chosen order and case. - A new unit test shows a CVE shared by two advisories printed once.
- No CLI file keeps its own CVE-else-id closure.
- 主要言語
- Rust
- スター
- 8
- フォーク
- 2
- 平均マージ
- 18時間 47分
- マージ済み PR(30日)
- 637
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
SocketDev/socket-patch のほかの issue
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
SocketDev/socket-patch#1860 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SocketDev/socket-patch#1838 ·
メンテナーはふだん 1 日以内に返信
-
arch-audit refactor
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
SocketDev/socket-patch#1987 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit priority:p3 refactor
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
SocketDev/socket-patch#1983 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
agent:triaged arch-audit bug priority:p3
難易度 3/5 半日 初心者へのやさしさ 55/100
SocketDev/socket-patch#1982 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
SocketDev/socket-patch の issue をすべて見る
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 70/100
OpenZeppelin/openzeppelin-relayer#967 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
src/runs.rs:1987: a missing --source-run-id now answers 400 "Source run ... does not exist", not 404オープンnightly-audit
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
antithesishq/snouty#602 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
libnativeapi/nativeapi#21 ·