diff --git a/cmd/derper/depaware.txt b/cmd/derper/depaware.txt index ba7228b2e..75213b512 100644 --- a/cmd/derper/depaware.txt +++ b/cmd/derper/depaware.txt @@ -69,7 +69,7 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa tailscale.com/types/opt from tailscale.com/client/tailscale+ tailscale.com/types/persist from tailscale.com/ipn tailscale.com/types/preftype from tailscale.com/ipn - tailscale.com/types/ptr from tailscale.com/hostinfo + tailscale.com/types/ptr from tailscale.com/hostinfo+ tailscale.com/types/structs from tailscale.com/ipn+ tailscale.com/types/tkatype from tailscale.com/types/key+ tailscale.com/types/views from tailscale.com/ipn/ipnstate+ diff --git a/cmd/tailscale/depaware.txt b/cmd/tailscale/depaware.txt index 2e0f11f8f..d80a0266e 100644 --- a/cmd/tailscale/depaware.txt +++ b/cmd/tailscale/depaware.txt @@ -98,7 +98,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep tailscale.com/types/opt from tailscale.com/net/netcheck+ tailscale.com/types/persist from tailscale.com/ipn tailscale.com/types/preftype from tailscale.com/cmd/tailscale/cli+ - tailscale.com/types/ptr from tailscale.com/hostinfo + tailscale.com/types/ptr from tailscale.com/hostinfo+ tailscale.com/types/structs from tailscale.com/ipn+ tailscale.com/types/tkatype from tailscale.com/types/key+ tailscale.com/types/views from tailscale.com/tailcfg+ diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 7e9da9f12..265d1889d 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -723,6 +723,10 @@ func peerStatusFromNode(ps *ipnstate.PeerStatus, n *tailcfg.Node) { if n.Expired { ps.Expired = true } + if t := n.KeyExpiry; !t.IsZero() { + t = t.Round(time.Second) + ps.KeyExpiry = &t + } } // WhoIs reports the node and user who owns the node with the given IP:port. diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go index 7e4f31847..561a43506 100644 --- a/ipn/ipnstate/ipnstate.go +++ b/ipn/ipnstate/ipnstate.go @@ -20,6 +20,7 @@ import ( "tailscale.com/tailcfg" "tailscale.com/types/key" + "tailscale.com/types/ptr" "tailscale.com/types/views" "tailscale.com/util/dnsname" ) @@ -251,6 +252,10 @@ type PeerStatus struct { // information from control or optimisically set on the client if the // expiration time has passed. Expired bool `json:",omitempty"` + + // KeyExpiry, if present, is the time at which the node key expired or + // will expire. + KeyExpiry *time.Time `json:",omitempty"` } type StatusBuilder struct { @@ -435,6 +440,9 @@ func (sb *StatusBuilder) AddPeer(peer key.NodePublic, st *PeerStatus) { if st.Expired { e.Expired = true } + if t := st.KeyExpiry; t != nil { + e.KeyExpiry = ptr.To(*t) + } } type StatusUpdater interface {