1
0
mirror of https://github.com/bitwarden/server synced 2026-01-01 08:03:23 +00:00

[PM-17562] Add support for extended properties on event integrations (#5755)

* [PM-17562] Add support for extended properties on event integrations

* Clean up IntegrationEventHandlerBase

* Respond to PR feedback
This commit is contained in:
Brant DeBow
2025-05-05 08:04:59 -04:00
committed by GitHub
parent 9511c26683
commit 75a2da3c4b
7 changed files with 445 additions and 63 deletions

View File

@@ -0,0 +1,37 @@
using Bit.Core.AdminConsole.Entities;
using Bit.Core.Entities;
using Bit.Core.Enums;
#nullable enable
namespace Bit.Core.Models.Data.Integrations;
public class IntegrationTemplateContext(EventMessage eventMessage)
{
public EventMessage Event { get; } = eventMessage;
public string DomainName => Event.DomainName;
public string IpAddress => Event.IpAddress;
public DeviceType? DeviceType => Event.DeviceType;
public Guid? ActingUserId => Event.ActingUserId;
public Guid? OrganizationUserId => Event.OrganizationUserId;
public DateTime Date => Event.Date;
public EventType Type => Event.Type;
public Guid? UserId => Event.UserId;
public Guid? OrganizationId => Event.OrganizationId;
public Guid? CipherId => Event.CipherId;
public Guid? CollectionId => Event.CollectionId;
public Guid? GroupId => Event.GroupId;
public Guid? PolicyId => Event.PolicyId;
public User? User { get; set; }
public string? UserName => User?.Name;
public string? UserEmail => User?.Email;
public User? ActingUser { get; set; }
public string? ActingUserName => ActingUser?.Name;
public string? ActingUserEmail => ActingUser?.Email;
public Organization? Organization { get; set; }
public string? OrganizationName => Organization?.DisplayName();
}