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 <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2020-12-15 19:28:24 -08:00
parent da1bad51cd
commit 1ad82db95a
2 changed files with 9 additions and 0 deletions

View File

@ -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
}

View File

@ -223,6 +223,7 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) {
Created: p.Created,
LastSeen: lastSeen,
ShareeNode: p.Hostinfo.ShareeNode,
ACLTags: p.Hostinfo.RequestTags,
})
}
}