[PR #170] [MERGED] Refactor: support multiple users under the same account #2588

Closed
opened 2025-11-20 07:11:45 -05:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/170
Author: @braginini
Created: 12/23/2021
Status: Merged
Merged: 12/27/2021
Merged by: @braginini

Base: mainHead: multitenancy


📝 Commits (10+)

  • 38a4c5c feature: add User entity to Account
  • 7e29f26 test: new file store creation test
  • 4a0b53c test: add FileStore persist-restore tests
  • ebf1cea test: add GetOrCreateAccountByUser Accountmanager test
  • a896c73 refactor: rename account manager users file
  • 6518b5d refactor: use userId instead of accountId when handling Management HTTP API
  • cd648d1 fix: new account creation for every request
  • ac0f590 fix: golint
  • 26f1bae chore: add account creator to Account Entity to identify who created the account.
  • 935f1e9 chore: use xid ID generator for account IDs

📊 Changes

18 files changed (+699 additions, -107 deletions)

View changed files

📝 go.mod (+2 -0)
📝 go.sum (+2 -0)
📝 management/server/account.go (+43 -35)
📝 management/server/account_test.go (+32 -45)
📝 management/server/file_store.go (+22 -0)
management/server/file_store_test.go (+171 -0)
📝 management/server/http/handler/peers.go (+13 -7)
📝 management/server/http/handler/setupkeys.go (+20 -14)
📝 management/server/http/handler/util.go (+2 -2)
management/server/migration/README.md (+13 -0)
management/server/migration/convert_accounts.go (+56 -0)
management/server/migration/convert_accounts_test.go (+76 -0)
📝 management/server/network.go (+8 -0)
📝 management/server/peer.go (+2 -3)
📝 management/server/store.go (+1 -0)
📝 management/server/testdata/store.json (+11 -1)
management/server/testdata/storev1.json (+154 -0)
management/server/user.go (+71 -0)

📄 Description

No description provided


🔄 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/170 **Author:** [@braginini](https://github.com/braginini) **Created:** 12/23/2021 **Status:** ✅ Merged **Merged:** 12/27/2021 **Merged by:** [@braginini](https://github.com/braginini) **Base:** `main` ← **Head:** `multitenancy` --- ### 📝 Commits (10+) - [`38a4c5c`](https://github.com/netbirdio/netbird/commit/38a4c5c10f4c9a4b54da8fae3db0087b713e7b05) feature: add User entity to Account - [`7e29f26`](https://github.com/netbirdio/netbird/commit/7e29f265418e5b006539ae8c0d8b27d260f436e5) test: new file store creation test - [`4a0b53c`](https://github.com/netbirdio/netbird/commit/4a0b53c277463c3ee80791cda05f4b12036947c2) test: add FileStore persist-restore tests - [`ebf1cea`](https://github.com/netbirdio/netbird/commit/ebf1ceac4f6a6e66fb6c14d278240ea3c7f5263f) test: add GetOrCreateAccountByUser Accountmanager test - [`a896c73`](https://github.com/netbirdio/netbird/commit/a896c7367a1b461fb0eea3dda6d5c53adfc3173a) refactor: rename account manager users file - [`6518b5d`](https://github.com/netbirdio/netbird/commit/6518b5d3effe1499884ca4619415be8e43294f88) refactor: use userId instead of accountId when handling Management HTTP API - [`cd648d1`](https://github.com/netbirdio/netbird/commit/cd648d1d9f8cb8878bf3dedd71e491f3ccfa8f13) fix: new account creation for every request - [`ac0f590`](https://github.com/netbirdio/netbird/commit/ac0f59000db32ca5893acc41c445e6a4919dce14) fix: golint - [`26f1bae`](https://github.com/netbirdio/netbird/commit/26f1baedd97dc7d2413fb2de9915b7de71c1fe04) chore: add account creator to Account Entity to identify who created the account. - [`935f1e9`](https://github.com/netbirdio/netbird/commit/935f1e9dc9fd76e56357a817060c1e1134a58079) chore: use xid ID generator for account IDs ### 📊 Changes **18 files changed** (+699 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+2 -0) 📝 `go.sum` (+2 -0) 📝 `management/server/account.go` (+43 -35) 📝 `management/server/account_test.go` (+32 -45) 📝 `management/server/file_store.go` (+22 -0) ➕ `management/server/file_store_test.go` (+171 -0) 📝 `management/server/http/handler/peers.go` (+13 -7) 📝 `management/server/http/handler/setupkeys.go` (+20 -14) 📝 `management/server/http/handler/util.go` (+2 -2) ➕ `management/server/migration/README.md` (+13 -0) ➕ `management/server/migration/convert_accounts.go` (+56 -0) ➕ `management/server/migration/convert_accounts_test.go` (+76 -0) 📝 `management/server/network.go` (+8 -0) 📝 `management/server/peer.go` (+2 -3) 📝 `management/server/store.go` (+1 -0) 📝 `management/server/testdata/store.json` (+11 -1) ➕ `management/server/testdata/storev1.json` (+154 -0) ➕ `management/server/user.go` (+71 -0) </details> ### 📄 Description _No description provided_ --- <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 2025-11-20 07:11:45 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#2588