From ff8146b8040e0a7253d95aec3d7b00da405d01d1 Mon Sep 17 00:00:00 2001 From: "Badr.NassLahsen" Date: Mon, 8 May 2023 13:24:16 +0200 Subject: [PATCH] Add missing filters for customPropertySourceChain --- .../springboot/constant/ConjurConstant.java | 16 ++++++++++++++++ .../service/CustomPropertySourceChain.java | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cyberark/conjur/springboot/constant/ConjurConstant.java b/src/main/java/com/cyberark/conjur/springboot/constant/ConjurConstant.java index 9a278b62..238abdf1 100644 --- a/src/main/java/com/cyberark/conjur/springboot/constant/ConjurConstant.java +++ b/src/main/java/com/cyberark/conjur/springboot/constant/ConjurConstant.java @@ -57,4 +57,20 @@ public class ConjurConstant { * The constant SPRING_UTIL */ public static final String SPRING_UTIL = "SPRING_UTIL"; + + /** + * The constant ACTUATOR_PREFIX. + */ + public static final String ACTUATOR_PREFIX = "management"; + + /** + * The constant LOGGING_PREFIX. + */ + public static final String LOGGING_PREFIX = "logging"; + + /** + * The constant KUBERNETES_PREFIX. + */ + public static final String KUBERNETES_PREFIX = "kubernetes"; + } diff --git a/src/main/java/com/cyberark/conjur/springboot/service/CustomPropertySourceChain.java b/src/main/java/com/cyberark/conjur/springboot/service/CustomPropertySourceChain.java index 80d1b5ca..cfb109a6 100644 --- a/src/main/java/com/cyberark/conjur/springboot/service/CustomPropertySourceChain.java +++ b/src/main/java/com/cyberark/conjur/springboot/service/CustomPropertySourceChain.java @@ -56,8 +56,8 @@ public Object getProperty(String key) { if (!(key.startsWith(ConjurConstant.SPRING_VAR)) && !(key.startsWith(ConjurConstant.SERVER_VAR)) && !(key.startsWith(ConjurConstant.ERROR)) && !(key.startsWith(ConjurConstant.SPRING_UTIL)) - && !(key.startsWith(ConjurConstant.CONJUR_PREFIX))) { - + && !(key.startsWith(ConjurConstant.CONJUR_PREFIX)) && !(key.startsWith(ConjurConstant.ACTUATOR_PREFIX)) + && !(key.startsWith(ConjurConstant.LOGGING_PREFIX)) && !(key.startsWith(ConjurConstant.KUBERNETES_PREFIX))) { try { String account = ConjurConnectionManager.getAccount(secretsApi); String secretValue = secretsApi.getSecret(account, ConjurConstant.CONJUR_KIND, key);