1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 16:23:44 +00:00

Exclude deleted items from any/all reports (#700)

This commit is contained in:
Chad Scharf
2020-11-24 12:36:40 -05:00
committed by GitHub
parent 4625b44703
commit 2db1684b3c
5 changed files with 6 additions and 5 deletions

View File

@@ -43,7 +43,7 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
const exposedPasswordCiphers: CipherView[] = []; const exposedPasswordCiphers: CipherView[] = [];
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];
allCiphers.forEach((c) => { 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; return;
} }
const promise = this.auditService.passwordLeaked(c.login.password).then((exposedCount) => { const promise = this.auditService.passwordLeaked(c.login.password).then((exposedCount) => {

View File

@@ -45,7 +45,8 @@ export class InactiveTwoFactorReportComponent extends CipherReportComponent impl
const promises: Promise<void>[] = []; const promises: Promise<void>[] = [];
const docs = new Map<string, string>(); const docs = new Map<string, string>();
allCiphers.forEach((c) => { 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; return;
} }
for (let i = 0; i < c.login.uris.length; i++) { for (let i = 0; i < c.login.uris.length; i++) {

View File

@@ -37,7 +37,7 @@ export class ReusedPasswordsReportComponent extends CipherReportComponent implem
const ciphersWithPasswords: CipherView[] = []; const ciphersWithPasswords: CipherView[] = [];
this.passwordUseMap = new Map<string, number>(); this.passwordUseMap = new Map<string, number>();
allCiphers.forEach((c) => { 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; return;
} }
ciphersWithPasswords.push(c); ciphersWithPasswords.push(c);

View File

@@ -33,7 +33,7 @@ export class UnsecuredWebsitesReportComponent extends CipherReportComponent impl
async setCiphers() { async setCiphers() {
const allCiphers = await this.getAllCiphers(); const allCiphers = await this.getAllCiphers();
const unsecuredCiphers = allCiphers.filter((c) => { 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 false;
} }
return c.login.uris.some((u) => u.uri != null && u.uri.indexOf('http://') === 0); return c.login.uris.some((u) => u.uri != null && u.uri.indexOf('http://') === 0);

View File

@@ -40,7 +40,7 @@ export class WeakPasswordsReportComponent extends CipherReportComponent implemen
const allCiphers = await this.getAllCiphers(); const allCiphers = await this.getAllCiphers();
const weakPasswordCiphers: CipherView[] = []; const weakPasswordCiphers: CipherView[] = [];
allCiphers.forEach((c) => { 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; return;
} }
const hasUsername = c.login.username != null && c.login.username.trim() !== ''; const hasUsername = c.login.username != null && c.login.username.trim() !== '';