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/ipn
Nick Khyl e6eba4efee ipn/{auditlog,ipnext,ipnlocal}: convert the profile-change callback to a profile-state-change callback
In this PR, we enable extensions to track changes in the current prefs. These changes can result from a profile switch
or from the user or system modifying the current profile’s prefs. Since some extensions may want to distinguish between
the two events, while others may treat them similarly, we rename the existing profile-change callback to become
a profile-state-change callback and invoke it whenever the current profile or its preferences change. Extensions can still
use the sameNode parameter to distinguish between situations where the profile information, including its preferences,
has been updated but still represents the same tailnet node, and situations where a switch to a different profile has been made.

Having dedicated prefs-change callbacks is being considered, but currently seems redundant. A single profile-state-change callback
is easier to maintain. We’ll revisit the idea of adding a separate callback as we progress on extracting existing features from LocalBackend,
but the conversion to a profile-state-change callback is intended to be permanent.

Finally, we let extensions retrieve the current prefs or profile state (profile info + prefs) at any time using the new
CurrentProfileState and CurrentPrefs methods. We also simplify the NewControlClientCallback signature to exclude
profile prefs. It’s optional, and extensions can retrieve the current prefs themselves if needed.

Updates #12614
Updates tailscale/corp#27645
Updates tailscale/corp#26435
Updates tailscale/corp#27502

Signed-off-by: Nick Khyl <nickk@tailscale.com>
8 months ago
..
auditlog ipn/{auditlog,ipnext,ipnlocal}: convert the profile-change callback to a profile-state-change callback 8 months ago
conffile ipn/conffile: don't depend on hujson on iOS/Android 1 year ago
desktop ipn/desktop: fix panics on Windows 10, x86 8 months ago
ipnauth control/controlclient, ipn: add client audit logging (#14950) 9 months ago
ipnext ipn/{auditlog,ipnext,ipnlocal}: convert the profile-change callback to a profile-state-change callback 8 months ago
ipnlocal ipn/{auditlog,ipnext,ipnlocal}: convert the profile-change callback to a profile-state-change callback 8 months ago
ipnserver ipn/ipnserver: treat all plan9 safesocket connections as permitted 8 months ago
ipnstate Revert "ipn/ipnstate: add home DERP to tailscale status JSON" 8 months ago
localapi ipn/{ipnserver,localapi},tsnet: use ipnauth.Self as the actor in tsnet localapi handlers 10 months ago
policy ipn,tailconfig: clean up unreleased and removed app connector service 2 years ago
store ipn/store/kubestore: skip cache for the write replica in cert share mode (#15417) 8 months ago
backend.go ipn: declare NotifyWatchOpt consts without using iota 11 months ago
conf.go ipn: ensure that conffile is source of truth for advertised services. (#15361) 9 months ago
doc.go ipn: generate LoginProfileView and use it instead of *LoginProfile where appropriate 10 months ago
ipn_clone.go cmd/tailscale,ipn: add relay-server-port "tailscale set" flag and Prefs field (#15594) 8 months ago
ipn_test.go all: do not depend on the testing package 2 years ago
ipn_view.go cmd/tailscale,ipn: add relay-server-port "tailscale set" flag and Prefs field (#15594) 8 months ago
prefs.go ipn, ipn/ipnlocal: reduce coupling between LocalBackend/profileManager and the Windows-specific "current user" model 8 months ago
prefs_test.go cmd/tailscale,ipn: add relay-server-port "tailscale set" flag and Prefs field (#15594) 8 months ago
serve.go tailcfg: add ServiceName 11 months ago
serve_test.go ipn: [serve] warn that foreground funnel won't work if shields are up (#14685) 11 months ago
store.go ipn: add comment about thread-safety to StateStore 2 years ago
store_test.go ipn: avoid useless no-op WriteState calls 2 years ago