mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-25 01:07:52 +00:00
feat: removing matchmap from headscale
This commit is contained in:
parent
0191ea93ff
commit
717250adb3
1
app.go
1
app.go
@ -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 {
|
||||||
|
@ -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)
|
||||||
|
|
||||||
|
@ -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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user