Alon Bar-Lev has posted comments on this change. Change subject: aaa: Intorduce filters ......................................................................
Patch Set 2: (7 comments) please submit patches when you actually use the new artifacts... :) anyhow, some trivial comments. http://gerrit.ovirt.org/#/c/28022/2/backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SessionValidationFilter.java File backend/manager/modules/aaa/src/main/java/org/ovirt/engine/core/aaa/SessionValidationFilter.java: Line 22: Line 23: Line 24: @Override Line 25: public void init(FilterConfig filterConfig) throws ServletException { Line 26: } not sure you must override that Line 27: Line 28: @Override Line 29: public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, Line 30: ServletException { Line 29: public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, Line 30: ServletException { Line 31: HttpSession httpSession = ((HttpServletRequest) request).getSession(); Line 32: String engineSession = (String) httpSession.getAttribute(ENGINE_SESSION_ID_KEY); Line 33: boolean authenticated = false; no need for this variable Line 34: if (engineSession == null) { Line 35: chain.doFilter(request, response); Line 36: } else { Line 37: try { Line 41: parameters.setSessionId(engineSession); Line 42: if (backend.runPublicQuery(VdcQueryType.ValidateSession, parameters).getSucceeded()) { Line 43: authenticated = true; Line 44: } Line 45: ctx.close(); this should be in finally Line 46: httpSession.setAttribute("authenticated", authenticated); Line 47: chain.doFilter(request, response); Line 48: Line 49: } catch (Exception ex) { Line 42: if (backend.runPublicQuery(VdcQueryType.ValidateSession, parameters).getSucceeded()) { Line 43: authenticated = true; Line 44: } Line 45: ctx.close(); Line 46: httpSession.setAttribute("authenticated", authenticated); no need for authenticated, just set it directory with the getSucceeded. Line 47: chain.doFilter(request, response); Line 48: Line 49: } catch (Exception ex) { Line 50: Line 43: authenticated = true; Line 44: } Line 45: ctx.close(); Line 46: httpSession.setAttribute("authenticated", authenticated); Line 47: chain.doFilter(request, response); perform the doFilter post the try/catch Line 48: Line 49: } catch (Exception ex) { Line 50: Line 51: } Line 47: chain.doFilter(request, response); Line 48: Line 49: } catch (Exception ex) { Line 50: Line 51: } do not swallow excpetions Line 52: } Line 53: } Line 54: Line 55: @Override Line 53: } Line 54: Line 55: @Override Line 56: public void destroy() { Line 57: } not sure you must override this Line 58: -- To view, visit http://gerrit.ovirt.org/28022 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5536d123b6407acf41b6946dde796bd67d1e073 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: Alon Bar-Lev <[email protected]> Gerrit-Reviewer: Juan Hernandez <[email protected]> Gerrit-Reviewer: Oved Ourfali <[email protected]> Gerrit-Reviewer: Yair Zaslavsky <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
