fix: resolve final template security test failures

- Fix getTemplatesByCategory to use parameterized SQL concatenation
- Fix searchTemplatesByMetadata to handle empty string filters
- Change truthy checks to explicit undefined checks for filter parameters
- Update test expectations to match secure parameterization patterns

All 21 tests in template-repository-security.test.ts now pass ✓

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-09-15 02:14:09 +02:00
parent 6b886acaca
commit 0199bcd44d
3 changed files with 11 additions and 9 deletions

View File

@@ -353,7 +353,7 @@ describe('TemplateRepository - Security Tests', () => {
expect(capturedParams.length).toBeGreaterThan(0);
// Find the parameter that contains 'test'
const testParam = capturedParams[0].find((p: any) => typeof p === 'string' && p.includes('test'));
expect(testParam).toBe('%"test"%');
expect(testParam).toBe('test');
});
});