Alon Bar-Lev has posted comments on this change. Change subject: aaa: Intorduce filters ......................................................................
Patch Set 3: (3 comments) http://gerrit.ovirt.org/#/c/28022/3/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 46: VdcQueryParametersBase parameters = new VdcQueryParametersBase(); Line 47: parameters.setSessionId(engineSession); Line 48: httpSession.setAttribute("authenticated", Line 49: backend.runPublicQuery(VdcQueryType.ValidateSession, parameters).getSucceeded()); Line 50: ctx.close(); no need Line 51: chain.doFilter(request, response); Line 52: } catch (Exception ex) { Line 53: log.error(String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage())); Line 54: if (log.isDebugEnabled()) { Line 47: parameters.setSessionId(engineSession); Line 48: httpSession.setAttribute("authenticated", Line 49: backend.runPublicQuery(VdcQueryType.ValidateSession, parameters).getSucceeded()); Line 50: ctx.close(); Line 51: chain.doFilter(request, response); please move it outside of of try/catch and have the same, removing the above doFilter and call this once after our logic. Line 52: } catch (Exception ex) { Line 53: log.error(String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage())); Line 54: if (log.isDebugEnabled()) { Line 55: log.debug("", ex); Line 53: log.error(String.format("An error has occurred while session validation. Message is %1$s", ex.getMessage())); Line 54: if (log.isDebugEnabled()) { Line 55: log.debug("", ex); Line 56: } Line 57: ((HttpServletResponse) response).setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); this should be done only if our filter fails, not if doFilter raises an exception in my opinion. Line 58: Line 59: } finally { Line 60: try { Line 61: ctx.close(); -- 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: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Juan Hernandez <juan.hernan...@redhat.com> Gerrit-Reviewer: Oved Ourfali <oourf...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches