mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-23 15:58:09 +03:00
Support the vault banner policy (#7748)
This commit is contained in:
3 files changed
+22
-1
No files matched your search
@@ -199,6 +199,26 @@ async fn post_events_collect(data: Json<Vec<EventCollection>>, headers: Headers,
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Only the vault notification banner click is accepted from clients. The rest of
|
||||||
|
// the 1500..=1599 range is written server-side and must not be forgeable by a client.
|
||||||
|
t if t == EventType::OrganizationUserNotificationBannerActionClicked as i32 => {
|
||||||
|
if let Some(org_id) = &event.organization_id
|
||||||
|
&& let Some(membership) =
|
||||||
|
Membership::find_confirmed_by_user_and_org(&headers.user.uuid, org_id, &conn).await
|
||||||
|
{
|
||||||
|
log_event_impl(
|
||||||
|
event.r#type,
|
||||||
|
&membership.uuid,
|
||||||
|
org_id,
|
||||||
|
&headers.user.uuid,
|
||||||
|
headers.device.atype,
|
||||||
|
Some(event_date),
|
||||||
|
&headers.ip.ip,
|
||||||
|
&conn,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
}
|
||||||
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// The cipher determines the organization the event is logged to, so make sure the
|
// The cipher determines the organization the event is logged to, so make sure the
|
||||||
// user can actually access it instead of trusting the provided cipher uuid.
|
// user can actually access it instead of trusting the provided cipher uuid.
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ pub enum EventType {
|
|||||||
OrganizationUserAdminResetTwoFactor = 1519,
|
OrganizationUserAdminResetTwoFactor = 1519,
|
||||||
// OrganizationUserRevoked_TwoFactorNonCompliance = 1520,
|
// OrganizationUserRevoked_TwoFactorNonCompliance = 1520,
|
||||||
// OrganizationUserRevoked_SingleOrganizationNonCompliance = 1521,
|
// OrganizationUserRevoked_SingleOrganizationNonCompliance = 1521,
|
||||||
// OrganizationUserNotificationBannerActionClicked = 1522,
|
OrganizationUserNotificationBannerActionClicked = 1522,
|
||||||
|
|
||||||
// Organization
|
// Organization
|
||||||
OrganizationUpdated = 1600,
|
OrganizationUpdated = 1600,
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ pub enum OrgPolicyType {
|
|||||||
// AutotypeDefaultSetting = 17, // Not supported yet
|
// AutotypeDefaultSetting = 17, // Not supported yet
|
||||||
// AutoConfirm = 18, // Not supported (not implemented yet)
|
// AutoConfirm = 18, // Not supported (not implemented yet)
|
||||||
// BlockClaimedDomainAccountCreation = 19, // Not supported (Not AGPLv3 Licensed)
|
// BlockClaimedDomainAccountCreation = 19, // Not supported (Not AGPLv3 Licensed)
|
||||||
|
OrganizationUserNotification = 20,
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://github.com/bitwarden/server/blob/9ebe16587175b1c0e9208f84397bb75d0d595510/src/Core/AdminConsole/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs#L5
|
// https://github.com/bitwarden/server/blob/9ebe16587175b1c0e9208f84397bb75d0d595510/src/Core/AdminConsole/Models/Data/Organizations/Policies/SendOptionsPolicyData.cs#L5
|
||||||
|
|||||||
Reference in new issue
Block a user