This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new c832182 Log a warning if adding CredentialHandler to CombinedRealm c832182 is described below commit c832182c74a8e626427fdee22ca64c7be1260c25 Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Apr 20 21:28:41 2020 +0100 Log a warning if adding CredentialHandler to CombinedRealm --- java/org/apache/catalina/realm/CombinedRealm.java | 9 +++++++++ java/org/apache/catalina/realm/LocalStrings.properties | 1 + webapps/docs/changelog.xml | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/java/org/apache/catalina/realm/CombinedRealm.java b/java/org/apache/catalina/realm/CombinedRealm.java index 865120c..0a3f4f2 100644 --- a/java/org/apache/catalina/realm/CombinedRealm.java +++ b/java/org/apache/catalina/realm/CombinedRealm.java @@ -26,6 +26,7 @@ import java.util.List; import javax.management.ObjectName; import org.apache.catalina.Container; +import org.apache.catalina.CredentialHandler; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleException; import org.apache.catalina.Realm; @@ -461,4 +462,12 @@ public class CombinedRealm extends RealmBase { return true; } + + @Override + public void setCredentialHandler(CredentialHandler credentialHandler) { + // This is unusual for a CombinedRealm as it does not use + // CredentialHandlers. It might be a mis-configuration so warn the user. + log.warn(sm.getString("combinedRealm.setCredentialHandler")); + super.setCredentialHandler(credentialHandler); + } } diff --git a/java/org/apache/catalina/realm/LocalStrings.properties b/java/org/apache/catalina/realm/LocalStrings.properties index 0229e73..5b8c389 100644 --- a/java/org/apache/catalina/realm/LocalStrings.properties +++ b/java/org/apache/catalina/realm/LocalStrings.properties @@ -20,6 +20,7 @@ combinedRealm.authSuccess=Authenticated user [{0}] with realm [{1}] combinedRealm.getPassword=The getPassword() method should never be called combinedRealm.getPrincipal=The getPrincipal() method should never be called combinedRealm.realmStartFail=Failed to start [{0}] realm +combinedRealm.setCredentialHandler=A CredentialHandler was set on an instance of the CombinedRealm (or a sub-class of CombinedRealm). CombinedRealm doesn't use a configured CredentialHandler. Is this a configuration error? combinedRealm.unexpectedMethod=An unexpected call was made to a method on the combined realm credentialHandler.invalidStoredCredential=The invalid stored credential string [{0}] was provided by the Realm to match with the user provided credentials diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 398e296..50b57a9 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -60,6 +60,13 @@ Remove redundant sole path/URI from error page message on SC_NOT_FOUND. (michaelo) </update> + <add> + Log a warning if a <code>CredentialHandler</code> instance is added to + an instance of the <code>CombinedRealm</code> (or a sub-class) as the + <code>CombinedRealm</code> doesn't use a configued + <code>CredentialHandler</code> and it is likely that a configuration + error has occurred. (markt) + </add> </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org