ipn: add KeyExpiry to PeerStatus

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I9466ff3d3d92b64255b694394a4b5b508da074a5
andrew/peer-status-KeyExpiry
Andrew Dunham 2023-01-23 14:51:33 -05:00
parent b74db24149
commit 7be80d2a1c
2 changed files with 5 additions and 0 deletions

View File

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

View File

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