Skip to content

ターミナル出力の堅牢化(エラーサニタイズ・1行化・レートリミット)#13

Closed
mimo-3 wants to merge 17 commits into
add-usergroups-commandfrom
harden-terminal-output
Closed

ターミナル出力の堅牢化(エラーサニタイズ・1行化・レートリミット)#13
mimo-3 wants to merge 17 commits into
add-usergroups-commandfrom
harden-terminal-output

Conversation

@mimo-3

@mimo-3 mimo-3 commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Summary

PR #12 のレビューで挙がったターミナル出力まわりの残指摘に対応しました(#12 マージ後に main へ向く積みPRです)。

  • エラー出力のサニタイズ: wrapCommand のエラーメッセージ・スタックトレースにターミナルサニタイズを適用しました。適用順は「サニタイズ → トークン秘匿」とし、エスケープシーケンスで分断されたトークンが秘匿をすり抜けるケースを防いでいます
  • 行系出力の1行化: sanitizeSingleLineText ヘルパーを追加し、TSV / テーブル行を構成するフィールド(usergroups / members / users / bookmark / reminder / search / channels / presence)で改行・タブを空白1つに畳むようにしました。Slack 側の表示名等に改行を仕込んで偽の行・列を挿入する攻撃の対策です。search のテーブル形式の本文のみ、ブロック表示の従来挙動を維持しています
  • レートリミット: users.info を共有レートリミッタ(並列3)経由にし、大きなグループの members / usergroups members で 429 を踏みにくくしました

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation / chore / dependency update

Test plan

  • Added/updated vitest specs for the changed behavior(27件追加、全750件パス)
  • npm run check passes
  • npm run build passes
  • npm test passes
  • Manually exercised the CLI(出力形の変化は改行入りデータ時のみのため、テストでの検証を主にしています)

Checklist

  • package.json version bumped per semver (patch/minor/major) — 修正のため patch(0.24.0 → 0.24.1)
  • CHANGELOG.md updated with a new entry — fork 以降は GitHub Releases 管理のため更新していません
  • README / docs updated if user-facing surface changed — 外部仕様(オプション・フォーマット種別)に変更はありません

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant