2 Commits

Author SHA1 Message Date
Joe Tsai
8f86d4f8b9 all: use slices.Collect with maps.Keys instead of xmaps.Keys
In Go 1.23, the standard maps.Keys helper was altered relative to xmaps.Keys
to return and iterator, which can be used with slices.Collect.

Also, Go 1.21 added the clear built-in, which replaces xmaps.Clear,
and is semantically more correct with respect to NaNs.

Updates #8632
Updates #12912
Updates #cleanup

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2024-10-11 11:41:09 -07:00
Nick Khyl
aeb15dea30 util/syspolicy/source: add package for reading policy settings from external stores
We add package defining interfaces for policy stores, enabling creation of policy sources
and reading settings from them. It includes a Windows-specific PlatformPolicyStore for GP and MDM
policies stored in the Registry, and an in-memory TestStore for testing purposes.

We also include an internal package that tracks and reports policy usage metrics when a policy setting
is read from a store. Initially, it will be used only on Windows and Android, as macOS, iOS, and tvOS
report their own metrics. However, we plan to use it across all platforms eventually.

Updates #12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2024-09-03 14:51:14 -05:00