[PR #3332] [MERGED] Merge ClientIp with Headers. #12135

Closed
opened 2026-04-20 15:31:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/dani-garcia/vaultwarden/pull/3332
Author: @BlackDex
Created: 3/11/2023
Status: Merged
Merged: 3/15/2023
Merged by: @dani-garcia

Base: mainHead: merge-clientip-with-headers


📝 Commits (1)

  • 9e5b949 Merge ClientIp with Headers.

📊 Changes

17 files changed (+256 additions, -422 deletions)

View changed files

📝 src/api/admin.rs (+19 -18)
📝 src/api/core/accounts.rs (+5 -11)
📝 src/api/core/ciphers.rs (+73 -155)
📝 src/api/core/events.rs (+5 -10)
📝 src/api/core/organizations.rs (+56 -117)
📝 src/api/core/two_factor/authenticator.rs (+3 -5)
📝 src/api/core/two_factor/duo.rs (+5 -5)
📝 src/api/core/two_factor/email.rs (+4 -4)
📝 src/api/core/two_factor/mod.rs (+16 -23)
📝 src/api/core/two_factor/webauthn.rs (+5 -15)
📝 src/api/core/two_factor/yubikey.rs (+6 -16)
📝 src/api/identity.rs (+12 -5)
📝 src/api/notifications.rs (+2 -27)
📝 src/auth.rs (+25 -0)
📝 src/db/models/cipher.rs (+4 -3)
📝 src/main.rs (+13 -4)
📝 src/util.rs (+3 -4)

📄 Description

Since we now use the ClientIp Guard on a lot more places, it also increases the size of binary, and the macro generated code because of this extra Guard. By merging the ClientIp Guard with the several Header guards we have it reduces the amount of code generated (including LLVM IR), but also a small speedup in build time.

I also spotted some small json!() optimizations which also reduced the amount of code generated.

There was no decrease in the speed of the code as far as i could tell. It btw also lowered the amount of allocations done.


🔄 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/3332 **Author:** [@BlackDex](https://github.com/BlackDex) **Created:** 3/11/2023 **Status:** ✅ Merged **Merged:** 3/15/2023 **Merged by:** [@dani-garcia](https://github.com/dani-garcia) **Base:** `main` ← **Head:** `merge-clientip-with-headers` --- ### 📝 Commits (1) - [`9e5b949`](https://github.com/dani-garcia/vaultwarden/commit/9e5b94924f5fea4ef405fa1f8aeb836b52f85a73) Merge ClientIp with Headers. ### 📊 Changes **17 files changed** (+256 additions, -422 deletions) <details> <summary>View changed files</summary> 📝 `src/api/admin.rs` (+19 -18) 📝 `src/api/core/accounts.rs` (+5 -11) 📝 `src/api/core/ciphers.rs` (+73 -155) 📝 `src/api/core/events.rs` (+5 -10) 📝 `src/api/core/organizations.rs` (+56 -117) 📝 `src/api/core/two_factor/authenticator.rs` (+3 -5) 📝 `src/api/core/two_factor/duo.rs` (+5 -5) 📝 `src/api/core/two_factor/email.rs` (+4 -4) 📝 `src/api/core/two_factor/mod.rs` (+16 -23) 📝 `src/api/core/two_factor/webauthn.rs` (+5 -15) 📝 `src/api/core/two_factor/yubikey.rs` (+6 -16) 📝 `src/api/identity.rs` (+12 -5) 📝 `src/api/notifications.rs` (+2 -27) 📝 `src/auth.rs` (+25 -0) 📝 `src/db/models/cipher.rs` (+4 -3) 📝 `src/main.rs` (+13 -4) 📝 `src/util.rs` (+3 -4) </details> ### 📄 Description Since we now use the `ClientIp` Guard on a lot more places, it also increases the size of binary, and the macro generated code because of this extra Guard. By merging the `ClientIp` Guard with the several `Header` guards we have it reduces the amount of code generated (including LLVM IR), but also a small speedup in build time. I also spotted some small `json!()` optimizations which also reduced the amount of code generated. There was no decrease in the speed of the code as far as i could tell. It btw also lowered the amount of allocations done. --- <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-04-20 15:31:08 -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#12135