From a98aa89fbbb7b32f455b26afcef00acd765607cc Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Fri, 23 Sep 2022 14:22:42 +0000 Subject: [PATCH] Allow tagged nodes to authenticate Needs testing. A lot of testing. Signed-off-by: Xe --- module.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/module.go b/module.go index a22a4bf..5b62690 100644 --- a/module.go +++ b/module.go @@ -1,7 +1,6 @@ package tscaddy import ( - "fmt" "log" "net" "net/http" @@ -146,7 +145,8 @@ func (ta TailscaleAuth) Authenticate(w http.ResponseWriter, r *http.Request) (ca } if len(info.Node.Tags) != 0 { - return user, false, fmt.Errorf("node %s has tags", info.Node.Hostinfo.Hostname()) + info.UserProfile.LoginName = strings.Replace(info.Node.Tags[0], ":", "___", -1) + "@tags.in.your.tailnet" + info.UserProfile.DisplayName = "A tagged node with tags: " + strings.Join(info.Node.Tags, ", ") } var tailnet string