mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-09-10 02:35:58 +03:00
Add Organizational event logging feature
This PR adds event/audit logging support for organizations. By default this feature is disabled, since it does log a lot and adds extra database transactions. All events are touched except a few, since we do not support those features (yet), like SSO for example. This feature is tested with multiple clients and all database types. Fixes #229
This commit is contained in:
@@ -55,6 +55,27 @@ table! {
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
event (uuid) {
|
||||
uuid -> Varchar,
|
||||
event_type -> Integer,
|
||||
user_uuid -> Nullable<Varchar>,
|
||||
org_uuid -> Nullable<Varchar>,
|
||||
cipher_uuid -> Nullable<Varchar>,
|
||||
collection_uuid -> Nullable<Varchar>,
|
||||
group_uuid -> Nullable<Varchar>,
|
||||
org_user_uuid -> Nullable<Varchar>,
|
||||
act_user_uuid -> Nullable<Varchar>,
|
||||
device_type -> Nullable<Integer>,
|
||||
ip_address -> Nullable<Text>,
|
||||
event_date -> Timestamp,
|
||||
policy_uuid -> Nullable<Varchar>,
|
||||
provider_uuid -> Nullable<Varchar>,
|
||||
provider_user_uuid -> Nullable<Varchar>,
|
||||
provider_org_uuid -> Nullable<Varchar>,
|
||||
}
|
||||
}
|
||||
|
||||
table! {
|
||||
favorites (user_uuid, cipher_uuid) {
|
||||
user_uuid -> Text,
|
||||
@@ -272,6 +293,7 @@ joinable!(groups_users -> users_organizations (users_organizations_uuid));
|
||||
joinable!(groups_users -> groups (groups_uuid));
|
||||
joinable!(collections_groups -> collections (collections_uuid));
|
||||
joinable!(collections_groups -> groups (groups_uuid));
|
||||
joinable!(event -> users_organizations (uuid));
|
||||
|
||||
allow_tables_to_appear_in_same_query!(
|
||||
attachments,
|
||||
@@ -293,4 +315,5 @@ allow_tables_to_appear_in_same_query!(
|
||||
groups,
|
||||
groups_users,
|
||||
collections_groups,
|
||||
event,
|
||||
);
|
||||
|
Reference in New Issue
Block a user