tsnet: add Server.AdvertisedTags option

Signed-off-by: Valentin Alekseev <valentin.alekseev@gmail.com>
pull/8517/head
Valentin Alekseev 2023-07-01 16:15:14 +03:00
parent 0a86705d59
commit 2eed6538bf
1 changed files with 8 additions and 0 deletions

View File

@ -113,6 +113,13 @@ type Server struct {
// field at zero unless you know what you are doing.
Port uint16
// AdvertiseTags specifies groups that this embedded server wants to join, for
// purposes of ACL enforcement. These can be referenced from the ACL
// security policy. Note that advertising a tag doesn't guarantee that
// the control server will allow you to take on the rights for that
// tag.
AdvertiseTags []string
getCertForTesting func(*tls.ClientHelloInfo) (*tls.Certificate, error)
initOnce sync.Once
@ -567,6 +574,7 @@ func (s *Server) start() (reterr error) {
prefs.Hostname = s.hostname
prefs.WantRunning = true
prefs.ControlURL = s.ControlURL
prefs.AdvertiseTags = s.AdvertiseTags
authKey := s.getAuthKey()
err = lb.Start(ipn.Options{
UpdatePrefs: prefs,