mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-02-09 15:27:11 +00:00
introduce flags to take basic auth credentials
Signed-off-by: Syed Nihal <syed.nihal@nokia.com>
This commit is contained in:
parent
1733070b37
commit
f0839dc227
1 changed files with 0 additions and 7 deletions
|
@ -443,13 +443,6 @@ func CheckAuthFlag(w http.ResponseWriter, r *http.Request, flagValue string, fla
|
|||
return CheckBasicAuth(w, r)
|
||||
}
|
||||
if r.FormValue("authKey") != flagValue {
|
||||
// Check and allow the request if the header 'X-AuthKey' matches the flagValue
|
||||
// Currently, this is only applicable for snapshotAuthKey. Below condition can be modified to remove
|
||||
// the check for flagName if 'X-AuthKey' header is to be allowed for other authKeys related flags (for instance reloadAuthKey)
|
||||
// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/5973
|
||||
if flagName == "snapshotAuthKey" && r.Header.Get("X-AuthKey") == flagValue {
|
||||
return true
|
||||
}
|
||||
authKeyRequestErrors.Inc()
|
||||
http.Error(w, fmt.Sprintf("The provided authKey doesn't match -%s", flagName), http.StatusUnauthorized)
|
||||
return false
|
||||
|
|
Loading…
Reference in a new issue