[PR #3516] [MERGED] [management] Add redis cache #20662

Open
opened 2026-08-05 05:07:32 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/3516
Author: @mlsmaycon
Created: 3/15/2025
Status: Merged
Merged: 3/18/2025
Merged by: @mlsmaycon

Base: feature/flowHead: add-redis-cache


📝 Commits (9)

📊 Changes

11 files changed (+544 additions, -160 deletions)

View changed files

📝 go.mod (+15 -15)
📝 go.sum (+34 -105)
📝 management/server/account.go (+24 -22)
📝 management/server/account/manager.go (+2 -3)
management/server/cache/idp.go (+113 -0)
management/server/cache/idp_test.go (+135 -0)
management/server/cache/marshaler.go (+35 -0)
management/server/cache/store.go (+50 -0)
management/server/cache/store_test.go (+105 -0)
📝 management/server/idp/idp.go (+18 -0)
📝 management/server/user_test.go (+13 -15)

📄 Description

Describe your changes

This PR refactors caching for IdP user data by introducing a Redis cache implementation alongside an in-memory fallback and updating related interfaces and tests.

  • Refactored cache interfaces with a new Marshaler interface and wrapper
  • Modified account and IdP user data cache implementations to support msgpack serialization
  • Updated test cases and store configuration for Redis integration

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

🔄 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/netbirdio/netbird/pull/3516 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 3/15/2025 **Status:** ✅ Merged **Merged:** 3/18/2025 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `feature/flow` ← **Head:** `add-redis-cache` --- ### 📝 Commits (9) - [`b6de832`](https://github.com/netbirdio/netbird/commit/b6de832c9ec267cba010fb62660c574990ea3981) add initial redis support - [`5d346ba`](https://github.com/netbirdio/netbird/commit/5d346ba3ff68a103239de0284d4ab3363b42b10f) update cache package to v4 and add store tests - [`35945ab`](https://github.com/netbirdio/netbird/commit/35945ab55fc38b79811dacdc495de04dbcd5ebeb) check redis connection - [`a538acf`](https://github.com/netbirdio/netbird/commit/a538acf4b4d1b01cf3c4d8c063cf2c0300935317) Add redis cache abs (#3515) - [`b0e6622`](https://github.com/netbirdio/netbird/commit/b0e6622cb58fe6dd34844a55a3e81012df383249) Merge branch 'feature/flow' into add-redis-cache - [`d313c33`](https://github.com/netbirdio/netbird/commit/d313c33028ff319dad134d223a0addfff780d2cd) sync go sum - [`5923295`](https://github.com/netbirdio/netbird/commit/592329554df3d35dc7357124b3ed052d3ce0ad1a) update go-jose - [`2cbe5ba`](https://github.com/netbirdio/netbird/commit/2cbe5ba8588348c35191efc61394163278ee3461) sync go.mod - [`64602c2`](https://github.com/netbirdio/netbird/commit/64602c2f62a55962536d46130d93d1aab142831a) update containerd and protobuf ### 📊 Changes **11 files changed** (+544 additions, -160 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+15 -15) 📝 `go.sum` (+34 -105) 📝 `management/server/account.go` (+24 -22) 📝 `management/server/account/manager.go` (+2 -3) ➕ `management/server/cache/idp.go` (+113 -0) ➕ `management/server/cache/idp_test.go` (+135 -0) ➕ `management/server/cache/marshaler.go` (+35 -0) ➕ `management/server/cache/store.go` (+50 -0) ➕ `management/server/cache/store_test.go` (+105 -0) 📝 `management/server/idp/idp.go` (+18 -0) 📝 `management/server/user_test.go` (+13 -15) </details> ### 📄 Description ## Describe your changes This PR refactors caching for IdP user data by introducing a Redis cache implementation alongside an in-memory fallback and updating related interfaces and tests. - Refactored cache interfaces with a new Marshaler interface and wrapper - Modified account and IdP user data cache implementations to support msgpack serialization - Updated test cases and store configuration for Redis integration - ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] Is a feature enhancement - [x] It is a refactor - [ ] Created tests that fail without the change (if possible) - [ ] Extended the README / documentation, if necessary --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 05:07:32 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#20662