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
James 'zofrex' Sanderson eabc62a9dd
ipn/ipnlocal: don't send LoginFinished unless auth was in progress (#17266)
Before we introduced seamless, the "blocked" state was used to track:

* Whether a login was required for connectivity, and therefore we should
  keep the engine deconfigured until that happened
* Whether authentication was in progress

"blocked" would stop authReconfig from running. We want this when a login is
required: if your key has expired we want to deconfigure the engine and keep
it down, so that you don't keep using exit nodes (which won't work because
your key has expired).

Taking the engine down while auth was in progress was undesirable, so we
don't do that with seamless renewal. However, not entering the "blocked"
state meant that we needed to change the logic for when to send
LoginFinished on the IPN bus after seeing StateAuthenticated from the
controlclient. Initially we changed the "if blocked" check to "if blocked or
seamless is enabled" which was correct in other places.

In this place however, it introduced a bug: we are sending LoginFinished
every time we see StateAuthenticated, which happens even on a down & up, or
a profile switch. This in turn made it harder for UI clients to track when
authentication is complete.

Instead we should only send it out if we were blocked (i.e. seamless is
disabled, or our key expired) or an auth was in progress.

Updates tailscale/corp#31476

Updates tailscale/corp#32645

Fixes #17363

Signed-off-by: James Sanderson <jsanderson@tailscale.com>
2 months ago
..
auditlog ipn/ipnext: remove some interface indirection to add hooks 8 months ago
conffile feature/featuretags, ipn/conffile: make HuJSON support in config files optional 3 months ago
desktop util/syspolicy: finish plumbing policyclient, add feature/syspolicy, move global impl 3 months ago
ipnauth all: use buildfeature constants in a few more places 2 months ago
ipnext feature/portlist: pull portlist service porting into extension, use eventbus 3 months ago
ipnlocal ipn/ipnlocal: don't send LoginFinished unless auth was in progress (#17266) 2 months ago
ipnserver feature/featuretags, all: add build features, use existing ones in more places 2 months ago
ipnstate cmd/tailscale, ipn/ipnstate, wgengine/magicsock: update ping output for peer relay (#16515) 5 months ago
lapitest various: allow tailscaled shutdown via LocalAPI 3 months ago
localapi feature/featuretags: make usermetrics modular 2 months ago
policy ipn,tailconfig: clean up unreleased and removed app connector service 2 years ago
store ipn/store, feature/condregister: permit callers to empty import optonal ipn stores 3 months ago
backend.go ipn: fix the string representation of an empty ipn.Notify 3 months ago
backend_test.go ipn: fix the string representation of an empty ipn.Notify 3 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 11 months ago
ipn_clone.go cmd/tailscale/cli,ipn,ipn/ipnlocal: add AutoExitNode preference for automatic exit node selection 6 months ago
ipn_test.go all: do not depend on the testing package 2 years ago
ipn_view.go util/linuxfw, feature/buildfeatures: add ts_omit_iptables to make IPTables optional 3 months ago
prefs.go all: use buildfeatures consts in a few more places 2 months ago
prefs_test.go ipn: warn about self as the exit node if backend is running (#17018) 3 months ago
serve.go cmd/tailscale/cli: revert key for web config for services to FQDN (#16627) 5 months ago
serve_test.go cmd/tailscale/cli: Add service flag to serve command (#16191) 5 months ago
store.go tailcfg: report StateEncrypted in Hostinfo (#16434) 6 months ago
store_test.go ipn/store: automatically migrate between plaintext and encrypted state (#16318) 6 months ago