Skip to content

Commit 1c9066e

Browse files
author
Seth Rait
committed
check caller onboarded
1 parent eb412d7 commit 1c9066e

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

lib/container-mapping.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ContainerMapping {
103103
core.info("Client is not onboarded to Defender for DevOps. Skipping container mapping workload.");
104104
return;
105105
}
106-
core.info("Client is onboarded for container mapping");
106+
core.info("Client is onboarded for container mapping.");
107107
let dockerVersionOutput = yield exec.getExecOutput('docker --version');
108108
if (dockerVersionOutput.exitCode != 0) {
109109
core.info(`Unable to get docker version: ${dockerVersionOutput}`);
@@ -205,7 +205,6 @@ class ContainerMapping {
205205
}
206206
checkCallerIsCustomer(bearerToken, retryCount = 0) {
207207
return __awaiter(this, void 0, void 0, function* () {
208-
core.info(`Checking if client is onboarded`);
209208
return yield this._checkCallerIsCustomer(bearerToken)
210209
.then((statusCode) => __awaiter(this, void 0, void 0, function* () {
211210
if (statusCode == 200) {
@@ -241,7 +240,6 @@ class ContainerMapping {
241240
_checkCallerIsCustomer(bearerToken) {
242241
return __awaiter(this, void 0, void 0, function* () {
243242
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
244-
let apiTime = new Date().getMilliseconds();
245243
let url = "https://dfdinfra-afdendpoint-dogfood-dqgpa4gjagh0arcw.z01.azurefd.net/github/v1/auth-push/GetScanContext?context=authOnly";
246244
let options = {
247245
method: 'GET',
@@ -254,8 +252,6 @@ class ContainerMapping {
254252
core.debug(`${options['method'].toUpperCase()} ${url}`);
255253
const req = https.request(url, options, (res) => {
256254
res.on('end', () => {
257-
core.debug('API calls finished. Time taken: ' + (new Date().getMilliseconds() - apiTime) + "ms");
258-
core.info(`Status code: ${res.statusCode} ${res.statusMessage}`);
259255
resolve(res.statusCode);
260256
});
261257
res.on('data', function (d) {

src/container-mapping.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
103103
core.info("Client is not onboarded to Defender for DevOps. Skipping container mapping workload.")
104104
return;
105105
}
106-
core.info("Client is onboarded for container mapping");
106+
core.info("Client is onboarded for container mapping.");
107107

108108
// Initialize the commands
109109
let dockerVersionOutput = await exec.getExecOutput('docker --version');
@@ -226,7 +226,6 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
226226
}
227227

228228
private async checkCallerIsCustomer(bearerToken: string, retryCount: number = 0): Promise<boolean> {
229-
core.info(`Checking if client is onboarded`);
230229
return await this._checkCallerIsCustomer(bearerToken)
231230
.then(async (statusCode) => {
232231
if (statusCode == 200) { // Status 'OK' means the caller is an onboarded customer.
@@ -257,7 +256,6 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
257256

258257
private async _checkCallerIsCustomer(bearerToken: string): Promise<number> {
259258
return new Promise(async (resolve, reject) => {
260-
let apiTime = new Date().getMilliseconds();
261259
let url: string = "https://dfdinfra-afdendpoint-dogfood-dqgpa4gjagh0arcw.z01.azurefd.net/github/v1/auth-push/GetScanContext?context=authOnly";
262260
let options = {
263261
method: 'GET',
@@ -272,8 +270,6 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
272270
const req = https.request(url, options, (res) => {
273271

274272
res.on('end', () => {
275-
core.debug('API calls finished. Time taken: ' + (new Date().getMilliseconds() - apiTime) + "ms");
276-
core.info(`Status code: ${res.statusCode} ${res.statusMessage}`);
277273
resolve(res.statusCode);
278274
});
279275
res.on('data', function(d) {

0 commit comments

Comments
 (0)