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 94f4f83731 ipn, ipn/ipnlocal: reduce coupling between LocalBackend/profileManager and the Windows-specific "current user" model
Ultimately, we'd like to get rid of the concept of the "current user". It is only used on Windows,
but even then it doesn't work well in multi-user and enterprise/managed Windows environments.

In this PR, we update LocalBackend and profileManager to decouple them a bit more from this obsolete concept.
This is done in a preparation for extracting ipnlocal.Extension-related interfaces and types, and using them
to implement optional features like tailscale/corp#27645, instead of continuing growing the core ipnlocal logic.

Notably, we rename (*profileManager).SetCurrentUserAndProfile() to SwitchToProfile() and change its signature
to accept an ipn.LoginProfileView instead of an ipn.ProfileID and ipn.WindowsUserID. Since we're not removing
the "current user" completely just yet, the method sets the current user to the owner of the target profile.

We also update the profileResolver callback type, which is typically implemented by LocalBackend extensions,
to return an ipn.LoginProfileView instead of ipn.ProfileID and ipn.WindowsUserID.

Updates tailscale/corp#27645
Updates tailscale/corp#18342

Signed-off-by: Nick Khyl <nickk@tailscale.com>
8 months ago
..
auditlog cmd/tailscaled,ipn/{auditlog,ipnlocal},tsd: omit auditlog unless explicitly imported 8 months ago
conffile ipn/conffile: don't depend on hujson on iOS/Android 1 year ago
desktop various: keep tailscale connected when Always On mode is enabled on Windows 10 months ago
ipnauth control/controlclient, ipn: add client audit logging (#14950) 9 months ago
ipnlocal ipn, ipn/ipnlocal: reduce coupling between LocalBackend/profileManager and the Windows-specific "current user" model 8 months ago
ipnserver ipn/ipnserver: treat all plan9 safesocket connections as permitted 8 months ago
ipnstate 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