Repository navigation
Reject token and HMAC secrets shorter than 16 bytes - #11
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review. 📝 WalkthroughWalkthroughSecret resolution now requires nonempty token and HMAC secrets to be at least 16 bytes. Tests, documentation, and the Quick start example use secrets that meet this minimum. ChangesSecret Length Enforcement
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Short token and HMAC secrets fail validation, and affected sources do not forward requests. The implementation, tests, and documentation align; no merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change strengthens authentication and preserves fail-closed behavior. The main rollout risk is that previously accepted short secrets, including populated optional rotation secrets, now disable their sources until corrected and restarted. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 23.08% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 13 functions across 5 files. (2 skipped: 2 unsupported.) Full details: Description checkExplanation The description explains the user-visible behavior, tests, documentation updates, and security constraint. It does not include the required "## What changes for users" and "## Checklist" sections, and it does not confirm that ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
|
Code Review ✅ Approved🔴 High risk · Rejecting token and HMAC secrets under 16 bytes changes request authentication; existing integrations using short secrets could become unavailable with 503 responses. Adds validation to reject token and HMAC secrets shorter than 16 bytes, keeping affected sources unavailable ( OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |



A token or HMAC secret shorter than 16 bytes now fails to build its check, the same way a missing secret does: the source is not ready (
503, nothing forwarded,hookgate_source_ready0) andhookgate validateexits 1. The error names the reference (env:NAMEorfile:PATH), never the value. Optional secrets that are set are held to the same minimum;set_headersvalues are upstream credentials and are not affected.Summary by CodeRabbit
Bug Fixes
503, including when a short secret is marked optional.Documentation