mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-07 01:36:23 +08:00
fixed hard coded dns key
This commit is contained in:
@@ -187,7 +187,7 @@ func authenticateDNSToken(tokenString string) bool {
|
|||||||
if len(tokens) < 2 {
|
if len(tokens) < 2 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return tokens[1] == servercfg.GetDNSKey()
|
return len(servercfg.GetDNSKey()) > 0 && tokens[1] == servercfg.GetDNSKey()
|
||||||
}
|
}
|
||||||
|
|
||||||
func ContinueIfUserMatch(next http.Handler) http.HandlerFunc {
|
func ContinueIfUserMatch(next http.Handler) http.HandlerFunc {
|
||||||
|
@@ -277,7 +277,7 @@ func GetMasterKey() string {
|
|||||||
|
|
||||||
// GetDNSKey - gets the configured dns key of server
|
// GetDNSKey - gets the configured dns key of server
|
||||||
func GetDNSKey() string {
|
func GetDNSKey() string {
|
||||||
key := "secretkey"
|
key := ""
|
||||||
if os.Getenv("DNS_KEY") != "" {
|
if os.Getenv("DNS_KEY") != "" {
|
||||||
key = os.Getenv("DNS_KEY")
|
key = os.Getenv("DNS_KEY")
|
||||||
} else if config.Config.Server.DNSKey != "" {
|
} else if config.Config.Server.DNSKey != "" {
|
||||||
|
Reference in New Issue
Block a user