[PR #545] [MERGED] Simplified Store Interface #12725

Closed
opened 2026-08-05 02:06:33 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/545
Author: @braginini
Created: 11/6/2022
Status: Merged
Merged: 11/7/2022
Merged by: @braginini

Base: mainHead: feature/new-store-interface


📝 Commits (10+)

  • b4c229a Return a user when getting account from JWT claims
  • 4bfeb88 Return a user when getting account from JWT claims
  • f092e08 Move setup key hiding logic to the account manager
  • d20e469 Fix tests
  • 2e2ffdb Show only current user if user is not admin
  • 4b78c74 Fix tests
  • 3cd6540 Add GetPeers func to the account manager
  • 3a11b24 Show only peers that belong to the current user if not an admin
  • c379f4c Fix Codacy
  • 24fddbf Show rules only to admin users

📊 Changes

17 files changed (+536 additions, -782 deletions)

View changed files

📝 management/cmd/management.go (+0 -2)
📝 management/server/account.go (+141 -12)
📝 management/server/account_test.go (+162 -0)
📝 management/server/file_store.go (+66 -423)
📝 management/server/file_store_test.go (+62 -15)
📝 management/server/http/groups_test.go (+2 -2)
📝 management/server/http/routes.go (+4 -4)
management/server/migration/README.md (+0 -13)
management/server/migration/convert_accounts.go (+0 -56)
management/server/migration/convert_accounts_test.go (+0 -76)
📝 management/server/mock_server/account_mock.go (+8 -21)
📝 management/server/nameserver_test.go (+5 -0)
📝 management/server/peer.go (+68 -113)
📝 management/server/route.go (+6 -25)
📝 management/server/route_test.go (+6 -1)
📝 management/server/store.go (+4 -17)
📝 management/server/user.go (+2 -2)

📄 Description

This PR simplifies Store and FileStore
by keeping just the Get and Save account methods.

The AccountManager operates mostly around
a single account, so it makes sense to fetch
the whole account object from the store.


🔄 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/545 **Author:** [@braginini](https://github.com/braginini) **Created:** 11/6/2022 **Status:** ✅ Merged **Merged:** 11/7/2022 **Merged by:** [@braginini](https://github.com/braginini) **Base:** `main` ← **Head:** `feature/new-store-interface` --- ### 📝 Commits (10+) - [`b4c229a`](https://github.com/netbirdio/netbird/commit/b4c229af7bbb90d576aa1d3e4f8334e6992c8b2a) Return a user when getting account from JWT claims - [`4bfeb88`](https://github.com/netbirdio/netbird/commit/4bfeb88abf9a3802cb610c3df2f0f6b04a024d74) Return a user when getting account from JWT claims - [`f092e08`](https://github.com/netbirdio/netbird/commit/f092e0835e8bc025b81c17ef4a9265eac7a73c40) Move setup key hiding logic to the account manager - [`d20e469`](https://github.com/netbirdio/netbird/commit/d20e469020924715f2ede8aa9b44922e48deab6a) Fix tests - [`2e2ffdb`](https://github.com/netbirdio/netbird/commit/2e2ffdbba456c241607c5919b6069fd7a0ec450b) Show only current user if user is not admin - [`4b78c74`](https://github.com/netbirdio/netbird/commit/4b78c74d1d546b11f2e7d4c402c37f3f81517f41) Fix tests - [`3cd6540`](https://github.com/netbirdio/netbird/commit/3cd6540e78083e1c450f99074896dd54a8f82f1c) Add GetPeers func to the account manager - [`3a11b24`](https://github.com/netbirdio/netbird/commit/3a11b245a285ae4bc3bc6c51b504a3684fbcc888) Show only peers that belong to the current user if not an admin - [`c379f4c`](https://github.com/netbirdio/netbird/commit/c379f4cb56c90c79c1229d9b0dc8c4c0e154b443) Fix Codacy - [`24fddbf`](https://github.com/netbirdio/netbird/commit/24fddbfa622f2fa2e1cca3255b3fc9ce32fb6d79) Show rules only to admin users ### 📊 Changes **17 files changed** (+536 additions, -782 deletions) <details> <summary>View changed files</summary> 📝 `management/cmd/management.go` (+0 -2) 📝 `management/server/account.go` (+141 -12) 📝 `management/server/account_test.go` (+162 -0) 📝 `management/server/file_store.go` (+66 -423) 📝 `management/server/file_store_test.go` (+62 -15) 📝 `management/server/http/groups_test.go` (+2 -2) 📝 `management/server/http/routes.go` (+4 -4) ➖ `management/server/migration/README.md` (+0 -13) ➖ `management/server/migration/convert_accounts.go` (+0 -56) ➖ `management/server/migration/convert_accounts_test.go` (+0 -76) 📝 `management/server/mock_server/account_mock.go` (+8 -21) 📝 `management/server/nameserver_test.go` (+5 -0) 📝 `management/server/peer.go` (+68 -113) 📝 `management/server/route.go` (+6 -25) 📝 `management/server/route_test.go` (+6 -1) 📝 `management/server/store.go` (+4 -17) 📝 `management/server/user.go` (+2 -2) </details> ### 📄 Description This PR simplifies Store and FileStore by keeping just the Get and Save account methods. The AccountManager operates mostly around a single account, so it makes sense to fetch the whole account object from the store. --- <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 02:06:33 -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#12725