syspolicy

package
v1.90.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2025 License: BSD-3-Clause Imports: 13 Imported by: 4

Documentation

Overview

Package syspolicy contains the implementation of system policy management. Calling code should use the client interface in tailscale.com/util/syspolicy/policyclient.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotConfigured is returned when the requested policy setting is not configured.
	ErrNotConfigured = setting.ErrNotConfigured
	// ErrTypeMismatch is returned when there's a type mismatch between the actual type
	// of the setting value and the expected type.
	ErrTypeMismatch = setting.ErrTypeMismatch
	// ErrNoSuchKey is returned by [setting.DefinitionOf] when no policy setting
	// has been registered with the specified key.
	//
	// This error is also returned by a (now deprecated) [Handler] when the specified
	// key does not have a value set. While the package maintains compatibility with this
	// usage of ErrNoSuchKey, it is recommended to return [ErrNotConfigured] from newer
	// [source.Store] implementations.
	ErrNoSuchKey = setting.ErrNoSuchKey
)

Functions

func RegisterStore added in v1.78.0

func RegisterStore(name string, scope setting.PolicyScope, store source.Store) (*rsop.StoreRegistration, error)

RegisterStore registers a new policy source.Store with the specified name and setting.PolicyScope.

It is a shorthand for rsop.RegisterStore.

func SelectControlURL

func SelectControlURL(reg, disk string) string

SelectControlURL returns the ControlURL to use based on a value in the registry (LoginURL) and the one on disk (in the GUI's prefs.conf). If both are empty, it returns a default value. (It always return a non-empty value)

See https://github.com/tailscale/tailscale/issues/2798 for some background.

Types

This section is empty.

Directories

Path Synopsis
Package internal contains miscellaneous functions and types that are internal to the syspolicy packages.
Package internal contains miscellaneous functions and types that are internal to the syspolicy packages.
loggerx
Package loggerx provides logging functions to the rest of the syspolicy packages.
Package loggerx provides logging functions to the rest of the syspolicy packages.
metrics
Package metrics provides logging and reporting for policy settings and scopes.
Package metrics provides logging and reporting for policy settings and scopes.
Package pkey defines the keys used to store system policies in the registry.
Package pkey defines the keys used to store system policies in the registry.
Package policyclient contains the minimal syspolicy interface as needed by client code using syspolicy.
Package policyclient contains the minimal syspolicy interface as needed by client code using syspolicy.
Package policytest contains test helpers for the syspolicy packages.
Package policytest contains test helpers for the syspolicy packages.
Package ptype contains types used by syspolicy.
Package ptype contains types used by syspolicy.
Package rsop facilitates source.Store registration via RegisterStore and provides access to the effective policy merged from all registered sources via PolicyFor.
Package rsop facilitates source.Store registration via RegisterStore and provides access to the effective policy merged from all registered sources via PolicyFor.
Package setting contains types for defining and representing policy settings.
Package setting contains types for defining and representing policy settings.
Package source defines interfaces for policy stores, facilitates the creation of policy sources, and provides functionality for reading policy settings from these sources.
Package source defines interfaces for policy stores, facilitates the creation of policy sources, and provides functionality for reading policy settings from these sources.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL