[chore] filter potential oculus token in logs

This commit is contained in:
MathieuG-P
2024-08-01 00:20:02 +02:00
parent 88a1691d4b
commit c313685f6f
5 changed files with 159 additions and 20 deletions
@@ -11,6 +11,7 @@ import { AbstractBsDownloaderService } from "./abstract-bs-downloader.service";
import { DownloadInfo } from "main/services/bs-version-download/bs-steam-downloader.service";
import { MetaAuthErrorCodes, OculusDownloaderErrorCodes } from "shared/models/bs-version-download/oculus-download.model";
import { EnterMetaTokenModal } from "renderer/components/modal/modal-types/bs-downgrade/enter-meta-token-modal.component";
import { addFilterStringLog } from "renderer";
export class OculusDownloaderService extends AbstractBsDownloaderService implements DownloaderServiceInterface{
@@ -88,6 +89,8 @@ export class OculusDownloaderService extends AbstractBsDownloaderService impleme
return false;
}
addFilterStringLog(tokenRes.data);
return lastValueFrom(this.startDownloadBsVersion({ bsVersion, isVerification, token: tokenRes.data })).then(() => true);
})().then(res => {
@@ -126,4 +129,4 @@ export class OculusDownloaderService extends AbstractBsDownloaderService impleme
return lastValueFrom(this.ipc.sendV2<void>("bs-oculus-clear-auth-token"));
}
}
}
@@ -13,9 +13,10 @@ import { DepotDownloaderErrorEvent, DepotDownloaderEvent, DepotDownloaderEventTy
import { SteamMobileApproveModal } from "renderer/components/modal/modal-types/bs-downgrade/steam-mobile-approve-modal.component";
import { DownloaderServiceInterface } from "./bs-store-downloader.interface";
import { AbstractBsDownloaderService } from "./abstract-bs-downloader.service";
import { addFilterStringLog } from "renderer";
export class SteamDownloaderService extends AbstractBsDownloaderService implements DownloaderServiceInterface{
private static instance: SteamDownloaderService;
public static getInstance(): SteamDownloaderService {
@@ -128,7 +129,7 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen
return this.notificationService.notifySuccess({title: "notifications.bs-download.success.titles.verification-finished"});
}
return this.notificationService.notifySuccess({title: "notifications.bs-download.success.titles.download-success"});
}));
}));
return subs;
}
@@ -182,7 +183,7 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen
}),
share({connector: () => new ReplaySubject(1)})
);
}
private tryAutoDownloadBsVersion(downloadInfo: DownloadSteamInfo){
@@ -217,7 +218,7 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen
}
this.progressBarService.show(this.downloadProgress$, true);
const downloadPromise = (async () => {
const haveDotNet = await this.isDotNet6Installed().catch(() => false);
@@ -227,9 +228,9 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen
}
const downloadInfo: DownloadSteamInfo = {bsVersion, isVerification}
const autoDownload = await lastValueFrom(this.tryAutoDownloadBsVersion(downloadInfo)).then(() => true).catch(() => false);
if(autoDownload){ return Promise.resolve(); }
const qrCodeDownload$ = this.startQrCodeDownload(downloadInfo);
@@ -242,6 +243,10 @@ export class SteamDownloaderService extends AbstractBsDownloaderService implemen
return Promise.resolve();
}
if(loginRes?.data?.password){
addFilterStringLog(loginRes.data.password);
}
if(loginRes.data.stay){
this.setSteamSession(loginRes.data.username);
}