types/persist: add a comment explaining "NetworkLockKey"

Changing the name to "TailnetLockKey" would be clearer but introduces
more risk; this is an easy and low-stakes improvement.

Updates tailscale/corp#37904

Change-Id: I38d804202538b8670a80e744eb4dcb689f0002df
Signed-off-by: Alex Chan <alexc@tailscale.com>
This commit is contained in:
Alex Chan
2026-07-27 09:55:36 +01:00
committed by Alex Chan
parent cd34d441be
commit 2900f3494a
2 changed files with 10 additions and 3 deletions
+7 -3
View File
@@ -24,9 +24,13 @@ type Persist struct {
PrivateNodeKey key.NodePrivate PrivateNodeKey key.NodePrivate
OldPrivateNodeKey key.NodePrivate // needed to request key rotation OldPrivateNodeKey key.NodePrivate // needed to request key rotation
UserProfile tailcfg.UserProfile UserProfile tailcfg.UserProfile
NetworkLockKey key.NLPrivate
NodeID tailcfg.StableNodeID // NetworkLockKey is the node's Tailnet Lock private key.
AttestationKey key.HardwareAttestationKey `json:",omitzero"` // "Network Lock" was the pre-release name for Tailnet Lock.
NetworkLockKey key.NLPrivate
NodeID tailcfg.StableNodeID
AttestationKey key.HardwareAttestationKey `json:",omitzero"`
// DisallowedTKAStateIDs stores the tka.State.StateID values which // DisallowedTKAStateIDs stores the tka.State.StateID values which
// this node will not operate tailnet lock on. This is used to // this node will not operate tailnet lock on. This is used to
+3
View File
@@ -91,6 +91,9 @@ func (v PersistView) PrivateNodeKey() key.NodePrivate { return v.ж.PrivateNodeK
// needed to request key rotation // needed to request key rotation
func (v PersistView) OldPrivateNodeKey() key.NodePrivate { return v.ж.OldPrivateNodeKey } func (v PersistView) OldPrivateNodeKey() key.NodePrivate { return v.ж.OldPrivateNodeKey }
func (v PersistView) UserProfile() tailcfg.UserProfileView { return v.ж.UserProfile.View() } func (v PersistView) UserProfile() tailcfg.UserProfileView { return v.ж.UserProfile.View() }
// NetworkLockKey is the node's Tailnet Lock private key.
// "Network Lock" was the pre-release name for Tailnet Lock.
func (v PersistView) NetworkLockKey() key.NLPrivate { return v.ж.NetworkLockKey } func (v PersistView) NetworkLockKey() key.NLPrivate { return v.ж.NetworkLockKey }
func (v PersistView) NodeID() tailcfg.StableNodeID { return v.ж.NodeID } func (v PersistView) NodeID() tailcfg.StableNodeID { return v.ж.NodeID }
func (v PersistView) AttestationKey() tailcfg.StableNodeID { panic("unsupported") } func (v PersistView) AttestationKey() tailcfg.StableNodeID { panic("unsupported") }