public class LoaderLdapElUtils extends Object
| Constructor and Description |
|---|
LoaderLdapElUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
convertAdMemberDnToSpecificValue(String dn,
String baseDn,
String grouperBaseStem,
boolean idOrIdentifier)
convert a user dn to a user CN, and a group dn to a group ID or Uuid
|
static String |
convertDnToGroupName(String dn,
String baseDn,
String grouperBaseStem)
convert a DN to a group name
|
static String |
convertDnToSpecificValue(String dn)
convert from uid=someapp,ou=people,dc=myschool,dc=edu
to someapp
|
static String |
convertDnToSpecificValueOrGroup(String dn,
String groupPrefix,
String groupSuffix,
boolean createGroupIfNotThere,
boolean idOrIdentifier)
convert from uid=someapp,ou=people,dc=myschool,dc=edu to someapp and allow groups
|
static String |
convertDnToSpecificValueTest(String dn,
String subjectIdToReturnGroup,
String groupToCreateReturn)
test case showing a transformation where if the dn is the subjectIdToReturnGroup then make sure groupToCreateReturn
exists and return its ID
|
static String |
convertDnToSubPath(String dn,
String baseDn,
String searchDn)
convert from uid=someapp,ou=people,dc=myschool,dc=edu
baseDn is edu
searchDn is myschool
to people:someapp
|
static String |
convertLDAPMemberDnToSubjectIdOrGroup(String dn,
String baseOu,
String grouperBaseStem,
String serverId,
String uniqueAttribute,
boolean idOrIdentifier)
convert a subject dn to a user RDN value, and a group dn to a group ID or Uuid
|
static String |
ldapEscapeRdn(String rdnString)
This takes a string of attribute=value and makes sure that special, dn-relevant characters
are escaped, particularly commas, pluses, etc
|
static String |
ldapEscapeRdnValue(String rdnValue)
This takes a string of value and makes sure that special, dn-relevant characters
are escaped, particularly commas, pluses, etc
|
static String |
ldapFilterEscape(String s)
escape an ldap filter term
|
static void |
main(String[] args) |
static String |
normalize(String form,
String text)
take out accented chars e.g.
|
public static String ldapEscapeRdn(String rdnString)
rdnString - An RDN: attribute=valuepublic static String ldapEscapeRdnValue(String rdnValue)
rdnString - An RDN value: valuepublic static String ldapFilterEscape(String s)
s - public static void main(String[] args)
public static String normalize(String form, String text)
form - text - public static String convertDnToSpecificValue(String dn)
dn - public static String convertDnToSpecificValueOrGroup(String dn, String groupPrefix, String groupSuffix, boolean createGroupIfNotThere, boolean idOrIdentifier)
dn - full dngroupSuffix - group suffix e.g. ,OU=Groups,DC=dev,DC=umontreal,DC=cagroupPrefix - group prefix e.g. umontreal:adgroups:
if null then no prefixcreateGroupIfNotThere - if we should see if group exists and if not, createidOrIdentifier - true for Id (uuid), false for Identifier of group (name)public static String convertDnToSubPath(String dn, String baseDn, String searchDn)
dn - baseDn - if there is one, take it offsearchDn - if there is one after the baseDn is off, take it offpublic static String convertDnToSpecificValueTest(String dn, String subjectIdToReturnGroup, String groupToCreateReturn)
dn - subjectIdToReturnGroup - groupToCreateReturn - public static String convertAdMemberDnToSpecificValue(String dn, String baseDn, String grouperBaseStem, boolean idOrIdentifier)
baseDn - e.g. OU=People,DC=devsim,DC=umontreal,DC=cadn - of group membergrouperBaseStem - is the base stem where the groups go. e.g. my:groups:idOrIdentifier - true for id (group id), false for identifier (group name)public static String convertDnToGroupName(String dn, String baseDn, String grouperBaseStem)
dn - baseDn - e.g. OU=People,DC=devsim,DC=umontreal,DC=cagrouperBaseStem - is the base stem where the groups go. e.g. my:groups:public static String convertLDAPMemberDnToSubjectIdOrGroup(String dn, String baseOu, String grouperBaseStem, String serverId, String uniqueAttribute, boolean idOrIdentifier)
dn - of group member . Normally this will be as subjectIdbaseOu - This is the full DN of the OU to load from LDAP e.g. OU=Some Example,DC=test,DC=school,DC=edugrouperBaseStem - is the base stem where the groups are loaded into. e.g. my:groups:Loaded_from_LDAPserverId - is the connection or server ID specified in grouper-loader.properties file. e.g: personLdapuniqueAttribute - attribute value to return from LDAP query, preferably the one storing the subjectIdidOrIdentifier - true for id (group id), false for identifier (group name)Copyright © 2016 Internet2. All rights reserved.