From c2a7a88c0a7d401042c379aa228494a9cc47a66f Mon Sep 17 00:00:00 2001 From: Xiaobing Zhu <71206407+ZhuXiaoBing-cn@users.noreply.github.com> Date: Fri, 25 Jun 2021 14:56:18 +0800 Subject: [PATCH 1/2] * Add some warn log for deprecated properties. --- .../autoconfigure/aad/AADAuthenticationProperties.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java b/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java index 3459db0cfffbe..c95ef89f7c2b5 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java @@ -6,6 +6,8 @@ import com.azure.spring.aad.AADAuthorizationGrantType; import com.azure.spring.aad.webapp.AuthorizationClientProperties; import com.nimbusds.jose.jwk.source.RemoteJWKSet; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.InitializingBean; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; @@ -133,6 +135,8 @@ public List getActiveDirectoryGroups() { */ public static class UserGroupProperties { + private final Log logger = LogFactory.getLog(UserGroupProperties.class); + /** * Expected UserGroups that an authority will be granted to if found in the response from the MemeberOf Graph * API Call. @@ -176,6 +180,8 @@ public Boolean getEnableFullList() { } public void setEnableFullList(Boolean enableFullList) { + logger.info(" 'azure.activedirectory.user-group.enable-full-list' property is deprecated." + + " 'azure.activedirectory.user-group.allowed-group-ids: all' to instead!"); this.enableFullList = enableFullList; } @@ -190,6 +196,8 @@ public List getAllowedGroups() { @Deprecated public void setAllowedGroups(List allowedGroups) { + logger.info(" 'azure.activedirectory.user-group.allowed-groups' property is deprecated." + + " 'azure.activedirectory.user-group.allowed-group-names' to instead!"); this.allowedGroupNames = allowedGroups; } From 2f5c5f95199a2bc73c4488290b7517035217c48d Mon Sep 17 00:00:00 2001 From: Xiaobing Zhu <71206407+ZhuXiaoBing-cn@users.noreply.github.com> Date: Fri, 25 Jun 2021 15:26:04 +0800 Subject: [PATCH 2/2] * Change the warn level. * Modify deprecation description information. --- .../autoconfigure/aad/AADAuthenticationProperties.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java b/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java index c95ef89f7c2b5..1a3554ef09b82 100644 --- a/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java +++ b/sdk/spring/azure-spring-boot/src/main/java/com/azure/spring/autoconfigure/aad/AADAuthenticationProperties.java @@ -179,9 +179,10 @@ public Boolean getEnableFullList() { return enableFullList; } + @Deprecated public void setEnableFullList(Boolean enableFullList) { - logger.info(" 'azure.activedirectory.user-group.enable-full-list' property is deprecated." - + " 'azure.activedirectory.user-group.allowed-group-ids: all' to instead!"); + logger.warn(" 'azure.activedirectory.user-group.enable-full-list' property detected! " + + "Use 'azure.activedirectory.user-group.allowed-group-ids: all' instead!"); this.enableFullList = enableFullList; } @@ -196,8 +197,8 @@ public List getAllowedGroups() { @Deprecated public void setAllowedGroups(List allowedGroups) { - logger.info(" 'azure.activedirectory.user-group.allowed-groups' property is deprecated." + - " 'azure.activedirectory.user-group.allowed-group-names' to instead!"); + logger.warn(" 'azure.activedirectory.user-group.allowed-groups' property detected! " + " Use 'azure" + + ".activedirectory.user-group.allowed-group-names' instead!"); this.allowedGroupNames = allowedGroups; }