From 717250adb3fc8cf6a37550292caf70e5f17979a7 Mon Sep 17 00:00:00 2001 From: Adrien Raffin-Caboisse Date: Tue, 22 Feb 2022 20:58:08 +0100 Subject: [PATCH] feat: removing matchmap from headscale --- app.go | 1 - cmd/headscale/cli/utils.go | 15 --------------- config-example.yaml | 4 ---- 3 files changed, 20 deletions(-) diff --git a/app.go b/app.go index ac350ecf..020f6fc2 100644 --- a/app.go +++ b/app.go @@ -110,7 +110,6 @@ type OIDCConfig struct { Issuer string ClientID string ClientSecret string - MatchMap map[string]string } type DERPConfig struct { diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 85dcae71..f738ad37 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -10,7 +10,6 @@ import ( "net/url" "os" "path/filepath" - "regexp" "strconv" "strings" "time" @@ -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 @@ -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) diff --git a/config-example.yaml b/config-example.yaml index ba0c653f..17f556b8 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -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