Skip to content

Package: HttpAuthenticationMechanismWrapper

HttpAuthenticationMechanismWrapper

nameinstructionbranchcomplexitylinemethod
HttpAuthenticationMechanismWrapper()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
HttpAuthenticationMechanismWrapper(HttpAuthenticationMechanism)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
cleanSubject(HttpServletRequest, HttpServletResponse, HttpMessageContext)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getWrapped()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
secureResponse(HttpServletRequest, HttpServletResponse, HttpMessageContext)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
validateRequest(HttpServletRequest, HttpServletResponse, HttpMessageContext)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2021 Contributors to Eclipse Foundation.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16: package jakarta.security.enterprise.authentication.mechanism.http;
17:
18: import jakarta.security.enterprise.AuthenticationException;
19: import jakarta.security.enterprise.AuthenticationStatus;
20: import jakarta.servlet.http.HttpServletRequest;
21: import jakarta.servlet.http.HttpServletResponse;
22:
23: /**
24: * This class is an implementation of the <code>HttpAuthenticationMechanism</code> interface that
25: * can be subclassed by developers wishing to provide extra or different
26: * functionality.
27: * <p>
28: * All methods default to calling the wrapped object.
29: *
30: * @since 3.0
31: */
32: public class HttpAuthenticationMechanismWrapper implements HttpAuthenticationMechanism {
33:
34: private final HttpAuthenticationMechanism httpAuthenticationMechanism;
35:
36: /**
37: * This constructor is intended for proxy usuage only.
38: */
39: public HttpAuthenticationMechanismWrapper() {
40: httpAuthenticationMechanism = null;
41: }
42:
43: /**
44: * Constructs the wrapper with the object being delegated to.
45: * @param httpAuthenticationMechanism The wrapped object which all methods call.
46: */
47: public HttpAuthenticationMechanismWrapper(HttpAuthenticationMechanism httpAuthenticationMechanism) {
48: this.httpAuthenticationMechanism = httpAuthenticationMechanism;
49: }
50:
51: /**
52: * Returns the object that's being wrapped.
53: *
54: * @return the object that's being wrapped.
55: */
56: public HttpAuthenticationMechanism getWrapped() {
57: return httpAuthenticationMechanism;
58: }
59:
60: @Override
61: public AuthenticationStatus validateRequest(HttpServletRequest request, HttpServletResponse response,
62: HttpMessageContext httpMessageContext) throws AuthenticationException {
63: return getWrapped().validateRequest(request, response, httpMessageContext);
64: }
65:
66: @Override
67: public AuthenticationStatus secureResponse(HttpServletRequest request, HttpServletResponse response,
68: HttpMessageContext httpMessageContext) throws AuthenticationException {
69: return getWrapped().secureResponse(request, response, httpMessageContext);
70: }
71:
72: @Override
73: public void cleanSubject(HttpServletRequest request, HttpServletResponse response, HttpMessageContext httpMessageContext) {
74: getWrapped().cleanSubject(request, response, httpMessageContext);
75: }
76:
77: }