feat: removing matchmap from headscale

This commit is contained in:
Adrien Raffin-Caboisse 2022-02-22 20:58:08 +01:00
parent 0191ea93ff
commit 717250adb3
3 changed files with 0 additions and 20 deletions

1
app.go
View File

@ -110,7 +110,6 @@ type OIDCConfig struct {
Issuer string Issuer string
ClientID string ClientID string
ClientSecret string ClientSecret string
MatchMap map[string]string
} }
type DERPConfig struct { type DERPConfig struct {

View File

@ -10,7 +10,6 @@ import (
"net/url" "net/url"
"os" "os"
"path/filepath" "path/filepath"
"regexp"
"strconv" "strconv"
"strings" "strings"
"time" "time"
@ -356,8 +355,6 @@ func getHeadscaleApp() (*headscale.Headscale, error) {
cfg := getHeadscaleConfig() cfg := getHeadscaleConfig()
cfg.OIDC.MatchMap = loadOIDCMatchMap()
app, err := headscale.NewHeadscale(cfg) app, err := headscale.NewHeadscale(cfg)
if err != nil { if err != nil {
return nil, err return nil, err
@ -514,18 +511,6 @@ func (tokenAuth) RequireTransportSecurity() bool {
return true 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 { func GetFileMode(key string) fs.FileMode {
modeStr := viper.GetString(key) modeStr := viper.GetString(key)

View File

@ -180,7 +180,3 @@ unix_socket_permission: "0770"
# client_id: "your-oidc-client-id" # client_id: "your-oidc-client-id"
# client_secret: "your-oidc-client-secret" # 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