Repository navigation
fix: replace hardcoded secret literals in test fixtures with approved placeholders - #2743
Conversation
… placeholders Replace Snyk-flagged dummy values in unit-test fixtures with the approved placeholders: apiKey -> API_KEY / STACK_API_KEY, access_token -> ACCESS_TOKEN, password -> PASSWORD, MFA test secrets -> SECRET / TOKEN. Coupled assertions updated. Test-only change, plus refreshed pnpm-lock.yaml. No source changes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
mfa-handler requires >=16 char base32 secrets; the placeholder values were too short and failed CI. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
🔒 Security Scan Results
⏱️ SLA Breach Summary
ℹ️ Vulnerabilities Without Available Fixes (Informational Only)The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:
Consider reviewing these vulnerabilities when fixes become available. |
Summary
Snyk Code flagged hardcoded values in unit-test fixtures ("Hardcoded Non-Cryptographic Secret" and "Use of Hardcoded Passwords"). All of them were dummy test values, not real credentials. This replaces them with the approved placeholders from the team's "Standard Approved Dummy Secrets" doc.
Snyk Code on
developmentbefore: 15 findings. After this change: 10 test-file findings cleared; 5 remain, all insrc/(see Notes).Changes (test files only, no source changes)
API_KEY/STACK_API_KEY(kept distinct intokens-remove.test.ts)ACCESS_TOKENPASSWORDSECRET/TOKENtokens-remove.test.ts) are updated with them.pnpm-lock.yamlrefreshed.Testing
@contentstack/cli-utilities: 199 passing with the changes.@contentstack/cli-authtests are run separately (needscli-commandbuilt).Snyk Code (
snyk test --code --all-project) confirms the 10 test findings are gone.Notes / out of scope
The 5 remaining findings are in source code and intentionally untouched here:
contentstack-utilities/src/encrypter.ts:14and:27(default encryption key and scrypt salt; changing them would break decryption of existing stored data)contentstack-utilities/src/helpers.ts:119and:121(error-message label map, false positive)contentstack-utilities/src/auth-handler.ts:147(http.createServerfor the local OAuth callback)🤖 Generated with Claude Code