Skip to content

Commit 818df44

Browse files
committed
CR
1 parent 98fe291 commit 818df44

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

src/main/scanLogic/scanManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,8 @@ export class ScanManager implements ExtensionComponent {
172172
* Check if SAST scan is supported for the user
173173
*/
174174
public async isSastSupported(): Promise<boolean> {
175-
return true;
175+
// TODO: change to SAST feature when Xray entitlement service support it.
176+
return await ConnectionUtils.testXrayEntitlementForFeature(this._connectionManager.createJfrogClient(), EntitlementScanFeature.Applicability);
176177
}
177178

178179
/**

src/main/scanLogic/scanRunners/binaryRunner.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export abstract class BinaryRunner {
144144
*/
145145
private async executeBinaryTask(args: string[], executionLogDirectory?: string): Promise<any> {
146146
let command: string = '"' + this._binary.fullPath + '" ' + args.join(' ');
147-
this._logManager.debug('Executing ' + command);
147+
this._logManager.debug("Executing '" + command + "' in directory '" + this._runDirectory + "'");
148148
let std: any = await ScanUtils.executeCmdAsync(command, this._runDirectory, this.createEnvForRun(executionLogDirectory));
149149
if (std.stdout && std.stdout.length > 0) {
150150
this.logTaskResult(std.stdout, false);
@@ -256,26 +256,25 @@ export abstract class BinaryRunner {
256256
*/
257257
private createRunArguments(request: AnalyzeScanRequest): RunArgs {
258258
let args: RunArgs = new RunArgs(ScanUtils.createTmpDir());
259-
let processedRoots: Set<string> = new Set<string>();
260-
261-
if (request.roots.length > 0 && request.roots.every(root => !processedRoots.has(root))) {
262-
// Prepare request information and insert as an actual request
263-
const requestPath: string = path.join(args.directory, 'request_' + args.requests.length);
264-
const responsePath: string = path.join(args.directory, 'response_' + args.requests.length);
265-
if (request.type !== ScanType.Sast) {
266-
request.output = responsePath;
267-
}
268-
request.type = this._type;
269-
request.roots.forEach(root => processedRoots.add(root));
270-
// Add request to run
271-
args.requests.push({
272-
type: request.type,
273-
request: this.requestsToYaml(request),
274-
requestPath: requestPath,
275-
roots: request.roots,
276-
responsePath: responsePath
277-
} as RunRequest);
259+
if (request.roots.length === 0) {
260+
return args;
261+
}
262+
263+
// Prepare request information and insert as an actual request
264+
const requestPath: string = path.join(args.directory, 'request_' + args.requests.length);
265+
const responsePath: string = path.join(args.directory, 'response_' + args.requests.length);
266+
if (request.type !== ScanType.Sast) {
267+
request.output = responsePath;
278268
}
269+
request.type = this._type;
270+
// Add request to run
271+
args.requests.push({
272+
type: request.type,
273+
request: this.requestsToYaml(request),
274+
requestPath: requestPath,
275+
roots: request.roots,
276+
responsePath: responsePath
277+
} as RunRequest);
279278

280279
return args;
281280
}

0 commit comments

Comments
 (0)