From 1ad82db95a192a35a2a41f65e4e25e0b17c23b29 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 15 Dec 2020 19:28:24 -0800 Subject: [PATCH] cmd/tailscale, ipn: WIP XXX: show ACL tags in tailscale status DO NOT SUBMIT; server doesn't send tags back anywhere Updates #576 Signed-off-by: Brad Fitzpatrick --- ipn/ipnstate/ipnstate.go | 8 ++++++++ ipn/local.go | 1 + 2 files changed, 9 insertions(+) diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go index 06559ce449..c06a6a4cf8 100644 --- a/ipn/ipnstate/ipnstate.go +++ b/ipn/ipnstate/ipnstate.go @@ -70,6 +70,11 @@ type PeerStatus struct { // etc by default. ShareeNode bool `json:",omitempty"` + // ACLTags, if non-empty, are the ACL identity the node is running as. + // When present, the UserID is then just who created it, but doesn't represent + // the effective user for ACL purposes. + ACLTags []string `json:",omitempty"` + // InNetworkMap means that this peer was seen in our latest network map. // In theory, all of InNetworkMap and InMagicSock and InEngine should all be true. InNetworkMap bool @@ -170,6 +175,9 @@ func (sb *StatusBuilder) AddPeer(peer key.Public, st *PeerStatus) { return } + if len(st.ACLTags) != 0 { + e.ACLTags = st.ACLTags + } if v := st.HostName; v != "" { e.HostName = v } diff --git a/ipn/local.go b/ipn/local.go index 52d24e67ff..44bdf930aa 100644 --- a/ipn/local.go +++ b/ipn/local.go @@ -223,6 +223,7 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) { Created: p.Created, LastSeen: lastSeen, ShareeNode: p.Hostinfo.ShareeNode, + ACLTags: p.Hostinfo.RequestTags, }) } }