Skip to content

Commit

Permalink
Allow tagged nodes to authenticate
Browse files Browse the repository at this point in the history
Needs testing. A lot of testing.

Signed-off-by: Xe <me@christine.website>
  • Loading branch information
Xe Iaso committed Sep 23, 2022
1 parent 56b8849 commit a98aa89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package tscaddy

import (
"fmt"
"log"
"net"
"net/http"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a98aa89

Please sign in to comment.