1
0
mirror of https://github.com/bitwarden/server.git synced 2025-01-29 23:01:46 +01:00

Add event types

This commit is contained in:
Kyle Spearrin 2019-06-20 08:56:10 -04:00
parent e242539b84
commit 69731ecb9d
2 changed files with 14 additions and 2 deletions

View File

@ -9,6 +9,7 @@
User_Recovered2fa = 1004,
User_FailedLogIn = 1005,
User_FailedLogIn2fa = 1006,
User_ExportedVault = 1007,
Cipher_Created = 1100,
Cipher_Updated = 1101,
@ -17,6 +18,12 @@
Cipher_AttachmentDeleted = 1104,
Cipher_Shared = 1105,
Cipher_UpdatedCollections = 1106,
Cipher_ClientViewed = 1107,
Cipher_ClientToggledPasswordVisible = 1108,
Cipher_ClientToggledHiddenFieldVisible = 1109,
Cipher_ClientCopiedPassword = 1110,
Cipher_ClientCopedHiddenField = 1111,
Cipher_ClientAutofilled = 1112,
Collection_Created = 1300,
Collection_Updated = 1301,

View File

@ -39,11 +39,16 @@ namespace Bit.Events.Controllers
switch(model.Type)
{
// User events
case EventType.User_LoggedIn:
case EventType.User_ExportedVault:
await _eventService.LogUserEventAsync(_currentContext.UserId.Value, model.Type);
break;
// Cipher events
case EventType.Cipher_Created:
case EventType.Cipher_ClientAutofilled:
case EventType.Cipher_ClientCopedHiddenField:
case EventType.Cipher_ClientCopiedPassword:
case EventType.Cipher_ClientToggledHiddenFieldVisible:
case EventType.Cipher_ClientToggledPasswordVisible:
case EventType.Cipher_ClientViewed:
if(!model.CipherId.HasValue)
{
return new BadRequestResult();