1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-18 09:13:33 +00:00

exposed passwords report for orgs

This commit is contained in:
Kyle Spearrin
2018-12-14 13:56:01 -05:00
parent 7a58f6d967
commit 392a90c02c
13 changed files with 139 additions and 35 deletions

View File

@@ -22,24 +22,24 @@ import { CipherReportComponent } from './cipher-report.component';
export class ExposedPasswordsReportComponent extends CipherReportComponent implements OnInit {
exposedPasswordMap = new Map<string, number>();
constructor(private ciphersService: CipherService, private auditService: AuditService,
constructor(protected cipherService: CipherService, protected auditService: AuditService,
componentFactoryResolver: ComponentFactoryResolver, messagingService: MessagingService,
userService: UserService) {
super(componentFactoryResolver, userService, messagingService, true);
}
ngOnInit() {
this.checkPremium();
this.checkAccess();
}
async load() {
if (await this.checkPremium()) {
if (await this.checkAccess()) {
super.load();
}
}
async setCiphers() {
const allCiphers = await this.ciphersService.getAllDecrypted();
const allCiphers = await this.getAllCiphers();
const exposedPasswordCiphers: CipherView[] = [];
const promises: Array<Promise<void>> = [];
allCiphers.forEach((c) => {
@@ -57,4 +57,8 @@ export class ExposedPasswordsReportComponent extends CipherReportComponent imple
await Promise.all(promises);
this.ciphers = exposedPasswordCiphers;
}
protected getAllCiphers(): Promise<CipherView[]> {
return this.cipherService.getAllDecrypted();
}
}