Skip to content

Commit

Permalink
feat: removing matchmap from headscale
Browse files Browse the repository at this point in the history
  • Loading branch information
restanrm committed Feb 22, 2022
1 parent 0191ea9 commit 717250a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
1 change: 0 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ type OIDCConfig struct {
Issuer string
ClientID string
ClientSecret string
MatchMap map[string]string
}

type DERPConfig struct {
Expand Down
15 changes: 0 additions & 15 deletions cmd/headscale/cli/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"net/url"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -356,8 +355,6 @@ func getHeadscaleApp() (*headscale.Headscale, error) {

cfg := getHeadscaleConfig()

cfg.OIDC.MatchMap = loadOIDCMatchMap()

app, err := headscale.NewHeadscale(cfg)
if err != nil {
return nil, err
Expand Down Expand Up @@ -514,18 +511,6 @@ func (tokenAuth) RequireTransportSecurity() bool {
return true
}

// loadOIDCMatchMap is a wrapper around viper to verifies that the keys in
// the match map is valid regex strings.
func loadOIDCMatchMap() map[string]string {
strMap := viper.GetStringMapString("oidc.domain_map")

for oidcMatcher := range strMap {
_ = regexp.MustCompile(oidcMatcher)
}

return strMap
}

func GetFileMode(key string) fs.FileMode {
modeStr := viper.GetString(key)

Expand Down
4 changes: 0 additions & 4 deletions config-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,3 @@ unix_socket_permission: "0770"
# client_id: "your-oidc-client-id"
# client_secret: "your-oidc-client-secret"
#
# # Domain map is used to map incomming users (by their email) to
# # a namespace. The key can be a string, or regex.
# domain_map:
# ".*": default-namespace

0 comments on commit 717250a

Please sign in to comment.