Skip to content

Commit f729353

Browse files
author
Seth Rait
committed
check caller onboarded
1 parent 82f2d32 commit f729353

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

lib/container-mapping.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ class ContainerMapping {
212212
core.info(`Checking if client is onboarded`);
213213
return yield this._checkCallerIsCustomer(bearerToken)
214214
.then((statusCode) => __awaiter(this, void 0, void 0, function* () {
215-
core.info(`Status Code is ${statusCode}`);
216215
if (statusCode == 200) {
217216
return true;
218217
}
@@ -232,12 +231,11 @@ class ContainerMapping {
232231
}
233232
}))
234233
.catch((error) => __awaiter(this, void 0, void 0, function* () {
235-
core.info(`catch on 253: ${error}`);
236234
if (retryCount == 0) {
237235
return false;
238236
}
239237
else {
240-
core.info(`Retrying checkCallerIsCustomer call due to error!: ${error}.\nRetry count: ${retryCount}`);
238+
core.info(`Retrying checkCallerIsCustomer call due to error: ${error}.\nRetry count: ${retryCount}`);
241239
retryCount--;
242240
return yield this.checkCallerIsCustomer(bearerToken, retryCount);
243241
}
@@ -262,12 +260,8 @@ class ContainerMapping {
262260
res.on('end', () => {
263261
core.debug('API calls finished. Time taken: ' + (new Date().getMilliseconds() - apiTime) + "ms");
264262
core.info(`Status code: ${res.statusCode} ${res.statusMessage}`);
265-
core.debug('Response headers: ' + JSON.stringify(res.headers));
266263
resolve(res.statusCode);
267264
});
268-
res.on('data', function (d) {
269-
core.info(`data: ${d}`);
270-
});
271265
});
272266
req.on('error', (error) => {
273267
core.info(`Error in _checkCallerIsCustomer: ${error.name}, ${error.message}`);

src/container-mapping.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
233233
core.info(`Checking if client is onboarded`);
234234
return await this._checkCallerIsCustomer(bearerToken)
235235
.then(async (statusCode) => {
236-
core.info(`Status Code is ${statusCode}`);
237236
if (statusCode == 200) { // Status 'OK' means the caller is an onboarded customer.
238237
return true;
239238
} else if (statusCode == 403) {// Status 'Forbidden' means caller is not a customer.
@@ -250,11 +249,10 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
250249
}
251250
})
252251
.catch(async (error) => {
253-
core.info(`catch on 253: ${error}`);
254252
if (retryCount == 0) {
255253
return false;
256254
} else {
257-
core.info(`Retrying checkCallerIsCustomer call due to error!: ${error}.\nRetry count: ${retryCount}`);
255+
core.info(`Retrying checkCallerIsCustomer call due to error: ${error}.\nRetry count: ${retryCount}`);
258256
retryCount--;
259257
return await this.checkCallerIsCustomer(bearerToken, retryCount);
260258
}
@@ -280,12 +278,11 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
280278
res.on('end', () => {
281279
core.debug('API calls finished. Time taken: ' + (new Date().getMilliseconds() - apiTime) + "ms");
282280
core.info(`Status code: ${res.statusCode} ${res.statusMessage}`); // TODO
283-
core.debug('Response headers: ' + JSON.stringify(res.headers));
284281
resolve(res.statusCode);
285282
});
286-
res.on('data', function(d) {
287-
core.info(`data: ${d}`);
288-
});
283+
// res.on('data', function(d) {
284+
// core.info(`data: ${d}`);
285+
// });
289286
});
290287

291288
req.on('error', (error) => {

0 commit comments

Comments
 (0)