tka: provide authority StateID in NetworkLockStatus response (#8200)

Fixes #8201.

Signed-off-by: Andrea Gottardo <andrea@tailscale.com>
Co-authored-by: Andrea Gottardo <andrea@tailscale.com>
angott/allow-thunderbolt-bridge
Andrea Gottardo 1 year ago committed by GitHub
parent e32e5c0d0c
commit 66f97f4bea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -449,6 +449,8 @@ func (b *LocalBackend) NetworkLockStatus() *ipnstate.NetworkLockStatus {
filtered[i] = b.tka.filtered[i].Clone() filtered[i] = b.tka.filtered[i].Clone()
} }
stateID1, _ := b.tka.authority.StateIDs()
return &ipnstate.NetworkLockStatus{ return &ipnstate.NetworkLockStatus{
Enabled: true, Enabled: true,
Head: &head, Head: &head,
@ -457,6 +459,7 @@ func (b *LocalBackend) NetworkLockStatus() *ipnstate.NetworkLockStatus {
NodeKeySigned: selfAuthorized, NodeKeySigned: selfAuthorized,
TrustedKeys: outKeys, TrustedKeys: outKeys,
FilteredPeers: filtered, FilteredPeers: filtered,
StateID: stateID1,
} }
} }

@ -121,6 +121,11 @@ type NetworkLockStatus struct {
// (i.e. no connectivity) because they failed tailnet lock // (i.e. no connectivity) because they failed tailnet lock
// checks. // checks.
FilteredPeers []*TKAFilteredPeer FilteredPeers []*TKAFilteredPeer
// StateID is a nonce associated with the network lock authority,
// generated upon enablement. This field is not populated if the
// network lock is disabled.
StateID uint64
} }
// NetworkLockUpdate describes a change to network-lock state. // NetworkLockUpdate describes a change to network-lock state.

Loading…
Cancel
Save