This feature had never been documented anyway and is considered bad security
practice nowadays.
Fixes: #16785
Signed-off-by: Miod Vallat <miod.vallat@powerdns.com>
}
}
- if !auth_ok && !ctx.api_ch.is_null() {
- if let Some(pw) = ctx.api_ch.as_ref() {
- for kv in &request.vars {
- cxx::let_cxx_string!(s = &kv.value);
- if kv.key == "api-key" && pw.matches(&s) {
- auth_ok = true;
- break;
- }
- }
- }
- }
-
if !auth_ok && allow_password {
auth_ok = compare_authorization(ctx, reqheaders);
if !auth_ok {
throw HttpUnauthorizedException("X-API-Key");
}
- bool auth_ok = req->compareHeader("x-api-key", *d_apikey) || d_apikey->matches(req->getvars["api-key"]);
+ bool auth_ok = req->compareHeader("x-api-key", *d_apikey);
if (!auth_ok && allowPassword) {
if (d_webserverPassword) {