From 73552eb32e6514db5baea0b3ddcf604fd80d42f1 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 15 Feb 2021 12:58:56 -0800 Subject: [PATCH] tailcfg: add Hostinfo.Package Updates tailscale/corp#440 --- tailcfg/tailcfg.go | 1 + tailcfg/tailcfg_clone.go | 1 + tailcfg/tailcfg_test.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index bcb7ec205..f687c9b04 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -406,6 +406,7 @@ type Hostinfo struct { BackendLogID string `json:",omitempty"` // logtail ID of backend instance OS string // operating system the client runs on (a version.OS value) OSVersion string `json:",omitempty"` // operating system version, with optional distro prefix ("Debian 10.4", "Windows 10 Pro 10.0.19041") + Package string `json:",omitempty"` // Tailscale package to disambiguate ("choco", "appstore", etc; "" for unknown) DeviceModel string `json:",omitempty"` // mobile phone model ("Pixel 3a", "iPhone 11 Pro") Hostname string // name of the host the client runs on ShieldsUp bool `json:",omitempty"` // indicates whether the host is blocking incoming connections diff --git a/tailcfg/tailcfg_clone.go b/tailcfg/tailcfg_clone.go index 87bbb2484..ee57f8113 100644 --- a/tailcfg/tailcfg_clone.go +++ b/tailcfg/tailcfg_clone.go @@ -107,6 +107,7 @@ var _HostinfoNeedsRegeneration = Hostinfo(struct { BackendLogID string OS string OSVersion string + Package string DeviceModel string Hostname string ShieldsUp bool diff --git a/tailcfg/tailcfg_test.go b/tailcfg/tailcfg_test.go index a6c843db5..5fa579b0d 100644 --- a/tailcfg/tailcfg_test.go +++ b/tailcfg/tailcfg_test.go @@ -25,7 +25,7 @@ func fieldsOf(t reflect.Type) (fields []string) { func TestHostinfoEqual(t *testing.T) { hiHandles := []string{ "IPNVersion", "FrontendLogID", "BackendLogID", - "OS", "OSVersion", "DeviceModel", "Hostname", + "OS", "OSVersion", "Package", "DeviceModel", "Hostname", "ShieldsUp", "ShareeNode", "GoArch", "RoutableIPs", "RequestTags",