mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-23 09:06:24 +00:00
tsnet,internal/client/tailscale: resolve OAuth into authkeys in tsnet (#17191)
* tsnet,internal/client/tailscale: resolve OAuth into authkeys in tsnet Updates #8403. * internal/client/tailscale: omit OAuth library via build tag Updates #12614. Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
@@ -29,9 +29,11 @@ import (
|
||||
"tailscale.com/client/local"
|
||||
"tailscale.com/control/controlclient"
|
||||
"tailscale.com/envknob"
|
||||
_ "tailscale.com/feature/condregister/oauthkey"
|
||||
_ "tailscale.com/feature/condregister/portmapper"
|
||||
"tailscale.com/health"
|
||||
"tailscale.com/hostinfo"
|
||||
"tailscale.com/internal/client/tailscale"
|
||||
"tailscale.com/ipn"
|
||||
"tailscale.com/ipn/ipnauth"
|
||||
"tailscale.com/ipn/ipnlocal"
|
||||
@@ -680,6 +682,14 @@ func (s *Server) start() (reterr error) {
|
||||
prefs.RunWebClient = s.RunWebClient
|
||||
prefs.AdvertiseTags = s.AdvertiseTags
|
||||
authKey := s.getAuthKey()
|
||||
// Try to use an OAuth secret to generate an auth key if that functionality
|
||||
// is available.
|
||||
if f, ok := tailscale.HookResolveAuthKey.GetOk(); ok {
|
||||
authKey, err = f(s.shutdownCtx, s.getAuthKey(), prefs.AdvertiseTags)
|
||||
if err != nil {
|
||||
return fmt.Errorf("resolving auth key: %w", err)
|
||||
}
|
||||
}
|
||||
err = lb.Start(ipn.Options{
|
||||
UpdatePrefs: prefs,
|
||||
AuthKey: authKey,
|
||||
|
||||
Reference in New Issue
Block a user