From bab420ca77981af5606550e447b6635fcc5d9db6 Mon Sep 17 00:00:00 2001 From: Pascal Fischer Date: Tue, 28 Nov 2023 14:34:57 +0100 Subject: [PATCH] extract account into separate package --- management/server/account.go | 15 ++------------- management/server/account/account.go | 13 +++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 management/server/account/account.go diff --git a/management/server/account.go b/management/server/account.go index 1563570fa..12198d726 100644 --- a/management/server/account.go +++ b/management/server/account.go @@ -24,6 +24,7 @@ import ( "github.com/netbirdio/netbird/base62" nbdns "github.com/netbirdio/netbird/dns" + "github.com/netbirdio/netbird/management/server/account" "github.com/netbirdio/netbird/management/server/activity" "github.com/netbirdio/netbird/management/server/idp" "github.com/netbirdio/netbird/management/server/jwtclaims" @@ -162,7 +163,7 @@ type Settings struct { JWTGroupsClaimName string // Extra is a dictionary of Account settings - Extra *ExtraSettings + Extra *account.ExtraSettings } // Copy copies the Settings struct @@ -180,18 +181,6 @@ func (s *Settings) Copy() *Settings { return settings } -type ExtraSettings struct { - // PeerApprovalEnabled enables or disables the need for peers bo be approved by an administrator - PeerApprovalEnabled bool -} - -// Copy copies the ExtraSettings struct -func (e *ExtraSettings) Copy() *ExtraSettings { - return &ExtraSettings{ - PeerApprovalEnabled: e.PeerApprovalEnabled, - } -} - // Account represents a unique account of the system type Account struct { // we have to name column to aid as it collides with Network.Id when work with associations diff --git a/management/server/account/account.go b/management/server/account/account.go new file mode 100644 index 000000000..b8b71a6de --- /dev/null +++ b/management/server/account/account.go @@ -0,0 +1,13 @@ +package account + +type ExtraSettings struct { + // PeerApprovalEnabled enables or disables the need for peers bo be approved by an administrator + PeerApprovalEnabled bool +} + +// Copy copies the ExtraSettings struct +func (e *ExtraSettings) Copy() *ExtraSettings { + return &ExtraSettings{ + PeerApprovalEnabled: e.PeerApprovalEnabled, + } +}