@@ -19,6 +19,7 @@ import (
1919 nbdns "github.com/netbirdio/netbird/dns"
2020 "github.com/netbirdio/netbird/management/internals/controllers/network_map"
2121 "github.com/netbirdio/netbird/management/internals/controllers/network_map/controller/cache"
22+ "github.com/netbirdio/netbird/management/internals/server/config"
2223 "github.com/netbirdio/netbird/management/internals/shared/grpc"
2324 "github.com/netbirdio/netbird/management/server/account"
2425 "github.com/netbirdio/netbird/management/server/integrations/integrated_validator"
@@ -47,6 +48,7 @@ type Controller struct {
4748 updateAccountPeersBufferInterval atomic.Int64
4849 // dnsDomain is used for peer resolution. This is appended to the peer's name
4950 dnsDomain string
51+ config * config.Config
5052
5153 requestBuffer account.RequestBuffer
5254
@@ -68,7 +70,7 @@ type bufferUpdate struct {
6870
6971var _ network_map.Controller = (* Controller )(nil )
7072
71- func NewController (ctx context.Context , store store.Store , metrics telemetry.AppMetrics , peersUpdateManager network_map.PeersUpdateManager , requestBuffer account.RequestBuffer , integratedPeerValidator integrated_validator.IntegratedValidator , settingsManager settings.Manager , dnsDomain string , proxyController port_forwarding.Controller ) * Controller {
73+ func NewController (ctx context.Context , store store.Store , metrics telemetry.AppMetrics , peersUpdateManager network_map.PeersUpdateManager , requestBuffer account.RequestBuffer , integratedPeerValidator integrated_validator.IntegratedValidator , settingsManager settings.Manager , dnsDomain string , proxyController port_forwarding.Controller , config * config. Config ) * Controller {
7274 nMetrics , err := newMetrics (metrics .UpdateChannelMetrics ())
7375 if err != nil {
7476 log .Fatal (fmt .Errorf ("error creating metrics: %w" , err ))
@@ -95,6 +97,7 @@ func NewController(ctx context.Context, store store.Store, metrics telemetry.App
9597 integratedPeerValidator : integratedPeerValidator ,
9698 settingsManager : settingsManager ,
9799 dnsDomain : dnsDomain ,
100+ config : config ,
98101
99102 proxyController : proxyController ,
100103
@@ -205,7 +208,7 @@ func (c *Controller) sendUpdateAccountPeers(ctx context.Context, accountID strin
205208
206209 peerGroups := account .GetPeerGroups (p .ID )
207210 start = time .Now ()
208- update := grpc .ToSyncResponse (ctx , nil , p , nil , nil , remotePeerNetworkMap , dnsDomain , postureChecks , dnsCache , account .Settings , extraSetting , maps .Keys (peerGroups ), dnsFwdPort )
211+ update := grpc .ToSyncResponse (ctx , nil , c . config . HttpConfig , c . config . DeviceAuthorizationFlow , p , nil , nil , remotePeerNetworkMap , dnsDomain , postureChecks , dnsCache , account .Settings , extraSetting , maps .Keys (peerGroups ), dnsFwdPort )
209212 c .metrics .CountToSyncResponseDuration (time .Since (start ))
210213
211214 c .peersUpdateManager .SendUpdate (ctx , p .ID , & network_map.UpdateMessage {Update : update })
@@ -323,7 +326,7 @@ func (c *Controller) UpdateAccountPeer(ctx context.Context, accountId string, pe
323326 peerGroups := account .GetPeerGroups (peerId )
324327 dnsFwdPort := computeForwarderPort (maps .Values (account .Peers ), network_map .DnsForwarderPortMinVersion )
325328
326- update := grpc .ToSyncResponse (ctx , nil , peer , nil , nil , remotePeerNetworkMap , dnsDomain , postureChecks , dnsCache , account .Settings , extraSettings , maps .Keys (peerGroups ), dnsFwdPort )
329+ update := grpc .ToSyncResponse (ctx , nil , c . config . HttpConfig , c . config . DeviceAuthorizationFlow , peer , nil , nil , remotePeerNetworkMap , dnsDomain , postureChecks , dnsCache , account .Settings , extraSettings , maps .Keys (peerGroups ), dnsFwdPort )
327330 c .peersUpdateManager .SendUpdate (ctx , peer .ID , & network_map.UpdateMessage {Update : update })
328331
329332 return nil
0 commit comments