Skip to content

Commit

Permalink
move peer validation into getPeerconnectionResources
Browse files Browse the repository at this point in the history
  • Loading branch information
pascal-fischer committed Dec 4, 2023
1 parent b9fc008 commit 89249b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 0 additions & 1 deletion management/server/account.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ func (a *Account) GetPeerNetworkMap(peerID, dnsDomain string) *NetworkMap {
}
}
aclPeers, firewallRules := a.getPeerConnectionResources(peerID)
aclPeers = additions.ValidatePeers(aclPeers)
// exclude expired peers
var peersToConnect []*nbpeer.Peer
var expiredPeers []*nbpeer.Peer
Expand Down
3 changes: 3 additions & 0 deletions management/server/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"strconv"
"strings"

"github.com/netbirdio/management-integrations/additions"
log "github.com/sirupsen/logrus"

"github.com/netbirdio/netbird/management/proto"
Expand Down Expand Up @@ -220,6 +221,8 @@ func (a *Account) getPeerConnectionResources(peerID string) ([]*nbpeer.Peer, []*

sourcePeers, peerInSources := getAllPeersFromGroups(a, rule.Sources, peerID)
destinationPeers, peerInDestinations := getAllPeersFromGroups(a, rule.Destinations, peerID)
sourcePeers = additions.ValidatePeers(sourcePeers)
destinationPeers = additions.ValidatePeers(destinationPeers)

if rule.Bidirectional {
if peerInSources {
Expand Down

0 comments on commit 89249b4

Please sign in to comment.