From 50f5cc48cdf006acf211294e95a497708dacfbca Mon Sep 17 00:00:00 2001 From: Maycon Santos Date: Thu, 27 Mar 2025 23:07:10 +0100 Subject: [PATCH] [management] Fix extended config when nil (#3593) * Fix extended config when nil * update integrations --- go.mod | 2 +- go.sum | 4 ++-- management/server/grpcserver.go | 4 ++-- management/server/token_mgr.go | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 83804c265..db70dfe79 100644 --- a/go.mod +++ b/go.mod @@ -62,7 +62,7 @@ require ( github.com/miekg/dns v1.1.59 github.com/mitchellh/hashstructure/v2 v2.0.2 github.com/nadoo/ipset v0.5.0 - github.com/netbirdio/management-integrations/integrations v0.0.0-20250325155416-f73a616e5408 + github.com/netbirdio/management-integrations/integrations v0.0.0-20250327214345-49bce94ab4d7 github.com/netbirdio/signal-dispatcher/dispatcher v0.0.0-20241010133937-e0df50df217d github.com/okta/okta-sdk-golang/v2 v2.18.0 github.com/oschwald/maxminddb-golang v1.12.0 diff --git a/go.sum b/go.sum index eeffe2bc4..6fbf353bd 100644 --- a/go.sum +++ b/go.sum @@ -490,8 +490,8 @@ github.com/netbirdio/go-netroute v0.0.0-20240611143515-f59b0e1d3944 h1:TDtJKmM6S github.com/netbirdio/go-netroute v0.0.0-20240611143515-f59b0e1d3944/go.mod h1:sHA6TRxjQ6RLbnI+3R4DZo2Eseg/iKiPRfNmcuNySVQ= github.com/netbirdio/ice/v3 v3.0.0-20240315174635-e72a50fcb64e h1:PURA50S8u4mF6RrkYYCAvvPCixhqqEiEy3Ej6avh04c= github.com/netbirdio/ice/v3 v3.0.0-20240315174635-e72a50fcb64e/go.mod h1:YMLU7qbKfVjmEv7EoZPIVEI+kNYxWCdPK3VS0BU+U4Q= -github.com/netbirdio/management-integrations/integrations v0.0.0-20250325155416-f73a616e5408 h1:zkMfK8AX4ZEvOypT8xbnQEJwvU6HZ4wiiTkpBFCW504= -github.com/netbirdio/management-integrations/integrations v0.0.0-20250325155416-f73a616e5408/go.mod h1:3LvBPnW+i06K9fQr1SYwsbhvnxQHtIC8vvO4PjLmmy0= +github.com/netbirdio/management-integrations/integrations v0.0.0-20250327214345-49bce94ab4d7 h1:Quma+ju/eiI6/p6XcHO9rBUtj4gdBPyA6AVIBym6Q0Y= +github.com/netbirdio/management-integrations/integrations v0.0.0-20250327214345-49bce94ab4d7/go.mod h1:3LvBPnW+i06K9fQr1SYwsbhvnxQHtIC8vvO4PjLmmy0= github.com/netbirdio/service v0.0.0-20240911161631-f62744f42502 h1:3tHlFmhTdX9axERMVN63dqyFqnvuD+EMJHzM7mNGON8= github.com/netbirdio/service v0.0.0-20240911161631-f62744f42502/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/netbirdio/signal-dispatcher/dispatcher v0.0.0-20241010133937-e0df50df217d h1:bRq5TKgC7Iq20pDiuC54yXaWnAVeS5PdGpSokFTlR28= diff --git a/management/server/grpcserver.go b/management/server/grpcserver.go index 5e59b9df1..dba5ab13b 100644 --- a/management/server/grpcserver.go +++ b/management/server/grpcserver.go @@ -637,8 +637,8 @@ func toSyncResponse(ctx context.Context, config *types.Config, peer *nbpeer.Peer } nbConfig := toNetbirdConfig(config, turnCredentials, relayCredentials, extraSettings) - integrationsConfig.ExtendNetBirdConfig(peer.ID, nbConfig, extraSettings) - response.NetbirdConfig = nbConfig + extendedConfig := integrationsConfig.ExtendNetBirdConfig(peer.ID, nbConfig, extraSettings) + response.NetbirdConfig = extendedConfig response.NetworkMap.PeerConfig = response.PeerConfig diff --git a/management/server/token_mgr.go b/management/server/token_mgr.go index ee9fee376..2f1243512 100644 --- a/management/server/token_mgr.go +++ b/management/server/token_mgr.go @@ -258,5 +258,6 @@ func (m *TimeBasedAuthSecretsManager) extendNetbirdConfig(ctx context.Context, p log.WithContext(ctx).Errorf("failed to get extra settings: %v", err) } - integrationsConfig.ExtendNetBirdConfig(peerID, update.NetbirdConfig, extraSettings) + extendedConfig := integrationsConfig.ExtendNetBirdConfig(peerID, update.NetbirdConfig, extraSettings) + update.NetbirdConfig = extendedConfig }