tailcfg: use key.NodePublic in wire protocol types.

Updates #3206.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2021-11-01 20:55:52 -07:00
committed by Dave Anderson
parent 7e8d5ed6f3
commit 7e6a1ef4f1
14 changed files with 56 additions and 57 deletions

View File

@@ -166,7 +166,7 @@ type Node struct {
// Sharer, if non-zero, is the user who shared this node, if different than User.
Sharer UserID `json:",omitempty"`
Key NodeKey
Key key.NodePublic
KeyExpiry time.Time
Machine key.MachinePublic
DiscoKey DiscoKey
@@ -638,8 +638,8 @@ func (st SignatureType) String() string {
type RegisterRequest struct {
_ structs.Incomparable
Version int // currently 1
NodeKey NodeKey
OldNodeKey NodeKey
NodeKey key.NodePublic
OldNodeKey key.NodePublic
Auth struct {
_ structs.Incomparable
// One of Provider/LoginName, Oauth2Token, or AuthKey is set.
@@ -756,7 +756,7 @@ type MapRequest struct {
Compress string // "zstd" or "" (no compression)
KeepAlive bool // whether server should send keep-alives back to us
NodeKey NodeKey
NodeKey key.NodePublic
DiscoKey DiscoKey
IncludeIPv6 bool `json:",omitempty"` // include IPv6 endpoints in returned Node Endpoints (for Version 4 clients)
Stream bool // if true, multiple MapResponse objects are returned
@@ -1284,7 +1284,7 @@ type SetDNSRequest struct {
Version int
// NodeKey is the client's current node key.
NodeKey NodeKey
NodeKey key.NodePublic
// Name is the domain name for which to create a record.
// For ACME DNS-01 challenges, it should be one of the domains

View File

@@ -72,7 +72,7 @@ var _NodeCloneNeedsRegeneration = Node(struct {
Name string
User UserID
Sharer UserID
Key key.NodeKey
Key key.NodePublic
KeyExpiry time.Time
Machine key.MachinePublic
DiscoKey DiscoKey

View File

@@ -264,13 +264,13 @@ func TestNodeEqual(t *testing.T) {
true,
},
{
&Node{Key: n1.AsNodeKey()},
&Node{Key: key.NewNode().Public().AsNodeKey()},
&Node{Key: n1},
&Node{Key: key.NewNode().Public()},
false,
},
{
&Node{Key: n1.AsNodeKey()},
&Node{Key: n1.AsNodeKey()},
&Node{Key: n1},
&Node{Key: n1},
true,
},
{