mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-07 22:19:08 +02:00
Resolve merge conflicts from main
- login.go: keep both new imports (mdm + nbnet + server) - ios/NetBirdSDK/client.go: additive struct-field merge (mdmLoader + stateMu/connectClient/config) - setconfig_mdm_test.go: adopt new withMDMPolicy(t, s, policy) signature; fix stray old-signature call in TestSetConfig_MDMAllow_ManagementURLPortNormalized
This commit is contained in:
@@ -17,11 +17,8 @@ import (
|
|||||||
"github.com/netbirdio/netbird/client/internal"
|
"github.com/netbirdio/netbird/client/internal"
|
||||||
"github.com/netbirdio/netbird/client/internal/auth"
|
"github.com/netbirdio/netbird/client/internal/auth"
|
||||||
"github.com/netbirdio/netbird/client/internal/profilemanager"
|
"github.com/netbirdio/netbird/client/internal/profilemanager"
|
||||||
<<<<<<< ours
|
|
||||||
"github.com/netbirdio/netbird/client/mdm"
|
"github.com/netbirdio/netbird/client/mdm"
|
||||||
=======
|
|
||||||
nbnet "github.com/netbirdio/netbird/client/net"
|
nbnet "github.com/netbirdio/netbird/client/net"
|
||||||
>>>>>>> theirs
|
|
||||||
"github.com/netbirdio/netbird/client/proto"
|
"github.com/netbirdio/netbird/client/proto"
|
||||||
"github.com/netbirdio/netbird/client/server"
|
"github.com/netbirdio/netbird/client/server"
|
||||||
"github.com/netbirdio/netbird/client/system"
|
"github.com/netbirdio/netbird/client/system"
|
||||||
|
|||||||
@@ -84,18 +84,16 @@ type Client struct {
|
|||||||
// preloadedConfig holds config loaded from JSON (used on tvOS where file writes are blocked)
|
// preloadedConfig holds config loaded from JSON (used on tvOS where file writes are blocked)
|
||||||
preloadedConfig *profilemanager.Config
|
preloadedConfig *profilemanager.Config
|
||||||
|
|
||||||
<<<<<<< ours
|
|
||||||
// mdmLoader holds the per-Client MDM policy source. Set by
|
// mdmLoader holds the per-Client MDM policy source. Set by
|
||||||
// SetMDMPolicyFetcher (called from the Swift side at extension
|
// SetMDMPolicyFetcher (called from the Swift side at extension
|
||||||
// init). Each Run passes this loader to the resolved Config so
|
// init). Each Run passes this loader to the resolved Config so
|
||||||
// applyMDMPolicy picks up the active overlay. Nil means "MDM
|
// applyMDMPolicy picks up the active overlay. Nil means "MDM
|
||||||
// enforcement off for this Client".
|
// enforcement off for this Client".
|
||||||
mdmLoader *mdm.Loader
|
mdmLoader *mdm.Loader
|
||||||
=======
|
|
||||||
stateMu sync.RWMutex
|
stateMu sync.RWMutex
|
||||||
connectClient *internal.ConnectClient
|
connectClient *internal.ConnectClient
|
||||||
config *profilemanager.Config
|
config *profilemanager.Config
|
||||||
>>>>>>> theirs
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewClient instantiate a new Client
|
// NewClient instantiate a new Client
|
||||||
|
|||||||
@@ -131,15 +131,6 @@ func TestSetConfig_MDMReject_SingleField(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSetConfig_MDMReject_MultipleFields(t *testing.T) {
|
func TestSetConfig_MDMReject_MultipleFields(t *testing.T) {
|
||||||
<<<<<<< ours
|
|
||||||
=======
|
|
||||||
withMDMPolicy(t, mdm.NewPolicy(map[string]any{
|
|
||||||
mdm.KeyManagementURL: "https://mdm.example.com:443",
|
|
||||||
mdm.KeyBlockInbound: true,
|
|
||||||
mdm.KeyRosenpassEnabled: true,
|
|
||||||
}))
|
|
||||||
|
|
||||||
>>>>>>> theirs
|
|
||||||
s, ctx, profName, username, _ := setupServerWithProfile(t)
|
s, ctx, profName, username, _ := setupServerWithProfile(t)
|
||||||
withMDMPolicy(t, s, mdm.NewPolicy(map[string]any{
|
withMDMPolicy(t, s, mdm.NewPolicy(map[string]any{
|
||||||
mdm.KeyManagementURL: "https://mdm.example.com:443",
|
mdm.KeyManagementURL: "https://mdm.example.com:443",
|
||||||
@@ -229,12 +220,11 @@ func TestSetConfig_MDMAllow_ManagementURLPortNormalized(t *testing.T) {
|
|||||||
|
|
||||||
for _, tc := range tests {
|
for _, tc := range tests {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
withMDMPolicy(t, mdm.NewPolicy(map[string]any{
|
s, ctx, profName, username, _ := setupServerWithProfile(t)
|
||||||
|
withMDMPolicy(t, s, mdm.NewPolicy(map[string]any{
|
||||||
mdm.KeyManagementURL: tc.mdmURL,
|
mdm.KeyManagementURL: tc.mdmURL,
|
||||||
}))
|
}))
|
||||||
|
|
||||||
s, ctx, profName, username, _ := setupServerWithProfile(t)
|
|
||||||
|
|
||||||
rosenpassEnabled := true
|
rosenpassEnabled := true
|
||||||
resp, err := s.SetConfig(ctx, &proto.SetConfigRequest{
|
resp, err := s.SetConfig(ctx, &proto.SetConfigRequest{
|
||||||
ProfileName: profName,
|
ProfileName: profName,
|
||||||
|
|||||||
Reference in New Issue
Block a user