Skip to content

Commit a98aa89

Browse files
author
Xe Iaso
committed
Allow tagged nodes to authenticate
Needs testing. A lot of testing. Signed-off-by: Xe <[email protected]>
1 parent 56b8849 commit a98aa89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

module.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package tscaddy
22

33
import (
4-
"fmt"
54
"log"
65
"net"
76
"net/http"
@@ -146,7 +145,8 @@ func (ta TailscaleAuth) Authenticate(w http.ResponseWriter, r *http.Request) (ca
146145
}
147146

148147
if len(info.Node.Tags) != 0 {
149-
return user, false, fmt.Errorf("node %s has tags", info.Node.Hostinfo.Hostname())
148+
info.UserProfile.LoginName = strings.Replace(info.Node.Tags[0], ":", "___", -1) + "@tags.in.your.tailnet"
149+
info.UserProfile.DisplayName = "A tagged node with tags: " + strings.Join(info.Node.Tags, ", ")
150150
}
151151

152152
var tailnet string

0 commit comments

Comments
 (0)