Skip to content

Commit

Permalink
remove secret from debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisRumyantsev committed Aug 2, 2023
1 parent e123496 commit 0aa0cb2
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 14 deletions.
12 changes: 11 additions & 1 deletion Tasks/GooglePlayIncreaseRolloutV2/googleutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,17 @@ export interface GlobalParams {

export function getJWT(key: ClientKey): JWT {
const GOOGLE_PLAY_SCOPES: string[] = ['https://www.googleapis.com/auth/androidpublisher'];
return new google.auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);
const jwtClient: JWT = new google.auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);

const credsToken: string = jwtClient.credentials.access_token;
const rawToken: string = jwtClient.gtoken.rawToken.access_token;

tl.setSecret(credsToken);
if (rawToken !== credsToken) {
tl.setSecret(rawToken);
}

return jwtClient;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayIncreaseRolloutV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"version": {
"Major": "2",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayIncreaseRolloutV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"version": {
"Major": "2",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
12 changes: 11 additions & 1 deletion Tasks/GooglePlayPromoteV3/googleutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,17 @@ export interface GlobalParams {

export function getJWT(key: ClientKey): JWT {
const GOOGLE_PLAY_SCOPES: string[] = ['https://www.googleapis.com/auth/androidpublisher'];
return new google.auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);
const jwtClient: JWT = new google.auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);

const credsToken: string = jwtClient.credentials.access_token;
const rawToken: string = jwtClient.gtoken.rawToken.access_token;

tl.setSecret(credsToken);
if (rawToken !== credsToken) {
tl.setSecret(rawToken);
}

return jwtClient;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayPromoteV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"version": {
"Major": "3",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayPromoteV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"version": {
"Major": "3",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@
"loc.messages.UpdateTrack": "Updating track information...",
"loc.messages.UploadImageFail": "Failed to upload image.",
"loc.messages.UploadingMetadataForLanguage": "Attempting to upload metadata in %s for language code %s"
}
}
12 changes: 11 additions & 1 deletion Tasks/GooglePlayReleaseV4/modules/googleutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@ export interface ClientKey {
*/
export function getJWT(key: ClientKey): googleapis.Auth.JWT {
const GOOGLE_PLAY_SCOPES: string[] = ['https://www.googleapis.com/auth/androidpublisher'];
return new googleapis.Auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);
const jwtClient: googleapis.Auth.JWT = new googleapis.Auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);

const credsToken: string = jwtClient.credentials.access_token;
const rawToken: string = jwtClient.gtoken.rawToken.access_token;

tl.setSecret(credsToken);
if (rawToken !== credsToken) {
tl.setSecret(rawToken);
}

return jwtClient;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayReleaseV4/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"demands": [],
"version": {
"Major": "4",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayReleaseV4/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"demands": [],
"version": {
"Major": "4",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
12 changes: 11 additions & 1 deletion Tasks/GooglePlayStatusUpdateV2/googleutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ export interface GlobalParams {

export function getJWT(key: ClientKey): JWT {
const GOOGLE_PLAY_SCOPES: string[] = ['https://www.googleapis.com/auth/androidpublisher'];
return new google.auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);
const jwtClient: JWT = new google.auth.JWT(key.client_email, null, key.private_key, GOOGLE_PLAY_SCOPES, null);

const credsToken: string = jwtClient.credentials.access_token;
const rawToken: string = jwtClient.gtoken.rawToken.access_token;

tl.setSecret(credsToken);
if (rawToken !== credsToken) {
tl.setSecret(rawToken);
}

return jwtClient;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayStatusUpdateV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"version": {
"Major": "2",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/GooglePlayStatusUpdateV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
],
"version": {
"Major": "2",
"Minor": "220",
"Minor": "226",
"Patch": "0"
},
"minimumAgentVersion": "2.182.1",
Expand Down
2 changes: 1 addition & 1 deletion vsts-extension-google-play.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifestVersion": 1.0,
"id": "google-play",
"name": "Google Play",
"version": "4.220.1",
"version": "4.226.0",
"publisher": "ms-vsclient",
"description": "Provides tasks for continuous delivery to the Google Play Store from TFS/Team Services build or release definitions",
"categories": [
Expand Down

0 comments on commit 0aa0cb2

Please sign in to comment.