Skip to content

Commit

Permalink
Update Webview v0.3.0 (#506)
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas authored Nov 26, 2024
1 parent f336317 commit 9f051b6
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 25 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
"adm-zip": "~0.5.9",
"fs-extra": "~10.1.0",
"jfrog-client-js": "^2.9.0",
"jfrog-ide-webview": "https://releases.jfrog.io/artifactory/ide-webview-npm/jfrog-ide-webview/-/jfrog-ide-webview-0.2.14.tgz",
"jfrog-ide-webview": "https://releases.jfrog.io/artifactory/ide-webview-npm/jfrog-ide-webview/-/jfrog-ide-webview-0.3.0.tgz",
"js-yaml": "^4.1.0",
"json2csv": "~5.0.7",
"nuget-deps-tree": "^0.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/main/diagnostics/descriptorActionProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class DescriptorActionProvider extends AbstractFileActionProvider impleme
if (!dependency || dependency.indirect || !this.availableUpdateManager(dependency)) {
return actions;
}

dependency.getFixedVersionToCves().forEach((cves: Set<string>, fixedVersion: string) => {
previousCves = new Set([...previousCves, ...cves]);
actions.push(this.createFixAction(dependency, previousCves, fixedVersion));
Expand Down
4 changes: 2 additions & 2 deletions src/main/scanLogic/scanManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ export class ScanManager implements ExtensionComponent {
}
if (scanDetails.jasRunnerFactory.supportedScans.tokenValidation) {
if (params) {
params.tokenValidation = scanDetails.jasRunnerFactory.supportedScans.tokenValidation
params.tokenValidation = scanDetails.jasRunnerFactory.supportedScans.tokenValidation;
} else {
params = {tokenValidation: scanDetails.jasRunnerFactory.supportedScans.tokenValidation}
params = { tokenValidation: scanDetails.jasRunnerFactory.supportedScans.tokenValidation };
}
}
for (const runner of jasRunners) {
Expand Down
3 changes: 1 addition & 2 deletions src/main/scanLogic/scanRunners/analyzerManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ export class AnalyzerManager {
};
}


private async populateOptionalInformation(binaryVars: NodeJS.ProcessEnv, params?: BinaryEnvParams) {
// Optional proxy information - environment variable
let proxyHttpUrl: string | undefined = process.env['HTTP_PROXY'];
Expand All @@ -164,7 +163,7 @@ export class AnalyzerManager {
}

if (params?.tokenValidation && params.tokenValidation === true) {
binaryVars[AnalyzerManager.JF_VALIDATE_SECRETS] = "true"
binaryVars[AnalyzerManager.JF_VALIDATE_SECRETS] = 'true';
}
if (proxyHttpUrl) {
binaryVars[AnalyzerManager.ENV_HTTP_PROXY] = this.addOptionalProxyAuthInformation(proxyHttpUrl);
Expand Down
2 changes: 1 addition & 1 deletion src/main/scanLogic/scanRunners/applicabilityScan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ export class ApplicabilityRunner extends JasRunner {
let potential: CveApplicableDetails | undefined = applicableCvesIdToDetails.get(scannedCve);
if (potential) {
relevantApplicableCve.set(scannedCve, potential);
continue
continue;
}
potential = notApplicableCvesIdToDetails.get(scannedCve);
if (potential) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/scanLogic/sourceCodeScan/supportedScans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export class SupportedScans {
private _tokenValidation?: boolean;
constructor(private _connectionManager: ConnectionManager, protected _logManager: LogManager) {}

get tokenValidation(): boolean | undefined {
return this._tokenValidation
get tokenValidation(): boolean | undefined {
return this._tokenValidation;
}

public setTokenValidation(value: boolean| undefined): SupportedScans {
public setTokenValidation(value: boolean | undefined): SupportedScans {
this._tokenValidation = value;
return this;
}
Expand Down Expand Up @@ -87,8 +87,8 @@ export class SupportedScans {
);
requests.push(
this.isTokenValidationEnabled()
.then(res => this.setTokenValidation(res))
.catch(err => ScanUtils.onScanError(err, this._logManager, true))
.then(res => this.setTokenValidation(res))
.catch(err => ScanUtils.onScanError(err, this._logManager, true))
);
await Promise.all(requests);
return this;
Expand Down Expand Up @@ -121,10 +121,10 @@ export class SupportedScans {
return await ConnectionUtils.testXrayEntitlementForFeature(this._connectionManager.createJfrogClient(), EntitlementScanFeature.Sast);
}

/**
/**
* Check if token validation scan is enabled
*/
public async isTokenValidationEnabled(): Promise<boolean> {
public async isTokenValidationEnabled(): Promise<boolean> {
let xraySemver: semver.SemVer = new semver.SemVer(this._connectionManager.xrayVersion);
if (xraySemver.compare(DYNAMIC_TOKEN_VALIDATION_MIN_XRAY_VERSION) < 0) {
this._logManager.logMessage(
Expand Down
15 changes: 8 additions & 7 deletions src/main/treeDataProviders/utils/analyzerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,13 @@ export class AnalyzerUtils {
);
let fileIssue: SecurityIssue = AnalyzerUtils.getOrCreateSecurityIssue(fileWithIssues, analyzeIssue, fullDescription);
let newLocation: FileRegion = location.physicalLocation.region;
let properties: {[key: string]: string} = {
"tokenValidation": analyzeIssue.properties?.tokenValidation
? (analyzeIssue.properties.tokenValidation.trim() as keyof typeof TokenStatus) : '',
"metadata": analyzeIssue.properties?.metadata ? analyzeIssue.properties.metadata.trim() : ''
}
newLocation.properties = properties
let properties: { [key: string]: string } = {
tokenValidation: analyzeIssue.properties?.tokenValidation
? (analyzeIssue.properties.tokenValidation.trim() as keyof typeof TokenStatus)
: '',
metadata: analyzeIssue.properties?.metadata ? analyzeIssue.properties.metadata.trim() : ''
};
newLocation.properties = properties;
fileIssue.locations.push(newLocation);
});
}
Expand Down Expand Up @@ -262,7 +263,7 @@ export class AnalyzerUtils {
// Not Applicable
let notApplicableApplicableDetails: CveApplicableDetails | undefined = descriptorNode.notApplicableCve?.get(node.labelId);
if (!notApplicableApplicableDetails) {
continue
continue;
}
evidences.push({
reason: notApplicableApplicableDetails.fixReason
Expand Down

0 comments on commit 9f051b6

Please sign in to comment.