From 2db1684b3c74dd8480b741b42d19ee6cbc28a4bd Mon Sep 17 00:00:00 2001 From: Chad Scharf <3904944+cscharf@users.noreply.github.com> Date: Tue, 24 Nov 2020 12:36:40 -0500 Subject: [PATCH] Exclude deleted items from any/all reports (#700) --- src/app/tools/exposed-passwords-report.component.ts | 2 +- src/app/tools/inactive-two-factor-report.component.ts | 3 ++- src/app/tools/reused-passwords-report.component.ts | 2 +- src/app/tools/unsecured-websites-report.component.ts | 2 +- src/app/tools/weak-passwords-report.component.ts | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/app/tools/exposed-passwords-report.component.ts b/src/app/tools/exposed-passwords-report.component.ts index 8d210007b9..b1d6cde0d2 100644 --- a/src/app/tools/exposed-passwords-report.component.ts +++ b/src/app/tools/exposed-passwords-report.component.ts @@ -43,7 +43,7 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple const exposedPasswordCiphers: CipherView[] = []; const promises: Promise[] = []; allCiphers.forEach((c) => { - if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') { + if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '' || c.isDeleted) { return; } const promise = this.auditService.passwordLeaked(c.login.password).then((exposedCount) => { diff --git a/src/app/tools/inactive-two-factor-report.component.ts b/src/app/tools/inactive-two-factor-report.component.ts index 29cc91919f..11042ed5bd 100644 --- a/src/app/tools/inactive-two-factor-report.component.ts +++ b/src/app/tools/inactive-two-factor-report.component.ts @@ -45,7 +45,8 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl const promises: Promise[] = []; const docs = new Map(); allCiphers.forEach((c) => { - if (c.type !== CipherType.Login || (c.login.totp != null && c.login.totp !== '') || !c.login.hasUris) { + if (c.type !== CipherType.Login || (c.login.totp != null && c.login.totp !== '') || !c.login.hasUris || + c.isDeleted) { return; } for (let i = 0; i < c.login.uris.length; i++) { diff --git a/src/app/tools/reused-passwords-report.component.ts b/src/app/tools/reused-passwords-report.component.ts index 06d0cccf9c..cb935acf6e 100644 --- a/src/app/tools/reused-passwords-report.component.ts +++ b/src/app/tools/reused-passwords-report.component.ts @@ -37,7 +37,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem const ciphersWithPasswords: CipherView[] = []; this.passwordUseMap = new Map(); allCiphers.forEach((c) => { - if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') { + if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '' || c.isDeleted) { return; } ciphersWithPasswords.push(c); diff --git a/src/app/tools/unsecured-websites-report.component.ts b/src/app/tools/unsecured-websites-report.component.ts index 482e0c5d33..3648d23a7a 100644 --- a/src/app/tools/unsecured-websites-report.component.ts +++ b/src/app/tools/unsecured-websites-report.component.ts @@ -33,7 +33,7 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl async setCiphers() { const allCiphers = await this.getAllCiphers(); const unsecuredCiphers = allCiphers.filter((c) => { - if (c.type !== CipherType.Login || !c.login.hasUris) { + if (c.type !== CipherType.Login || !c.login.hasUris || c.isDeleted) { return false; } return c.login.uris.some((u) => u.uri != null && u.uri.indexOf('http://') === 0); diff --git a/src/app/tools/weak-passwords-report.component.ts b/src/app/tools/weak-passwords-report.component.ts index e8bf3639cd..17982e64f7 100644 --- a/src/app/tools/weak-passwords-report.component.ts +++ b/src/app/tools/weak-passwords-report.component.ts @@ -40,7 +40,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen const allCiphers = await this.getAllCiphers(); const weakPasswordCiphers: CipherView[] = []; allCiphers.forEach((c) => { - if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '') { + if (c.type !== CipherType.Login || c.login.password == null || c.login.password === '' || c.isDeleted) { return; } const hasUsername = c.login.username != null && c.login.username.trim() !== '';