You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/util/syspolicy/setting
Nick Khyl 2336c340c4 util/syspolicy: implement a syspolicy store that reads settings from environment variables
In this PR, we implement (but do not use yet, pending #13727 review) a syspolicy/source.Store
that reads policy settings from environment variables. It converts a CamelCase setting.Key,
such as AuthKey or ExitNodeID, to a SCREAMING_SNAKE_CASE, TS_-prefixed environment
variable name, such as TS_AUTH_KEY and TS_EXIT_NODE_ID. It then looks up the variable
and attempts to parse it according to the expected value type. If the environment variable
is not set, the policy setting is considered not configured in this store (the syspolicy package
will still read it from other sources). Similarly, if the environment variable has an invalid value
for the setting type, it won't be used (though the reported/logged error will differ).

Updates #13193
Updates #12687

Signed-off-by: Nick Khyl <nickk@tailscale.com>
4 weeks ago
..
errors.go util/syspolicy/source: add package for reading policy settings from external stores 3 months ago
key.go util/syspolicy: implement a syspolicy store that reads settings from environment variables 4 weeks ago
origin.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago
policy_scope.go util/syspolicy: add rsop package that provides access to the resultant policy 1 month ago
policy_scope_test.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago
raw_item.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago
setting.go util/syspolicy: add rsop package that provides access to the resultant policy 1 month ago
setting_test.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago
snapshot.go util/syspolicy/setting: update Snapshot to use Go 1.23 iterators 2 months ago
snapshot_test.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago
summary.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago
types.go util/syspolicy/setting: add package that contains types for the next syspolicy PRs 4 months ago