From 327ebaf36e7972d09e84c62eb30e71ce920e6430 Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 6 Dec 2023 13:13:15 +0800 Subject: [PATCH] [ISSUE #10752] Fix Prometheus sd api security is not compatiable with nacos original security configs (#11470) * fix issue #10752 * fix issue #10752 --- .../alibaba/nacos/prometheus/filter/PrometheusAuthFilter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prometheus/src/main/java/com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.java b/prometheus/src/main/java/com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.java index 7f1dd5ee536..149af31cb24 100644 --- a/prometheus/src/main/java/com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.java +++ b/prometheus/src/main/java/com/alibaba/nacos/prometheus/filter/PrometheusAuthFilter.java @@ -16,6 +16,8 @@ package com.alibaba.nacos.prometheus.filter; +import com.alibaba.nacos.plugin.auth.constant.Constants; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -35,6 +37,7 @@ * @author vividfish */ @Configuration +@ConditionalOnProperty(value = Constants.Auth.NACOS_CORE_AUTH_ENABLED, havingValue = "true") public class PrometheusAuthFilter { @Bean