Skip to content

Commit 0f70cfd

Browse files
Use dastEnabled
1 parent 7ae77cd commit 0f70cfd

File tree

3 files changed

+12
-48
lines changed

3 files changed

+12
-48
lines changed

src/main/license/JwtClaims.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/main/wrapper/CxConstants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export enum CxConstants {
2121
CMD_REMEDIATION = "remediation",
2222
SUB_CMD_REMEDIATION_SCA = "sca",
2323
SUB_CMD_TENANT = "tenant",
24-
SUB_CMD_LICENSE = "license",
2524
KICS_REMEDIATION_RESULTS_FILE = "--results-file",
2625
KICS_REMEDIATION_KICS_FILE = "--kics-files",
2726
KICS_REMEDIATION_SIMILARITY_IDS = "--similarity-ids",
@@ -120,6 +119,7 @@ export enum CxConstants {
120119
AI_GUIDED_REMEDIATION_KEY = "scan.config.plugins.aiGuidedRemediation",
121120
STANDALONE_KEY = "scan.config.plugins.cxdevassist",
122121
ASSIST_KEY = "scan.config.plugins.cxoneassist",
122+
DAST_ENABLED_KEY = "scan.config.plugins.dastenabled",
123123
AI_MCP_SERVER_KEY = "scan.config.plugins.aiMcpServer",
124124
TELEMETRY = "telemetry",
125125
SUB_CMD_TELEMETRY_AI = "ai",

src/main/wrapper/CxWrapper.ts

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import * as os from "os";
99
import CxBFL from "../bfl/CxBFL";
1010
import path = require('path');
1111
import { getTrimmedMapValue } from "./utils";
12-
import { JwtClaims } from "../license/JwtClaims";
1312

1413
type ParamTypeMap = Map<CxParamType, string>;
1514

@@ -513,6 +512,17 @@ export class CxWrapper {
513512
return value?.toLowerCase() === "true";
514513
}
515514

515+
async dastEnabled(): Promise<boolean> {
516+
const commands: string[] = [CxConstants.CMD_UTILS, CxConstants.SUB_CMD_TENANT];
517+
commands.push(...this.initializeCommands(false));
518+
519+
const exec = new ExecutionService();
520+
const output = await exec.executeMapTenantOutputCommands(this.config.pathToExecutable, commands);
521+
522+
const value = getTrimmedMapValue(output, CxConstants.DAST_ENABLED_KEY);
523+
return value?.toLowerCase() === "true";
524+
}
525+
516526
async aiMcpServerEnabled(): Promise<boolean> {
517527
const commands: string[] = [CxConstants.CMD_UTILS, CxConstants.SUB_CMD_TENANT];
518528
commands.push(...this.initializeCommands(false));
@@ -652,25 +662,4 @@ export class CxWrapper {
652662
}
653663
return r;
654664
}
655-
656-
/**
657-
* Gets license details from the JWT token
658-
*/
659-
async getLicenseDetails(): Promise<JwtClaims | null> {
660-
const commands: string[] = [
661-
CxConstants.CMD_UTILS,
662-
CxConstants.SUB_CMD_LICENSE,
663-
CxConstants.FORMAT,
664-
CxConstants.FORMAT_JSON
665-
];
666-
commands.push(...this.initializeCommands(false));
667-
668-
const exec = new ExecutionService();
669-
const output = await exec.executeCommands(this.config.pathToExecutable, commands);
670-
671-
if (output.exitCode === 0 && output.payload) {
672-
return JwtClaims.fromJson(output.payload);
673-
}
674-
return null;
675-
}
676665
}

0 commit comments

Comments
 (0)