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

[PM-166] [PM-198] - Add Event Logs for CLI Actions (#6527)

* Added the DeviceType changes for windows CLI

* Event logging for CLI commands

* Changing the icons to cli icons
This commit is contained in:
ttalty
2023-11-09 15:17:25 -05:00
committed by GitHub
parent 4446c09fd2
commit 801141f90e
12 changed files with 93 additions and 14 deletions

View File

@@ -1,9 +1,11 @@
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { AuditService } from "@bitwarden/common/abstractions/audit.service";
import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service";
import { SearchService } from "@bitwarden/common/abstractions/search.service";
import { TotpService } from "@bitwarden/common/abstractions/totp.service";
import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction";
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
import { EventType } from "@bitwarden/common/enums";
import { CardExport } from "@bitwarden/common/models/export/card.export";
import { CipherExport } from "@bitwarden/common/models/export/cipher.export";
import { CollectionExport } from "@bitwarden/common/models/export/collection.export";
@@ -53,7 +55,8 @@ export class GetCommand extends DownloadCommand {
private stateService: StateService,
private searchService: SearchService,
private apiService: ApiService,
private organizationService: OrganizationService
private organizationService: OrganizationService,
private eventCollectionService: EventCollectionService
) {
super(cryptoService);
}
@@ -137,6 +140,14 @@ export class GetCommand extends DownloadCommand {
return Response.multipleResults(decCipher.map((c) => c.id));
}
}
this.eventCollectionService.collect(
EventType.Cipher_ClientViewed,
id,
true,
decCipher.organizationId
);
const res = new CipherResponse(decCipher);
return Response.success(res);
}