[PR #7320] Add GET /public/events Public API endpoint #41358

Open
opened 2026-07-18 06:19:40 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/7320
Author: @svrforum
Created: 6/9/2026
Status: 🔄 Open

Base: mainHead: feat/public-events-api


📝 Commits (3)

  • 989fa9a Add Event::to_json_public for Public API event model
  • 1c91b8a Make get_continuation_token reusable across modules
  • 283467f Add GET /public/events Bitwarden-compatible Public API endpoint

📊 Changes

3 files changed (+101 additions, -5 deletions)

View changed files

📝 src/api/core/events.rs (+1 -1)
📝 src/api/core/public.rs (+48 -4)
📝 src/db/models/event.rs (+52 -0)

📄 Description

Implements the Bitwarden-compatible Public API GET /public/events endpoint, which was previously missing.

This lets organization API keys export event logs (e.g. for SIEM integration), matching upstream Bitwarden. It reuses the existing event store, PublicToken auth, pagination, and continuation-token mechanism. A new Event::to_json_public emits the Public API field names (itemId, memberId, object: "event", ...).

Notes:

  • No schema change, no migration, no change to existing behavior (purely additive).
  • Returns an empty list when org events are disabled, consistent with the internal events endpoints.
  • Default date window matches upstream (end = now, start = end - 1 day) when not provided.

Verified locally with cargo fmt --check, cargo clippy --features sqlite,mysql,postgresql -- -D warnings, and cargo test --features sqlite,mysql,postgresql (all pass), plus typos.


🔄 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/7320 **Author:** [@svrforum](https://github.com/svrforum) **Created:** 6/9/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/public-events-api` --- ### 📝 Commits (3) - [`989fa9a`](https://github.com/dani-garcia/vaultwarden/commit/989fa9ac0dda912a8713a33f25fb12407a1953c5) Add Event::to_json_public for Public API event model - [`1c91b8a`](https://github.com/dani-garcia/vaultwarden/commit/1c91b8a8c9ce8a047499bc563e832d25344a0cf2) Make get_continuation_token reusable across modules - [`283467f`](https://github.com/dani-garcia/vaultwarden/commit/283467f90ede3b688f18691521e51a821f977194) Add GET /public/events Bitwarden-compatible Public API endpoint ### 📊 Changes **3 files changed** (+101 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/api/core/events.rs` (+1 -1) 📝 `src/api/core/public.rs` (+48 -4) 📝 `src/db/models/event.rs` (+52 -0) </details> ### 📄 Description Implements the Bitwarden-compatible Public API `GET /public/events` endpoint, which was previously missing. This lets organization API keys export event logs (e.g. for SIEM integration), matching upstream Bitwarden. It reuses the existing event store, `PublicToken` auth, pagination, and continuation-token mechanism. A new `Event::to_json_public` emits the Public API field names (`itemId`, `memberId`, `object: "event"`, ...). Notes: - No schema change, no migration, no change to existing behavior (purely additive). - Returns an empty list when org events are disabled, consistent with the internal events endpoints. - Default date window matches upstream (end = now, start = end - 1 day) when not provided. Verified locally with `cargo fmt --check`, `cargo clippy --features sqlite,mysql,postgresql -- -D warnings`, and `cargo test --features sqlite,mysql,postgresql` (all pass), plus typos. --- <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-07-18 06:19:40 -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#41358