diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunction.java b/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunction.java index 4d52495b..5fa281f6 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunction.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunction.java @@ -19,13 +19,13 @@ package org.wso2.carbon.identity.conditional.auth.functions.utils; /** - * Function to mask the given value if log masking is enabled. + * Function to mask the given value. */ @FunctionalInterface public interface GetMaskedValueFunction { /** - * Masks the given value if log masking is enabled. + * Masks the given value. * * @param value The value to be masked. * @return The masked value. diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImpl.java b/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImpl.java index 869dc0e3..d71a29fc 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImpl.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/main/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImpl.java @@ -30,6 +30,6 @@ public class GetMaskedValueFunctionImpl implements GetMaskedValueFunction { @HostAccess.Export public String getMaskedValue(String value) { - return LoggerUtils.isLogMaskingEnable ? LoggerUtils.getMaskedContent(value) : value; + return LoggerUtils.getMaskedContent(value); } } diff --git a/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImplTest.java b/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImplTest.java index 75dda085..39178708 100644 --- a/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImplTest.java +++ b/components/org.wso2.carbon.identity.conditional.auth.functions.utils/src/test/java/org/wso2/carbon/identity/conditional/auth/functions/utils/GetMaskedValueFunctionImplTest.java @@ -82,9 +82,13 @@ public void testGetMaskedValue(boolean isLogMaskingEnabled, String username, Str @DataProvider(name = "maskableValueProvider") public Object[][] maskableValueProvider() { + /* + The "getMaskedValue" method should always mask the passed in value + irrespective of the server-wide 'isLogMaskingEnable' configuration. + */ return new Object[][]{ {true, "johndoe", "j*****e"}, - {false, "johndoe", "johndoe"}, + {false, "johndoe", "j*****e"}, }; } }