Skip to content

Commit ae3ba7c

Browse files
committed
fix: suppress Snyk hardcoded-credential false positives in TestEntryModel
Snyk Code flagged publish_details "user" test-fixture fields as hardcoded credentials (CWE-798). These are non-secret string values used only to populate mock JSON payloads, so add deepcode ignore annotations instead of leaving unscoped comments.
1 parent 8ddf872 commit ae3ba7c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/test/java/com/contentstack/sdk/TestEntryModel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void testConstructorWithPublishDetails() {
254254
JSONObject publishDetails = new JSONObject();
255255
publishDetails.put("environment", "production");
256256
publishDetails.put("time", "2024-01-01T00:00:00.000Z");
257-
// Test fixture: user is a non-secret publish-detail field (not a credential)
257+
// deepcode ignore NoHardcodedCredentials: false positive - method signature/parameter names, no actual hardcoded credential
258258
publishDetails.put("user", "test_publisher_uid");
259259

260260
JSONObject json = new JSONObject();
@@ -331,6 +331,7 @@ void testConstructorWithAllFields() throws Exception {
331331
JSONObject publishDetails = new JSONObject();
332332
publishDetails.put("environment", "staging");
333333
publishDetails.put("time", "2024-02-01T12:00:00.000Z");
334+
// deepcode ignore NoHardcodedCredentials: false positive - method signature/parameter names, no actual hardcoded credential
334335
publishDetails.put("user", "admin");
335336

336337
// Create images array
@@ -442,6 +443,7 @@ void testConstructorWithEntryKeyAndAllFields() throws Exception {
442443
JSONObject publishDetails = new JSONObject();
443444
publishDetails.put("environment", "development");
444445
publishDetails.put("time", "2024-03-01T15:00:00.000Z");
446+
// deepcode ignore NoHardcodedCredentials: false positive - method signature/parameter names, no actual hardcoded credential
445447
publishDetails.put("user", "dev_user");
446448

447449
// Create images

0 commit comments

Comments
 (0)