From 7be80d2a1c346770b1b6f574c0746ad4098f3f15 Mon Sep 17 00:00:00 2001 From: Andrew Dunham Date: Mon, 23 Jan 2023 14:51:33 -0500 Subject: [PATCH] ipn: add KeyExpiry to PeerStatus Signed-off-by: Andrew Dunham Change-Id: I9466ff3d3d92b64255b694394a4b5b508da074a5 --- ipn/ipnlocal/local.go | 1 + ipn/ipnstate/ipnstate.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 7e9da9f12..f2fea2404 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -720,6 +720,7 @@ func peerStatusFromNode(ps *ipnstate.PeerStatus, n *tailcfg.Node) { ps.PrimaryRoutes = &v } + ps.KeyExpiry = n.KeyExpiry if n.Expired { ps.Expired = true } diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go index 7e4f31847..9894c94f2 100644 --- a/ipn/ipnstate/ipnstate.go +++ b/ipn/ipnstate/ipnstate.go @@ -247,6 +247,10 @@ type PeerStatus struct { // In theory, all of InNetworkMap and InMagicSock and InEngine should all be true. InEngine bool + // KeyExpiry is the time that this peer's node key will or has expired. + // This will be the zero time for nodes that do not expire. + KeyExpiry time.Time `json:",omitempty"` + // Expired means that this peer's node key has expired, based on either // information from control or optimisically set on the client if the // expiration time has passed.