Class UGSubsystem
java.lang.Object
com.netscape.cmscore.usrgrp.UGSubsystem
This class defines low-level LDAP usr/grp management
usr/grp information is located remotely on another
LDAP server.
- Version:
- $Revision$, $Date$
- Author:
- thomask, cfu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringstatic org.slf4j.Loggerprotected Stringprotected static final Stringprotected LdapBoundConnFactoryprotected static final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a group of identities.voidaddSeeAlso(String userID, String value) voidAdds identity.voidaddUserCert(String userID, X509Certificate cert) adds a user certificate to uservoidaddUserToGroup(Group grp, String userid) protected GroupbuildGroup(netscape.ldap.LDAPEntry entry) builds an instance of a Group entryprotected Enumeration<Group> buildGroups(netscape.ldap.LDAPSearchResults res) protected UserbuildUser(netscape.ldap.LDAPEntry entry) builds a User instance.protected Enumeration<User> buildUsers(netscape.ldap.LDAPSearchResults res) protected StringconvertUIDtoDN(String uid) Converts an uid attribute to a DN.createGroup(String id) createUser(String id) booleanEvalutes the given context with the attribute critieria.findGroups(String filter) Finds groups.findGroupsByUser(String userDn, String filter) findUser(X509Certificate cert) Locates a user by certificate.findUsersByCert(String filter) Searchs for identities that matches the certificate locater generated filter.findUsersByKeyword(String keyword) Searchs for identities that matches the filter.protected StringConverts certificate into string format.protected netscape.ldap.LDAPConnectiongetConn()Retrieves a group from LDAP NOTE - LH This takes a full LDAP DN.getGroupFromName(String name) Retrieves a group from LDAP NOTE - this takes just the group name.Retrieves a user from LDAPvoidinit(PKISocketConfig socketConfig, UGSubsystemConfig config, IPasswordStore passwordStore) booleanisGroupPresent(String name) Checks if the given group existsprotected booleanChecks if the given DNs are the same after normalization.booleanisMemberOf(User id, String name) Checks if the given user is a member of the given group (now runs an ldap search to find the user, instead of fetching the entire group entry)booleanisMemberOf(String userid, String groupname) protected booleanisMemberOfLdapGroup(String userid, String groupname) checks if the given user DN is in the specified group by running an ldap search for the user in the groupprotected UserlbuildUser(netscape.ldap.LDAPEntry entry) builds a User instance.protected Enumeration<User> lbuildUsers(netscape.ldap.LDAPSearchResults res) listGroups(String filter) List groups.Searchs for identities that matches the filter.voidmodifyGroup(Group group) Modifies an existing group in the database.voidmodifyUser(User identity) modifies user attributes.voidremoveGroup(String name) Removes a group.voidremoveSeeAlso(String userID, String value) voidremoveUser(String userid) Removes identity.voidremoveUserCert(User identity) Removes a user certificate for a user entry given a user certificate DN (actually, a combination of version, serialNumber, issuerDN, and SubjectDN), and it gets removedvoidremoveUserFromGroup(Group grp, String userid) protected voidreturnConn(netscape.ldap.LDAPConnection conn) voidshutdown()Disconnects usr/grp manager from the LDAP
-
Field Details
-
logger
public static org.slf4j.Logger logger -
SUPER_CERT_ADMINS
- See Also:
-
OBJECTCLASS_ATTR
- See Also:
-
MEMBER_ATTR
- See Also:
-
GROUP_ATTR_VALUE
- See Also:
-
LDAP_ATTR_USER_CERT_STRING
- See Also:
-
LDAP_ATTR_CERTDN
- See Also:
-
LDAP_ATTR_USER_CERT
- See Also:
-
LDAP_ATTR_PROFILE_ID
- See Also:
-
mLdapConnFactory
-
mBaseDN
-
-
Constructor Details
-
UGSubsystem
public UGSubsystem()Constructs LDAP based usr/grp management
-
-
Method Details
-
init
public void init(PKISocketConfig socketConfig, UGSubsystemConfig config, IPasswordStore passwordStore) throws Exception - Throws:
Exception
-
shutdown
public void shutdown()Disconnects usr/grp manager from the LDAP -
createUser
-
createGroup
-
getUser
Retrieves a user from LDAP- Throws:
EUsrGrpException
-
findUser
Locates a user by certificate.- Throws:
EUsrGrpException
-
findUsersByCert
Searchs for identities that matches the certificate locater generated filter.- Throws:
EUsrGrpException
-
findUsersByKeyword
Searchs for identities that matches the filter.- Throws:
EUsrGrpException
-
findUsers
- Throws:
EUsrGrpException
-
listUsers
Searchs for identities that matches the filter. retrieves uid only, for efficiency of user listing- Throws:
EUsrGrpException
-
lbuildUsers
protected Enumeration<User> lbuildUsers(netscape.ldap.LDAPSearchResults res) throws EUsrGrpException - Throws:
EUsrGrpException
-
buildUsers
- Throws:
EUsrGrpException
-
lbuildUser
builds a User instance. Sets only uid for user entry retrieved from LDAP server. for listing efficiency only.- Returns:
- the User entity.
- Throws:
EUsrGrpException
-
buildUser
builds a User instance. Set all attributes retrieved from LDAP server and set them on User.- Returns:
- the User entity.
- Throws:
EUsrGrpException
-
addUser
Adds identity. Certificates handled by a separate call to addUserCert()- Throws:
EUsrGrpException
-
addUserCert
adds a user certificate to user- Throws:
EUsrGrpException
-
addSeeAlso
- Throws:
EUsrGrpException
-
removeSeeAlso
- Throws:
EUsrGrpException
-
removeUserCert
Removes a user certificate for a user entry given a user certificate DN (actually, a combination of version, serialNumber, issuerDN, and SubjectDN), and it gets removed- Throws:
EUsrGrpException
-
addUserToGroup
- Throws:
EUsrGrpException
-
removeUserFromGroup
- Throws:
EUsrGrpException
-
removeUser
Removes identity.- Throws:
EUsrGrpException
-
modifyUser
modifies user attributes. Certs are handled separately- Throws:
EUsrGrpException
-
buildGroups
protected Enumeration<Group> buildGroups(netscape.ldap.LDAPSearchResults res) throws EUsrGrpException - Throws:
EUsrGrpException
-
findGroups
Finds groups.- Throws:
EUsrGrpException
-
findGroup
- Throws:
EUsrGrpException
-
listGroups
List groups. more efficient than find Groups. only retrieves group names and description.- Throws:
EUsrGrpException
-
findGroupsByUser
- Throws:
EUsrGrpException
-
buildGroup
builds an instance of a Group entry- Throws:
EUsrGrpException
-
getGroupFromName
-
getGroup
-
isGroupPresent
Checks if the given group exists -
isMemberOf
-
isMemberOf
-
isMemberOfLdapGroup
-
addGroup
Adds a group of identities.- Throws:
EUsrGrpException
-
removeGroup
Removes a group. Can't remove SUPER_CERT_ADMINS- Throws:
EUsrGrpException
-
modifyGroup
Modifies an existing group in the database.- Parameters:
group- an existing group that has been modified in memory- Throws:
EUsrGrpException
-
evaluate
-
convertUIDtoDN
-
isMatched
-
getCertificateStringWithoutVersion
Converts certificate into string format. should eventually go into the locator itself -
getCertificateString
-
getUserDN
-
getConn
- Throws:
ELdapException
-
returnConn
protected void returnConn(netscape.ldap.LDAPConnection conn)
-