Juan Hernandez has posted comments on this change.

Change subject: core: Automatic login filter
......................................................................


Patch Set 1:

(4 comments)

I think that the method isn't that complicated to follow. But I'm the author, 
what can I say. I will split it.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AutomaticLoginFilter.java
Line 37:     private static final Logger log = 
LoggerFactory.getLogger(AutomaticLoginFilter.class);
Line 38: 
Line 39:     @Override
Line 40:     public void init(FilterConfig filterConfig) throws 
ServletException {
Line 41:         // Nothing.
Done
Line 42:     }
Line 43: 
Line 44:     @Override
Line 45:     public void destroy() {


Line 42:     }
Line 43: 
Line 44:     @Override
Line 45:     public void destroy() {
Line 46:         // Nothing.
Done
Line 47:     }
Line 48: 
Line 49:     @Override
Line 50:     public void doFilter(ServletRequest req, ServletResponse rsp, 
FilterChain chain)


Line 97:         }
Line 98: 
Line 99:         // Check that the user exists in the directory associated to 
the authentication profile:
Line 100:         Directory directory = profile.getDirectory();
Line 101:         DirectoryUser directoryUser = directory.findUser(loginName);
Not likely, but I will add a check.
Line 102:         if (directoryUser == null) {
Line 103:             log.info(
Line 104:                 "Can't login user \"{}\" with authentication profile 
\"{}\" because the user doesn't exist in the " +
Line 105:                 "directory.",


Line 145:         boolean isAdmin = 
MultiLevelAdministrationHandler.isAdminUser(dbUser);
Line 146:         dbUser.setAdmin(isAdmin);
Line 147: 
Line 148:         // Attach the user to the session:
Line 149:         
SessionDataContainer.getInstance().setUser(req.getSession().getId(), dbUser);
It would be better in general, but you may find situations where an user has a 
huge amount of permissions, for example and admin of a system will thousands of 
VMs. In that case it won't make sense to have all in memory.

Note that this code is mostly copied from the LoginUserCommand, I prefer to 
leave that optimization outside of the scope of this patch.
Line 150: 
Line 151:         // Forward the request to the next filter in the chain:
Line 152:         chain.doFilter(req, rsp);
Line 153:     }


-- 
To view, visit http://gerrit.ovirt.org/21023
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I0b8cbee89b5bb96271c3706e9e75acbf2890a0b8
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Liran Zelkha <[email protected]>
Gerrit-Reviewer: Martin PeÅ™ina <[email protected]>
Gerrit-Reviewer: Ravi Nori <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[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

Reply via email to