mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-29 15:29:40 +00:00
ipn/ipnlocal,util/syspolicy: add support for ExitNode.AllowOverride policy setting
When the policy setting is enabled, it allows users to override the exit node enforced by the ExitNodeID or ExitNodeIP policy. It's primarily intended for use when ExitNodeID is set to auto:any, but it can also be used with specific exit nodes. It does not allow disabling exit node usage entirely. Once the exit node policy is overridden, it will not be enforced again until the policy changes, the user connects or disconnects Tailscale, switches profiles, or disables the override. Updates tailscale/corp#29969 Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
@@ -59,6 +59,11 @@ func (c PolicyChange) HasChanged(key setting.Key) bool {
|
||||
}
|
||||
}
|
||||
|
||||
// HasChangedAnyOf reports whether any of the specified policy settings has changed.
|
||||
func (c PolicyChange) HasChangedAnyOf(keys ...setting.Key) bool {
|
||||
return slices.ContainsFunc(keys, c.HasChanged)
|
||||
}
|
||||
|
||||
// policyChangeCallbacks are the callbacks to invoke when the effective policy changes.
|
||||
// It is safe for concurrent use.
|
||||
type policyChangeCallbacks struct {
|
||||
|
||||
Reference in New Issue
Block a user