fix(shared): validate SOURCEBOT_ENCRYPTION_KEY length#1305
Conversation
The key is used directly as a 32-byte AES-256-CBC key. Validate its length at startup so a misconfigured key fails fast with an actionable message instead of a RangeError deep in an encryption call. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
WalkthroughThis PR adds strict validation for the ChangesEncryption Key Length Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
The test value was named "...-32-characters!" but was actually 34 chars, which now fails the length validation. Replace it with a true 32-character value. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes SOU-1311
SOURCEBOT_ENCRYPTION_KEYis used directly as the 32-byte key for AES-256-CBC encryption. A wrong-length key previously surfaced as an opaqueRangeError: Invalid key lengthdeep inside an encryption call. This validates the key is exactly 32 characters at startup, failing fast with an actionable message.🤖 Generated with Claude Code
Summary by CodeRabbit