mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-24 02:31:18 -08:00
This interprets HiddenNetworkDevices per watch session and sends GUI visibility metadata for peers (without filtering them). We refresh the visibility snapshot when policy or peer membership changes. Updates tailscale/corp#44104 Signed-off-by: kari-ts <[email protected]>
24 lines
552 B
Go
24 lines
552 B
Go
// Copyright (c) Tailscale Inc & contributors
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//go:build !ts_omit_syspolicy
|
|
|
|
package policyclient
|
|
|
|
import (
|
|
"tailscale.com/util/syspolicy/pkey"
|
|
"tailscale.com/util/syspolicy/setting"
|
|
)
|
|
|
|
// PolicySnapshot is an alias for [settings.Snapshot] unless syspolicy is omitted
|
|
// from the build.
|
|
type policySnapshot = setting.Snapshot
|
|
|
|
func GetStringArrayFromSnapshot(snapshot *PolicySnapshot, key pkey.Key) []string {
|
|
if snapshot == nil {
|
|
return nil
|
|
}
|
|
values, _ := snapshot.Get(key).([]string)
|
|
return values
|
|
}
|