Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "use service_url option for all commands" #25

Merged
merged 1 commit into from
Oct 10, 2023
Merged
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
24 changes: 8 additions & 16 deletions src/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const constants = require('./constants');
const saclientutil = require('./saclientutil');
const utils = require('./utils');

let service_option = "";
let start = null;
const timeout_minutes = process.env.INPUT_ANALYSIS_TIMEOUT_MINUTES ? process.env.INPUT_ANALYSIS_TIMEOUT_MINUTES : 30;

Expand Down Expand Up @@ -48,7 +47,12 @@ function generateIrx() {
function login() {
let key = utils.sanitizeString(process.env.INPUT_ASOC_KEY);
let secret = utils.sanitizeString(process.env.INPUT_ASOC_SECRET);
let options = "api_login -u " + key + " -P " + secret + getServiceOption();
let options = "api_login -u " + key + "-P " + secret;
if (process.env.INPUT_SERVICE_URL) {
let service_url = utils.sanitizeString(process.env.INPUT_SERVICE_URL);
options += " -service_url " + service_url;
}

return executeCommand(`${options}`);
}

Expand Down Expand Up @@ -76,9 +80,7 @@ function runAnalysis() {
return;
}

let serviceOption = getServiceOption();

executeCommand(`queue_analysis -a ${appId} ${args} ${serviceOption}`)
executeCommand(`queue_analysis -a ${appId} ${args}`)
.then((stdout) => {
//Get the scan id from stdout and return it.
return getScanId(stdout);
Expand All @@ -93,8 +95,7 @@ function runAnalysis() {
}

function checkStatus(scanId) {
let serviceOption = getServiceOption();
return executeCommand(`status -i ${scanId} ${serviceOption}`);
return executeCommand(`status -i ${scanId}`);
}

function waitForAnalysis(scanId) {
Expand Down Expand Up @@ -174,13 +175,4 @@ function getScanId(output) {
})
}

function getServiceOption() {
if (process.env.INPUT_SERVICE_URL && service_option.length === 0) {
let service_url = utils.sanitizeString(process.env.INPUT_SERVICE_URL);
service_option = " -service_url " + service_url;
}

return service_option;
}

module.exports = { generateIrx, login, runAnalysis, waitForAnalysis }
Loading