fix: mask short API keys#208
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)tests/**/*.mjs📄 CodeRabbit inference engine (AGENTS.md)
Files:
src/**/*.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
🔇 Additional comments (4)
📝 WalkthroughWalkthroughThe masking calculation in ChangesmaskApiKey Security Fix
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
its-Sohan
left a comment
There was a problem hiding this comment.
Nice fix, the logic is correct and addresses the issue well.
One note: the formatting change to updateConfigField (collapsed to one line) is unrelated to the bug fix — separating formatting from logic keeps PRs cleaner. Minor, not blocking.
The key change (Math.floor(apiKey.length / 2)) is clean and the tests cover all edge cases properly. LGTM.
Closes #203.
Summary
configoutputmaskApiKeycoverage for short key lengthsVerification
npm run buildnode dist/index.js --helpnode --test tests/config-command.test.mjsgit diff --checkSummary by CodeRabbit