mirror of
https://github.com/bitwarden/server
synced 2026-01-09 03:53:42 +00:00
Log events from the import organization flow (#4632)
* Log events from the import organization flow * Use an interface for the `OrganizationUser` object used to log events * Log import events as being from the public api if they are * Add logging for created groups * Log proper group ids * Fix tests * Also log update events for groups * Remove private API `import` endpoint * Make `eventSystemUser` non-nullable for `ImportAsync` * Fix tests * Delete `ImportOrganizationUsersRequestModel` * Fix tests
This commit is contained in:
@@ -3,6 +3,7 @@ using Bit.Api.AdminConsole.Public.Models.Request;
|
||||
using Bit.Api.AdminConsole.Public.Models.Response;
|
||||
using Bit.Api.Models.Public.Response;
|
||||
using Bit.Core.Context;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Exceptions;
|
||||
using Bit.Core.Services;
|
||||
using Bit.Core.Settings;
|
||||
@@ -49,11 +50,11 @@ public class OrganizationController : Controller
|
||||
|
||||
await _organizationService.ImportAsync(
|
||||
_currentContext.OrganizationId.Value,
|
||||
null,
|
||||
model.Groups.Select(g => g.ToImportedGroup(_currentContext.OrganizationId.Value)),
|
||||
model.Members.Where(u => !u.Deleted).Select(u => u.ToImportedOrganizationUser()),
|
||||
model.Members.Where(u => u.Deleted).Select(u => u.ExternalId),
|
||||
model.OverwriteExisting.GetValueOrDefault());
|
||||
model.OverwriteExisting.GetValueOrDefault(),
|
||||
EventSystemUser.PublicApi);
|
||||
return new OkResult();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user