tailscale/util/syspolicy
Nick Khyl 4df02bbb48 util/syspolicy/setting: use a custom marshaler for time.Duration
jsonv2 now returns an error when you marshal or unmarshal a time.Duration
without an explicit format flag. This is an intentional, temporary choice until
the default [time.Duration] representation is decided (see golang/go#71631).

setting.Snapshot can hold time.Duration values inside a map[string]any,
so the jsonv2 update breaks marshaling. In this PR, we start using
a custom marshaler until that decision is made or golang/go#71664
lets us specify the format explicitly.

This fixes `tailscale syspolicy list` failing when KeyExpirationNotice
or any other time.Duration policy setting is configured.

Fixes #16683

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-07-28 12:57:39 -05:00
..
internal all: unify some redundant testing.TB interface copies 2025-04-08 08:19:29 -07:00
rsop ipn/ipnlocal,util/syspolicy: add support for ExitNode.AllowOverride policy setting 2025-07-08 17:17:47 -05:00
setting util/syspolicy/setting: use a custom marshaler for time.Duration 2025-07-28 12:57:39 -05:00
source ipn/ipnlocal,util/syspolicy/source: retain existing exit node when using auto exit node, if it's allowed by policy 2025-07-07 15:38:30 -05:00
handler.go all: unify some redundant testing.TB interface copies 2025-04-08 08:19:29 -07:00
policy_keys_test.go util/syspolicy, ipn/ipnlocal: update syspolicy package to utilize syspolicy/rsop 2024-10-25 12:41:07 -05:00
policy_keys.go ipn/ipnlocal,util/syspolicy: add support for ExitNode.AllowOverride policy setting 2025-07-08 17:17:47 -05:00
syspolicy_test.go all: unify some redundant testing.TB interface copies 2025-04-08 08:19:29 -07:00
syspolicy_windows.go all: unify some redundant testing.TB interface copies 2025-04-08 08:19:29 -07:00
syspolicy.go ipn/{ipnauth,ipnlocal,localapi}: make EditPrefs return an error if changing exit node is restricted by policy 2025-07-07 17:18:00 -05:00