mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-27 06:49:07 +01:00
[client] Fix lint findings on the file drop overlay wait
gosec G101 matched the identifier fileDropWatchName: its default pattern includes a bare "pw", which hits case-insensitively inside "fileDropWatch", and the constant's value then cleared the entropy threshold. Nothing here is credential-shaped, so rename rather than suppress. Any fileDropW... spelling keeps the match, hence fileDropReceiverLabel. overlayWait and the non-iOS overlayWaiter are read only by the iOS overlay address wait, and the linter analyses the default build only. Suppress with a reason; the field stays in engine.go as part of the lifecycle.
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
"github.com/netbirdio/netbird/client/internal/peer"
|
||||
)
|
||||
|
||||
const fileDropWatchName = "the file drop receiver"
|
||||
const fileDropReceiverLabel = "the file drop receiver"
|
||||
|
||||
type filedropResolver struct {
|
||||
status *peer.Status
|
||||
@@ -49,7 +49,7 @@ func (e *Engine) startFileDrop() {
|
||||
wgAddr := e.wgInterface.Address()
|
||||
if !e.overlayAddrReady(wgAddr.IP) {
|
||||
log.Infof("file drop receiver waits for the overlay address %s", wgAddr.IP)
|
||||
e.armOverlayWatch(fileDropWatchName, e.restartFileDrop)
|
||||
e.armOverlayWatch(fileDropReceiverLabel, e.restartFileDrop)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ func (e *Engine) startFileDrop() {
|
||||
if v6 := wgAddr.IPv6; v6.IsValid() {
|
||||
if err := e.fileDrop.AddReceiverListener(e.ctx, netip.AddrPortFrom(v6, bound)); err != nil {
|
||||
log.Warnf("failed to add IPv6 file drop listener: %v", err)
|
||||
e.armOverlayWatch(fileDropWatchName, e.restartFileDrop)
|
||||
e.armOverlayWatch(fileDropReceiverLabel, e.restartFileDrop)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user