[PR #2715] [MERGED] Refactor getAccountIDWithAuthorizationClaims #15533

Closed
opened 2026-08-05 03:07:53 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/2715
Author: @mlsmaycon
Created: 10/9/2024
Status: Merged
Merged: 10/12/2024
Merged by: @mlsmaycon

Base: mainHead: refactor/new-account-check


📝 Commits (10+)

  • a295d8f add GetAccountUsers
  • 33813cf use table tests
  • 1e4935d refactor getAccountIDWithAuthorizationClaims
  • feb1f08 refactor updateAccountDomainAttributes
  • af7ed2b Merge branch 'main' into refactor/new-account-check
  • 3832a22 rename updateAccountDomainAttributes
  • dee181c Merge branch 'main' into refactor/new-account-check
  • 490c02b use new test function
  • 95c60cb use log message constants and update doc
  • 084fd83 use errors.New

📊 Changes

5 files changed (+441 additions, -273 deletions)

View changed files

📝 management/server/account.go (+206 -131)
📝 management/server/account_test.go (+136 -142)
📝 management/server/sql_store.go (+37 -0)
📝 management/server/sql_store_test.go (+60 -0)
📝 management/server/store.go (+2 -0)

📄 Description

Describe your changes

This change restructures the getAccountIDWithAuthorizationClaims method to improve readability, maintainability, and performance.

  • have dedicated methods to handle possible cases
  • introduced Store.UpdateAccountDomainAttributes and Store.GetAccountUsers methods
  • Remove GetAccount and SaveAccount dependency
  • added tests

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/2715 **Author:** [@mlsmaycon](https://github.com/mlsmaycon) **Created:** 10/9/2024 **Status:** ✅ Merged **Merged:** 10/12/2024 **Merged by:** [@mlsmaycon](https://github.com/mlsmaycon) **Base:** `main` ← **Head:** `refactor/new-account-check` --- ### 📝 Commits (10+) - [`a295d8f`](https://github.com/netbirdio/netbird/commit/a295d8fce292e255ac31e892e1d1780db4e1f139) add GetAccountUsers - [`33813cf`](https://github.com/netbirdio/netbird/commit/33813cf2e5936dacaed6dfce3fd69d1b4ea2d3ee) use table tests - [`1e4935d`](https://github.com/netbirdio/netbird/commit/1e4935d47b94084e6a3082f1b342abeb73aa5c28) refactor getAccountIDWithAuthorizationClaims - [`feb1f08`](https://github.com/netbirdio/netbird/commit/feb1f08c3fd7d242dc2100b3cc4a27163f92c9b7) refactor updateAccountDomainAttributes - [`af7ed2b`](https://github.com/netbirdio/netbird/commit/af7ed2b731e2150c1eae4ce066a3acbd31927cd3) Merge branch 'main' into refactor/new-account-check - [`3832a22`](https://github.com/netbirdio/netbird/commit/3832a22c071cc89d3849acd2c93713f6a38c0f4b) rename updateAccountDomainAttributes - [`dee181c`](https://github.com/netbirdio/netbird/commit/dee181cc462fca07aa82af0d1a52d81d9100e636) Merge branch 'main' into refactor/new-account-check - [`490c02b`](https://github.com/netbirdio/netbird/commit/490c02bb925a104df8f303ed6033f75703d814c1) use new test function - [`95c60cb`](https://github.com/netbirdio/netbird/commit/95c60cb5bcd257e144eb694465551f0b1d49b27a) use log message constants and update doc - [`084fd83`](https://github.com/netbirdio/netbird/commit/084fd839723e0e4ba3ad1033ce5c68c5cfbd9442) use errors.New ### 📊 Changes **5 files changed** (+441 additions, -273 deletions) <details> <summary>View changed files</summary> 📝 `management/server/account.go` (+206 -131) 📝 `management/server/account_test.go` (+136 -142) 📝 `management/server/sql_store.go` (+37 -0) 📝 `management/server/sql_store_test.go` (+60 -0) 📝 `management/server/store.go` (+2 -0) </details> ### 📄 Description ## Describe your changes This change restructures the getAccountIDWithAuthorizationClaims method to improve readability, maintainability, and performance. - have dedicated methods to handle possible cases - introduced Store.UpdateAccountDomainAttributes and Store.GetAccountUsers methods - Remove GetAccount and SaveAccount dependency - added tests ## Issue ticket number and link ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [ ] Is a feature enhancement - [x] It is a refactor - [x] 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 03:07:53 -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#15533