1
0
mirror of https://github.com/bitwarden/server synced 2026-02-20 11:23:37 +00:00

[PM-26378] Auto confirm events (#7017)

* implement auto confirm push notification

* fix test

* fix test

* simplify LINQ

* add event logging for auto confirm

* fix test
This commit is contained in:
Brandon Treston
2026-02-19 12:10:28 -05:00
committed by GitHub
parent 71a8116d4c
commit 31fe7b0e12
10 changed files with 246 additions and 0 deletions

View File

@@ -116,6 +116,26 @@ public class EventServiceTests
e.InstallationId == installationId));
}
[Theory, BitAutoData]
public async Task LogOrganizationEvent_WithEventSystemUser_LogsRequiredInfo(Organization organization, EventType eventType,
EventSystemUser eventSystemUser, DateTime date, Guid providerId, SutProvider<EventService> sutProvider)
{
organization.Enabled = true;
organization.UseEvents = true;
sutProvider.GetDependency<ICurrentContext>().ProviderIdForOrg(Arg.Any<Guid>()).Returns(providerId);
await sutProvider.Sut.LogOrganizationEventAsync(organization, eventType, eventSystemUser, date);
await sutProvider.GetDependency<IEventWriteService>().Received(1).CreateAsync(Arg.Is<IEvent>(e =>
e.OrganizationId == organization.Id &&
e.Type == eventType &&
e.SystemUser == eventSystemUser &&
e.DeviceType == DeviceType.Server &&
e.Date == date &&
e.ProviderId == providerId));
}
[Theory, BitAutoData]
public async Task LogOrganizationUserEvent_LogsRequiredInfo(OrganizationUser orgUser, EventType eventType, DateTime date,
Guid actingUserId, Guid providerId, string ipAddress, DeviceType deviceType, SutProvider<EventService> sutProvider)