|
@ -226,7 +226,7 @@ async fn leave_organization(org_id: &str, headers: Headers, mut conn: DbConn) -> |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
&user_org.uuid, |
|
|
&user_org.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -279,7 +279,7 @@ async fn post_organization( |
|
|
EventType::OrganizationUpdated as i32, |
|
|
EventType::OrganizationUpdated as i32, |
|
|
org_id, |
|
|
org_id, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -396,7 +396,7 @@ async fn post_organization_collections( |
|
|
EventType::CollectionCreated as i32, |
|
|
EventType::CollectionCreated as i32, |
|
|
&collection.uuid, |
|
|
&collection.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -477,7 +477,7 @@ async fn post_organization_collection_update( |
|
|
EventType::CollectionUpdated as i32, |
|
|
EventType::CollectionUpdated as i32, |
|
|
&collection.uuid, |
|
|
&collection.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -565,7 +565,7 @@ async fn _delete_organization_collection( |
|
|
EventType::CollectionDeleted as i32, |
|
|
EventType::CollectionDeleted as i32, |
|
|
&collection.uuid, |
|
|
&collection.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -946,7 +946,7 @@ async fn send_invite( |
|
|
EventType::OrganizationUserInvited as i32, |
|
|
EventType::OrganizationUserInvited as i32, |
|
|
&new_user.uuid, |
|
|
&new_user.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1240,7 +1240,7 @@ async fn _confirm_invite( |
|
|
EventType::OrganizationUserConfirmed as i32, |
|
|
EventType::OrganizationUserConfirmed as i32, |
|
|
&user_to_confirm.uuid, |
|
|
&user_to_confirm.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -1402,7 +1402,7 @@ async fn edit_user( |
|
|
EventType::OrganizationUserUpdated as i32, |
|
|
EventType::OrganizationUserUpdated as i32, |
|
|
&user_to_edit.uuid, |
|
|
&user_to_edit.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1494,7 +1494,7 @@ async fn _delete_user( |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
&user_to_delete.uuid, |
|
|
&user_to_delete.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -1701,7 +1701,7 @@ async fn put_policy( |
|
|
if pol_type_enum == OrgPolicyType::TwoFactorAuthentication && data.enabled { |
|
|
if pol_type_enum == OrgPolicyType::TwoFactorAuthentication && data.enabled { |
|
|
two_factor::enforce_2fa_policy_for_org( |
|
|
two_factor::enforce_2fa_policy_for_org( |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1731,7 +1731,7 @@ async fn put_policy( |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
&member.uuid, |
|
|
&member.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1756,7 +1756,7 @@ async fn put_policy( |
|
|
EventType::PolicyUpdated as i32, |
|
|
EventType::PolicyUpdated as i32, |
|
|
&policy.uuid, |
|
|
&policy.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1873,7 +1873,7 @@ async fn import(org_id: &str, data: JsonUpcase<OrgImportData>, headers: Headers, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
&user_org.uuid, |
|
|
&user_org.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1903,7 +1903,7 @@ async fn import(org_id: &str, data: JsonUpcase<OrgImportData>, headers: Headers, |
|
|
EventType::OrganizationUserInvited as i32, |
|
|
EventType::OrganizationUserInvited as i32, |
|
|
&new_org_user.uuid, |
|
|
&new_org_user.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -1939,7 +1939,7 @@ async fn import(org_id: &str, data: JsonUpcase<OrgImportData>, headers: Headers, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
EventType::OrganizationUserRemoved as i32, |
|
|
&user_org.uuid, |
|
|
&user_org.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2052,7 +2052,7 @@ async fn _revoke_organization_user( |
|
|
EventType::OrganizationUserRevoked as i32, |
|
|
EventType::OrganizationUserRevoked as i32, |
|
|
&user_org.uuid, |
|
|
&user_org.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -2171,7 +2171,7 @@ async fn _restore_organization_user( |
|
|
EventType::OrganizationUserRestored as i32, |
|
|
EventType::OrganizationUserRestored as i32, |
|
|
&user_org.uuid, |
|
|
&user_org.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -2300,7 +2300,7 @@ async fn post_groups( |
|
|
EventType::GroupCreated as i32, |
|
|
EventType::GroupCreated as i32, |
|
|
&group.uuid, |
|
|
&group.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2337,7 +2337,7 @@ async fn put_group( |
|
|
EventType::GroupUpdated as i32, |
|
|
EventType::GroupUpdated as i32, |
|
|
&updated_group.uuid, |
|
|
&updated_group.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2370,7 +2370,7 @@ async fn add_update_group( |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
&assigned_user_id, |
|
|
&assigned_user_id, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -2425,7 +2425,7 @@ async fn _delete_group(org_id: &str, group_id: &str, headers: &AdminHeaders, con |
|
|
EventType::GroupDeleted as i32, |
|
|
EventType::GroupDeleted as i32, |
|
|
&group.uuid, |
|
|
&group.uuid, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
conn, |
|
|
conn, |
|
@ -2516,7 +2516,7 @@ async fn put_group_users( |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
&assigned_user_id, |
|
|
&assigned_user_id, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2594,7 +2594,7 @@ async fn put_user_groups( |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
org_user_id, |
|
|
org_user_id, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2649,7 +2649,7 @@ async fn delete_group_user( |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
EventType::OrganizationUserUpdatedGroups as i32, |
|
|
org_user_id, |
|
|
org_user_id, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2738,7 +2738,7 @@ async fn put_reset_password( |
|
|
EventType::OrganizationUserAdminResetPassword as i32, |
|
|
EventType::OrganizationUserAdminResetPassword as i32, |
|
|
org_user_id, |
|
|
org_user_id, |
|
|
org_id, |
|
|
org_id, |
|
|
headers.user.uuid.clone(), |
|
|
&headers.user.uuid, |
|
|
headers.device.atype, |
|
|
headers.device.atype, |
|
|
&headers.ip.ip, |
|
|
&headers.ip.ip, |
|
|
&mut conn, |
|
|
&mut conn, |
|
@ -2865,8 +2865,7 @@ async fn put_reset_password_enrollment( |
|
|
EventType::OrganizationUserResetPasswordWithdraw as i32 |
|
|
EventType::OrganizationUserResetPasswordWithdraw as i32 |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
log_event(log_id, org_user_id, org_id, headers.user.uuid.clone(), headers.device.atype, &headers.ip.ip, &mut conn) |
|
|
log_event(log_id, org_user_id, org_id, &headers.user.uuid, headers.device.atype, &headers.ip.ip, &mut conn).await; |
|
|
.await; |
|
|
|
|
|
|
|
|
|
|
|
Ok(()) |
|
|
Ok(()) |
|
|
} |
|
|
} |
|
|