Skip to content

Commit

Permalink
feat: add RHDA_TOKEN param to Exhort JS API request (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
IlonaShishov authored Oct 2, 2023
1 parent 1e4a81a commit 292a631
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Config
npm_executable: string;
go_executable: string;
exhort_dev_mode: string;
telemetry_id: string;

constructor() {
// TODO: this needs to be configurable
Expand All @@ -30,6 +31,7 @@ class Config
this.npm_executable = process.env.NPM_EXECUTABLE || 'npm';
this.go_executable = process.env.GO_EXECUTABLE || 'go';
this.exhort_dev_mode = process.env.EXHORT_DEV_MODE || 'false';
this.telemetry_id = process.env.TELEMETRY_ID || '';
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
'use strict';

import * as path from 'path';
import * as fs from 'fs';

import {
createConnection,
Expand All @@ -27,7 +26,6 @@ import {
TextDocument
} from 'vscode-languageserver-textdocument';

import { execSync } from 'child_process';
import exhort from '@RHEcosystemAppEng/exhort-javascript-api';


Expand Down Expand Up @@ -200,7 +198,8 @@ const fetchVulnerabilities = async (fileType: string, reqData: any) => {
'EXHORT_MVN_PATH': globalSettings.mvnExecutable,
'EXHORT_NPM_PATH': globalSettings.npmExecutable,
'EXHORT_GO_PATH': globalSettings.goExecutable,
'EXHORT_DEV_MODE': config.exhort_dev_mode
'EXHORT_DEV_MODE': config.exhort_dev_mode,
'RHDA_TOKEN': config.telemetry_id
};
if (globalSettings.exhortSnykToken !== '') {
options['EXHORT_SNYK_TOKEN'] = globalSettings.exhortSnykToken;
Expand Down

0 comments on commit 292a631

Please sign in to comment.