[PR #5482] [MERGED] add and use new event types #24492

Closed
opened 2026-05-22 01:54:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/5482
Author: @stefan0xC
Created: 1/27/2025
Status: Merged
Merged: 1/28/2025
Merged by: @BlackDex

Base: mainHead: add-additional-events


📝 Commits (5)

  • c66935d add additional event_types
  • 1b9efc0 use correct event_type when leaving an org
  • 32d47fa use correct event type when deleting a user
  • 3d6f9cf also correctly log auth requests
  • a7ef547 add correct membership info to event log

📊 Changes

5 files changed (+48 additions, -6 deletions)

View changed files

📝 src/api/admin.rs (+1 -1)
📝 src/api/core/accounts.rs (+26 -0)
📝 src/api/core/events.rs (+5 -4)
📝 src/api/core/organizations.rs (+1 -1)
📝 src/db/models/event.rs (+15 -0)

📄 Description

It seems like the web-vault has some additional event types, so I've updated our list accordingly. Most of them are added only for reference (and it seems like the web-vault does not even have support to display all of them correctly at the moment).

I've used the new ones for auth requests and to differentiate between a member leaving an organization
image
and getting the whole account deleted by an admin (possibly this should also be when it's deleted by yourself?).
image

Lastly I also changed it so that the membership info is also stored in the log_user_event for the found organizations, so the link to the member id won't show up as undefined in the report:
Screenshot 2025-01-27 at 23-43-07 Event logs Vaultwarden Web
(I'm not sure why this is not also linked for other User events as it seems useful to have a quick link to list the associated items for a given member...)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/dani-garcia/vaultwarden/pull/5482 **Author:** [@stefan0xC](https://github.com/stefan0xC) **Created:** 1/27/2025 **Status:** ✅ Merged **Merged:** 1/28/2025 **Merged by:** [@BlackDex](https://github.com/BlackDex) **Base:** `main` ← **Head:** `add-additional-events` --- ### 📝 Commits (5) - [`c66935d`](https://github.com/dani-garcia/vaultwarden/commit/c66935db3a690a10d58fd9162b7617bb25bb4fa7) add additional event_types - [`1b9efc0`](https://github.com/dani-garcia/vaultwarden/commit/1b9efc0830b483e7b60c948c10a1acace1010226) use correct event_type when leaving an org - [`32d47fa`](https://github.com/dani-garcia/vaultwarden/commit/32d47faa3b2d1cd7148df758b720eb382f28ae6a) use correct event type when deleting a user - [`3d6f9cf`](https://github.com/dani-garcia/vaultwarden/commit/3d6f9cf3d636336120e614fc5208d89cd85d2f00) also correctly log auth requests - [`a7ef547`](https://github.com/dani-garcia/vaultwarden/commit/a7ef5475dd9795c18d6c2a0e38008645d5f33d80) add correct membership info to event log ### 📊 Changes **5 files changed** (+48 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/api/admin.rs` (+1 -1) 📝 `src/api/core/accounts.rs` (+26 -0) 📝 `src/api/core/events.rs` (+5 -4) 📝 `src/api/core/organizations.rs` (+1 -1) 📝 `src/db/models/event.rs` (+15 -0) </details> ### 📄 Description It seems like the web-vault has [some additional event types](https://github.com/bitwarden/clients/blob/web-v2025.1.1/libs/common/src/enums/event-type.enum.ts), so I've updated our list accordingly. Most of them are added only for reference (and it seems like the web-vault does not even have support to [display all of them correctly](https://github.com/bitwarden/clients/blob/web-v2025.1.1/apps/web/src/app/core/event.service.ts) at the moment). I've used the new ones for auth requests and to differentiate between a member leaving an organization ![image](https://github.com/user-attachments/assets/04da1345-b6b7-4ec0-8151-c32b900005bc) and getting the whole account deleted by an admin (<del>possibly this should also be when it's deleted by yourself?</del>). ![image](https://github.com/user-attachments/assets/c002ec2f-0776-4d1c-85f3-5e89d95c384f) Lastly I also changed it so that the membership info is also stored in the `log_user_event` for the found organizations, so the link to the member id won't show up as `undefined` in the report: ![Screenshot 2025-01-27 at 23-43-07 Event logs Vaultwarden Web](https://github.com/user-attachments/assets/814893b2-2e5d-4109-ac99-6013dce3fe22) (I'm not sure why this is not also linked for other User events as it seems useful to have a quick link to list the associated items for a given member...) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-22 01:54:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vaultwarden#24492