Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/secrets/CxSecrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {CxRealtimeEngineStatus} from "../oss/CxRealtimeEngineStatus";
export default class CxSecretsResult {
title: string;
description: string;
secretValue: string;
filepath: string;
severity: CxRealtimeEngineStatus;
locations: { line: number, startIndex: number, endIndex: number }[];
Expand All @@ -14,6 +15,7 @@ export default class CxSecretsResult {
const secretsResult = new CxSecretsResult();
secretsResult.title = member.Title;
secretsResult.description = member.Description;
secretsResult.secretValue = member.SecretValue;
secretsResult.filepath = member.FilePath;
secretsResult.severity = member.Severity as CxRealtimeEngineStatus;
secretsResult.locations = Array.isArray(member.Locations)
Expand Down
6 changes: 3 additions & 3 deletions src/tests/ScanTest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ describe("ScanCreate cases", () => {
expect(cxCommandOutput.exitCode).toBe(0);
});

it.skip('ScanOss with ignored package should filter results', async () => {
it('ScanOss with ignored package should filter results', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const sourceFile = "tsc/tests/data/package.json";
const ignoredFile = "tsc/tests/data/checkmarxIgnoredTempFile.json";
Expand Down Expand Up @@ -213,7 +213,7 @@ describe("ScanCreate cases", () => {
expect(cxCommandOutput.exitCode).toBe(0);
});

it.skip('ScanSecrets with ignore file filters the result', async () => {
it('ScanSecrets with ignore file filters the result', async () => {
const wrapper = new CxWrapper(cxScanConfig);
const cxCommandOutput: CxCommandOutput = await wrapper.secretsScanResults(
"src/tests/data/secret-exposed.txt",
Expand All @@ -223,7 +223,7 @@ describe("ScanCreate cases", () => {
console.log("Json object from scanSecrets with ignore file: " + JSON.stringify(cxCommandOutput));
expect(cxCommandOutput.payload).toBeDefined();
expect(Array.isArray(cxCommandOutput.payload)).toBe(true);
expect(cxCommandOutput.payload.length).toBe(0);
expect(cxCommandOutput.payload.pop().length).toBe(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we check that we dont get any output?

expect(cxCommandOutput.exitCode).toBe(0);
});

Expand Down
2 changes: 1 addition & 1 deletion src/tests/data/ignoreFileSecrets.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"Title": "github-pat",
"FilePath": "/Users/itaypaz/Library/CloudStorage/OneDrive-Checkmarx/Documents/jswrapper/ast-cli-javascript-wrapper/src/tests/data/secret-exposed.txt",
"FilePath": "src/tests/data/secret-exposed.txt",
"Line": 3
}
]
Loading