Skip to content

Commit

Permalink
UBO-292 Made org.mycore.ubo.matcher.MCRUserMatcherLDAP#getUserNameFro…
Browse files Browse the repository at this point in the history
…mLDAPUser protected (#343)

* UBO-292 Made org.mycore.ubo.matcher.MCRUserMatcherLDAP#getUserNameFromLDAPUser protected

* UBO-292 Made org.mycore.ubo.matcher.MCRUserMatcherLDAP#CONFIG_LDAP_LOGIN_ATTRIBUTENAME protected
  • Loading branch information
Possommi authored Jan 9, 2024
1 parent 40d77a8 commit 504a3c5
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,5 @@
package org.mycore.ubo.matcher;

import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;

import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
Expand All @@ -35,6 +17,23 @@
import org.mycore.user2.MCRUser;
import org.mycore.user2.MCRUserAttribute;

import javax.naming.NamingException;
import javax.naming.ldap.LdapContext;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.text.Normalizer;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
* Given a MCRUser match against the users of a LDAP-Server, enriching the attributes of the MCRUser by any matched
* LDAP-Users attributes.
Expand Down Expand Up @@ -70,7 +69,7 @@ public class MCRUserMatcherLDAP implements MCRUserMatcher {

private final static Logger LOGGER = LogManager.getLogger(MCRUserMatcherLDAP.class);

private final static String CONFIG_LDAP_LOGIN_ATTRIBUTENAME = "MCR.user2.LDAP.Login.AttributeName";
protected final static String CONFIG_LDAP_LOGIN_ATTRIBUTENAME = "MCR.user2.LDAP.Login.AttributeName";

// all members regarding configuration of explicit mods/mycore nameIdentifier mapping
private final static String CONFIG_EXPLICIT_NAMEIDENTIFIER_MAPPING = "MCR.user2.LDAP.Mapping.explicit";
Expand Down Expand Up @@ -230,7 +229,7 @@ Since currently (October 24th 2019), the LDAP and MyCoRe/UBO login is paired via
return matcherDTO;
}

private String getUserNameFromLDAPUser(LDAPObject ldapUser) {
protected String getUserNameFromLDAPUser(LDAPObject ldapUser) {
String userName = "";
String ldapLoginAttributeName = MCRConfiguration2.getString(CONFIG_LDAP_LOGIN_ATTRIBUTENAME).orElse("");
if (StringUtils.isEmpty(ldapLoginAttributeName)) {
Expand Down

0 comments on commit 504a3c5

Please sign in to comment.