Skip to content

Commit b6f710f

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

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

lib/container-mapping.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class ContainerMapping {
240240
_checkCallerIsCustomer(bearerToken) {
241241
return __awaiter(this, void 0, void 0, function* () {
242242
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
243-
let url = "https://dfdinfra-afdendpoint-dogfood-dqgpa4gjagh0arcw.z01.azurefd.net/github/v1/auth-push/GetScanContext?context=authOnly";
243+
let url = "https://dfdinfra-afdendpoint-prod-d5fqbucbg7fue0cf.z01.azurefd.net/github/v1/auth-push/GetScanContext?context=authOnly";
244244
let options = {
245245
method: 'GET',
246246
timeout: 2500,

src/container-mapping.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
8585
dockerEvents: [],
8686
dockerImages: []
8787
};
88-
89-
88+
9089
let bearerToken: string | void = await core.getIDToken()
9190
.then((token) => { return token; })
9291
.catch((error) => {
@@ -157,6 +156,7 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
157156
* Sends a report to Defender for DevOps and retries on the specified count
158157
* @param data the data to send
159158
* @param retryCount the number of time to retry
159+
* @param bearerToken the GitHub-generated OIDC token
160160
* @returns a boolean Promise to indicate if the report was sent successfully or not
161161
*/
162162
private async sendReport(data: string, bearerToken: string, retryCount: number = 0): Promise<boolean> {
@@ -225,6 +225,12 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
225225
});
226226
}
227227

228+
/**
229+
* Queries Defender for DevOps to determine if the caller is onboarded for container mapping.
230+
* @param retryCount the number of time to retry
231+
* @param bearerToken the GitHub-generated OIDC token
232+
* @returns a boolean Promise to indicate if the report was sent successfully or not
233+
*/
228234
private async checkCallerIsCustomer(bearerToken: string, retryCount: number = 0): Promise<boolean> {
229235
return await this._checkCallerIsCustomer(bearerToken)
230236
.then(async (statusCode) => {
@@ -256,7 +262,7 @@ export class ContainerMapping implements IMicrosoftSecurityDevOps {
256262

257263
private async _checkCallerIsCustomer(bearerToken: string): Promise<number> {
258264
return new Promise(async (resolve, reject) => {
259-
let url: string = "https://dfdinfra-afdendpoint-dogfood-dqgpa4gjagh0arcw.z01.azurefd.net/github/v1/auth-push/GetScanContext?context=authOnly";
265+
let url: string = "https://dfdinfra-afdendpoint-prod-d5fqbucbg7fue0cf.z01.azurefd.net/github/v1/auth-push/GetScanContext?context=authOnly";
260266
let options = {
261267
method: 'GET',
262268
timeout: 2500,

0 commit comments

Comments
 (0)