This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 7.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 739fa611e9175632278c24585a2792923a7c9e9b Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Jun 28 09:22:40 2019 +0100 Align with 8.5.x. Clean-up --- java/org/apache/catalina/Authenticator.java | 12 ++--- .../catalina/authenticator/AuthenticatorBase.java | 56 ++++++---------------- 2 files changed, 21 insertions(+), 47 deletions(-) diff --git a/java/org/apache/catalina/Authenticator.java b/java/org/apache/catalina/Authenticator.java index 871d471..c49850d 100644 --- a/java/org/apache/catalina/Authenticator.java +++ b/java/org/apache/catalina/Authenticator.java @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina; import java.io.IOException; @@ -33,19 +31,21 @@ import org.apache.catalina.deploy.LoginConfig; * * @author Craig R. McClanahan */ - public interface Authenticator { /** * Authenticate the user making this request, based on the login * configuration of the {@link Context} with which this Authenticator is - * associated. Return <code>true</code> if any specified constraint has - * been satisfied, or <code>false</code> if we have created a response - * challenge already. + * associated. * * @param request Request we are processing * @param response Response we are populating * + * @return <code>true</code> if any specified constraints have been + * satisfied, or <code>false</code> if one more constraints were not + * satisfied (in which case an authentication challenge will have + * been written to the response). + * * @exception IOException if an input/output error occurs */ public boolean authenticate(Request request, HttpServletResponse response) diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java b/java/org/apache/catalina/authenticator/AuthenticatorBase.java index e67cd20..1011bbb 100644 --- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java +++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java @@ -550,6 +550,21 @@ public abstract class AuthenticatorBase extends ValveBase } + @Override + public boolean authenticate(Request request, HttpServletResponse httpResponse) + throws IOException { + if (context == null || context.getLoginConfig() == null) { + return true; + } + return authenticate(request, httpResponse, context.getLoginConfig()); + } + + + @Override + public abstract boolean authenticate(Request request, HttpServletResponse response, + LoginConfig config) throws IOException; + + // ------------------------------------------------------ Protected Methods /** @@ -616,47 +631,6 @@ public abstract class AuthenticatorBase extends ValveBase /** - * Authenticate the user making this request, based on the login - * configuration of the {@link Context} with which this Authenticator is - * associated. Return <code>true</code> if any specified constraint has - * been satisfied, or <code>false</code> if we have created a response - * challenge already. - * - * @param request Request we are processing - * @param response Response we are populating - * - * @exception IOException if an input/output error occurs - */ - @Override - public boolean authenticate(Request request, HttpServletResponse response) - throws IOException { - if (context == null || context.getLoginConfig() == null) { - return true; - } - return authenticate(request, response, context.getLoginConfig()); - } - - /** - * Authenticate the user making this request, based on the specified - * login configuration. Return <code>true</code> if any specified - * constraint has been satisfied, or <code>false</code> if we have - * created a response challenge already. - * - * @param request Request we are processing - * @param response Response we are populating - * @param config Login configuration describing how authentication - * should be performed - * - * @exception IOException if an input/output error occurs - */ - @Override - public abstract boolean authenticate(Request request, - HttpServletResponse response, - LoginConfig config) - throws IOException; - - - /** * Check to see if the user has already been authenticated earlier in the * processing chain or if there is enough information available to * authenticate the user without requiring further user interaction. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org