From b987b2ab18ff4807c9b29d77510fd9ab4c3f0779 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 12 Jan 2021 12:13:27 -0800 Subject: [PATCH] control/controlclient: treat node sharer as owner for display purposes This make clients (macOS, Windows, tailscale status) show the node sharer's profile rather than the node owner (which may be anonymized). Updates #992 --- control/controlclient/direct.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index 49fc6b10d..1941b21fe 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -785,6 +785,20 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*Netw } addUserProfile(nm.User) for _, peer := range resp.Peers { + // TODO(bradfitz): ideally we'd push down the semantically correct + // Nodes with differing User vs Sharer fields, but that means + // updating Windows, macOS, and tailscale status to respect all + // those fields, but until we have a plan for what the UI should + // be later when we treat them differently, it's easier to just + // merge it together here. The server will anonymize UserProfile + // records of those not in your network and not a sharer, which + // will be most of the peer.Users so it'll be rare when a node's + // owner-who's-different-from-sharer will have a non-scrubbed + // UserProfile: they would've also needed to share a node + // themselves. Until we care, merge the data here. + if !peer.Sharer.IsZero() { + peer.User = peer.Sharer + } addUserProfile(peer.User) } if resp.Node.MachineAuthorized {