extract account into separate package

This commit is contained in:
Pascal Fischer 2023-11-28 14:34:57 +01:00
parent a729c83b06
commit bab420ca77
2 changed files with 15 additions and 13 deletions

View File

@ -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

View File

@ -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,
}
}