Skip to content

fix: use API_KEY placeholder for hardcoded API keys in test fixtures - #381

Open
cs-raj wants to merge 3 commits into
developmentfrom
fix/hardcoded-secrets-test-fixtures
Open

cs-raj wants to merge 3 commits into
developmentfrom
fix/hardcoded-secrets-test-fixtures

Conversation

@cs-raj

@cs-raj cs-raj commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

First step of the Snyk Code Hardcoded Non-Cryptographic Secret cleanup: this PR covers only API key properties (apiKey, api_key, stackAPIKey, stackApiKey, mockApiKey and the values that flow into them) in unit test fixtures.

Changes (test files only, 39 files, no src/ changes)

  • Hardcoded API-key fixture values are replaced with the plain placeholder API_KEY, per the Engineering Standard Dummy Secret Values & Scanner Mitigation.
  • Tied values and assertions in the same file (e.g. 'stack-api-key' inputs, expect(...).to.equal(...), the 'Stack API key API_KEY' message check) are updated so tests keep matching.
  • The ineffective deepcode ignore HardcodedNonCryptoSecret comments above the fixed lines are removed.
  • Non-API-key values (target_uids, commented-out code, etc.) are left untouched.

Not in this PR (follow-ups)

  • auth_token / access_token / accessToken fixtures
  • encryptionKey / marketplaceAppEncryptionKey fixtures (import marketplace-apps.test.ts, etc.)
  • 18 Use of Hardcoded Passwords findings
  • Medium Path Traversal in contentstack-asset-management/src/query-export/cs-assets-query-exporter.ts

Testing

  • pnpm test run per affected package before and after: identical results (e.g. import 1740 passing, export 513, bulk-operations 857, seed 121, content-type 78).
  • Re-run snyk test --code --all-project to confirm the API-key findings clear.

🤖 Generated with Claude Code

@cs-raj
cs-raj requested a review from a team as a code owner October 29, 2026 12:29
@snyk-io

snyk-io Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 227 25 ✅ Passed
🟡 Medium Severity 0 131 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 227
  • Medium without fixes: 131
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 227 25 ✅ Passed
🟡 Medium Severity 0 131 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 227
  • Medium without fixes: 131
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@cs-raj cs-raj changed the title fix: replace hardcoded secrets in test fixtures with approved placeholders Oct 29, 2026
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 227 25 ✅ Passed
🟡 Medium Severity 0 131 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ 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:

  • Critical without fixes: 0
  • High without fixes: 227
  • Medium without fixes: 131
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant