Repository navigation
Redaction: keep the 40-character key rule, test value rules directly - #355
Conversation
The entropy check alone let low-entropy AWS-style keys through. The fixtures named *_TOKEN / *_SECRET were blanked by name before the value rules ran, so the tests did not cover them.
PR Summary by QodoRestore low-entropy 40-character key redaction
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Some relative paths appear blank in the editor
|
| if (value.length === 40 && /[A-Z]/.test(value) && /[a-z]/.test(value)) { | ||
| return true; | ||
| } |
There was a problem hiding this comment.
1. Some relative paths appear blank in the editor 🐞 Bug ≡ Correctness
isBase64Secret now returns true for any 40-character, mixed-case value with a digit that passes its Base64-alphabet check, even when the value is a low-entropy relative path. For example, opt/Ghidra11/support/analyzeHeadlessTool meets those conditions, so a server using it as a literal environment value receives an empty string in the project API response and edit form.
Agent Prompt
## Issue description
The new 40-character shortcut blanks legitimate low-entropy relative paths, hiding their configured values in the server editor.
## Fix Focus Areas
- src/server/secret-redaction.ts[73-80]
- src/server/__tests__/secret-redaction.test.ts[99-120]
## Recommended Fix
Distinguish path-shaped values, such as relative paths with multiple word-like segments, before applying the low-entropy 40-character shortcut. Add a test for a 40-character relative path while retaining coverage for the low-entropy key.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Summary
Fourth round of Qodo follow-ups for the v2.4.0 release, on top of #354. Both comments on #354 were valid.
Stacked on #354: merge this into
fix/release-240-review-3first, then #354 intofix/release-240-review-2, #353 intofix/release-240-review, and #352 intodevelop.What changed
secret-redaction.ts): the 40-character mixed-case rule from fix: second round of v2.4.0 release review follow-ups #353 is back alongside the entropy check, so a key likeAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/a1B2is blanked again.secret-redaction.test.ts):LETTER_TOKEN_URLandAWS_SECRETcontainedTOKENandSECRET, so the name rule blanked them before the value was checked. They are renamed toMIRROR_URLandAWS_VALUE, andLOW_ENTROPY_40covers the case above.Test plan
MIRROR_URL, and removing the 40-character rule fails it onLOW_ENTROPY_40.bunx tsc --noEmitpasses.Checklist
bunx tsc --noEmitpasses🤖 Generated with Claude Code