1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 05:13:29 +00:00

[EC-449] Event log user for SCIM events (#3643)

* [EC-449] Added EventSystemUser Enum and added systemUser property to eventResponse

* [EC-449] Add systemUser property to BaseEventsComponent, EventExport and EventView

* [EC-449] Set EventSystemUser as string on EventExport

* [EC-449] Remove systemUser from EventExport

* [EC-449] Rename EventSystemUser file to lowercase

* [EC-449] Force git to rename EventSystemUser file

* [EC-449] Rename EventSystemUser file to event-system-user.ts

* [EC-449] Fix EventSystemUser reference on EventsComponent

* [EC-449] Move installationId username logic to BaseEventsComponent

* Update libs/common/src/enums/event-system-user.ts

Add a note to warn about using the Enum key in the UI.

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>

* [EC-449] Remove EventSystemUser from provider events. Remove nested condition on events component

Co-authored-by: Thomas Rittson <31796059+eliykat@users.noreply.github.com>
This commit is contained in:
Rui Tomé
2022-11-09 12:13:37 +00:00
committed by GitHub
parent 4813320abc
commit c2bf6a6700
6 changed files with 36 additions and 10 deletions

View File

@@ -132,12 +132,13 @@ export abstract class BaseEventsComponent {
appIcon: eventInfo.appIcon,
appName: eventInfo.appName,
userId: userId,
userName: r.installationId != null ? `Installation: ${r.installationId}` : userName,
userName: userName,
userEmail: user != null ? user.email : "",
date: r.date,
ip: r.ipAddress,
type: r.type,
installationId: r.installationId,
systemUser: r.systemUser,
});
})
);

View File

@@ -11,6 +11,7 @@ import { LogService } from "@bitwarden/common/abstractions/log.service";
import { OrganizationService } from "@bitwarden/common/abstractions/organization/organization.service.abstraction";
import { PlatformUtilsService } from "@bitwarden/common/abstractions/platformUtils.service";
import { ProviderService } from "@bitwarden/common/abstractions/provider.service";
import { EventSystemUser } from "@bitwarden/common/enums/event-system-user";
import { Organization } from "@bitwarden/common/models/domain/organization";
import { EventResponse } from "@bitwarden/common/models/response/event.response";
@@ -114,17 +115,25 @@ export class EventsComponent extends BaseEventsComponent implements OnInit, OnDe
}
protected getUserName(r: EventResponse, userId: string) {
if (userId == null) {
return null;
if (r.installationId != null) {
return `Installation: ${r.installationId}`;
}
if (this.orgUsersUserIdMap.has(userId)) {
return this.orgUsersUserIdMap.get(userId);
if (userId != null) {
if (this.orgUsersUserIdMap.has(userId)) {
return this.orgUsersUserIdMap.get(userId);
}
if (r.providerId != null && r.providerId === this.organization.providerId) {
return {
name: this.organization.providerName,
};
}
}
if (r.providerId != null && r.providerId === this.organization.providerId) {
if (r.systemUser != null) {
return {
name: this.organization.providerName,
name: EventSystemUser[r.systemUser],
};
}