Loading cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java +11 −11 Original line number Diff line number Diff line Loading @@ -145,9 +145,9 @@ public interface UserPersistence TransientException, AccessControlException; /** * Get the user specified by userID whose account is pending approval. * Get the user with the specified Principal whose account is pending approval. * * @param userID The userID. * @param userID A Principal of the User. * * @return User instance. * Loading @@ -160,9 +160,9 @@ public interface UserPersistence AccessControlException; /** * Get the user specified by userID with all of the users identities. * Get the user with the specified Principal with all of the users identities. * * @param userID The userID. * @param userID A Principal of the User. * * @return User instance. * Loading Loading @@ -195,10 +195,10 @@ public interface UserPersistence throws TransientException, AccessControlException; /** * Move the pending user specified by userID from the * Move the pending user with the specified Principal from the * pending users tree to the active users tree. * * @param userID The userID. * @param userID A Principal of the User. * * @return User instance. * Loading @@ -211,7 +211,7 @@ public interface UserPersistence AccessControlException; /** * Update the user specified by userID in the active users tree. * Update the user with the specified Principal in the active users tree. * * @param user The user instance to modify. * Loading @@ -226,9 +226,9 @@ public interface UserPersistence AccessControlException; /** * Delete the user specified by userID from the active users tree. * Delete the user with the specified Principal from the active users tree. * * @param userID The userID. * @param userID A Principal of the User. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. Loading @@ -239,9 +239,9 @@ public interface UserPersistence AccessControlException; /** * Delete the user specified by userID from the pending users tree. * Delete the user with the specified Principal from the pending users tree. * * @param userID The userID. * @param userID A Principal of the User. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. Loading cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupDAO.java +1 −1 Original line number Diff line number Diff line Loading @@ -500,7 +500,7 @@ public class LdapGroupDAO extends LdapDAO DN memberDN = new DN(member); if (memberDN.isDescendantOf(config.getUsersDN(), false)) { User<X500Principal> user; User user; try { user = userDAO.getX500User(memberDN); Loading cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java +4 −4 Original line number Diff line number Diff line Loading @@ -174,8 +174,8 @@ public class LdapGroupPersistence extends LdapPersistence implements GroupPersis GroupNotFoundException { Subject caller = AuthenticationUtil.getCurrentSubject(); User owner = getUser(caller); group.setOwner(owner); // Principal owner = getUser(caller); // group.setOwner(owner); LdapConnections conns = new LdapConnections(this); try Loading Loading @@ -382,7 +382,7 @@ public class LdapGroupPersistence extends LdapPersistence implements GroupPersis return ds.iterator().next(); } private User getUser(Subject caller) private Principal getUser(Subject caller) { if (caller == null || AuthMethod.ANON.equals(AuthenticationUtil.getAuthMethod(caller))) throw new AccessControlException("Caller is not authenticated"); Loading @@ -391,6 +391,6 @@ public class LdapGroupPersistence extends LdapPersistence implements GroupPersis if (gset == null || gset.isEmpty()) throw new RuntimeException("BUG: no GroupMemberships cache in Subject"); GroupMemberships gms = gset.iterator().next(); return gms.getUser(); return gms.getUserID(); } } cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserDAO.java +215 −138 File changed.Preview size limit exceeded, changes collapsed. Show changes cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +4 −5 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Update a user's password. The given user and authenticating user must match. * * @param user * @param userID the user. * @param oldPassword current password. * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. Loading Loading @@ -510,8 +510,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Reset a user's password. The given user and authenticating user must match. * * @param user * @param oldPassword current password. * @param userID The user. * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. * @throws TransientException If an temporary, unexpected problem occurred. Loading Loading @@ -559,14 +558,14 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste return false; } private boolean isMatch(Subject caller, Principal userID) private boolean isMatch(Subject caller, Principal identity) { if (caller == null || AuthMethod.ANON.equals(AuthenticationUtil.getAuthMethod(caller))) throw new AccessControlException("Caller is not authenticated"); for (Principal pc : caller.getPrincipals()) { if (AuthenticationUtil.equals(pc, userID)) if (AuthenticationUtil.equals(pc, identity)) return true; } return false; Loading Loading
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/UserPersistence.java +11 −11 Original line number Diff line number Diff line Loading @@ -145,9 +145,9 @@ public interface UserPersistence TransientException, AccessControlException; /** * Get the user specified by userID whose account is pending approval. * Get the user with the specified Principal whose account is pending approval. * * @param userID The userID. * @param userID A Principal of the User. * * @return User instance. * Loading @@ -160,9 +160,9 @@ public interface UserPersistence AccessControlException; /** * Get the user specified by userID with all of the users identities. * Get the user with the specified Principal with all of the users identities. * * @param userID The userID. * @param userID A Principal of the User. * * @return User instance. * Loading Loading @@ -195,10 +195,10 @@ public interface UserPersistence throws TransientException, AccessControlException; /** * Move the pending user specified by userID from the * Move the pending user with the specified Principal from the * pending users tree to the active users tree. * * @param userID The userID. * @param userID A Principal of the User. * * @return User instance. * Loading @@ -211,7 +211,7 @@ public interface UserPersistence AccessControlException; /** * Update the user specified by userID in the active users tree. * Update the user with the specified Principal in the active users tree. * * @param user The user instance to modify. * Loading @@ -226,9 +226,9 @@ public interface UserPersistence AccessControlException; /** * Delete the user specified by userID from the active users tree. * Delete the user with the specified Principal from the active users tree. * * @param userID The userID. * @param userID A Principal of the User. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. Loading @@ -239,9 +239,9 @@ public interface UserPersistence AccessControlException; /** * Delete the user specified by userID from the pending users tree. * Delete the user with the specified Principal from the pending users tree. * * @param userID The userID. * @param userID A Principal of the User. * * @throws UserNotFoundException when the user is not found. * @throws TransientException If an temporary, unexpected problem occurred. Loading
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupDAO.java +1 −1 Original line number Diff line number Diff line Loading @@ -500,7 +500,7 @@ public class LdapGroupDAO extends LdapDAO DN memberDN = new DN(member); if (memberDN.isDescendantOf(config.getUsersDN(), false)) { User<X500Principal> user; User user; try { user = userDAO.getX500User(memberDN); Loading
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupPersistence.java +4 −4 Original line number Diff line number Diff line Loading @@ -174,8 +174,8 @@ public class LdapGroupPersistence extends LdapPersistence implements GroupPersis GroupNotFoundException { Subject caller = AuthenticationUtil.getCurrentSubject(); User owner = getUser(caller); group.setOwner(owner); // Principal owner = getUser(caller); // group.setOwner(owner); LdapConnections conns = new LdapConnections(this); try Loading Loading @@ -382,7 +382,7 @@ public class LdapGroupPersistence extends LdapPersistence implements GroupPersis return ds.iterator().next(); } private User getUser(Subject caller) private Principal getUser(Subject caller) { if (caller == null || AuthMethod.ANON.equals(AuthenticationUtil.getAuthMethod(caller))) throw new AccessControlException("Caller is not authenticated"); Loading @@ -391,6 +391,6 @@ public class LdapGroupPersistence extends LdapPersistence implements GroupPersis if (gset == null || gset.isEmpty()) throw new RuntimeException("BUG: no GroupMemberships cache in Subject"); GroupMemberships gms = gset.iterator().next(); return gms.getUser(); return gms.getUserID(); } }
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserDAO.java +215 −138 File changed.Preview size limit exceeded, changes collapsed. Show changes
cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapUserPersistence.java +4 −5 Original line number Diff line number Diff line Loading @@ -476,7 +476,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Update a user's password. The given user and authenticating user must match. * * @param user * @param userID the user. * @param oldPassword current password. * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. Loading Loading @@ -510,8 +510,7 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste /** * Reset a user's password. The given user and authenticating user must match. * * @param user * @param oldPassword current password. * @param userID The user. * @param newPassword new password. * @throws UserNotFoundException If the given user does not exist. * @throws TransientException If an temporary, unexpected problem occurred. Loading Loading @@ -559,14 +558,14 @@ public class LdapUserPersistence extends LdapPersistence implements UserPersiste return false; } private boolean isMatch(Subject caller, Principal userID) private boolean isMatch(Subject caller, Principal identity) { if (caller == null || AuthMethod.ANON.equals(AuthenticationUtil.getAuthMethod(caller))) throw new AccessControlException("Caller is not authenticated"); for (Principal pc : caller.getPrincipals()) { if (AuthenticationUtil.equals(pc, userID)) if (AuthenticationUtil.equals(pc, identity)) return true; } return false; Loading