Use the actual NetIQ config for its profile provider
This commit is contained in:
@@ -79,7 +79,12 @@ public class AppServiceHandler {
|
|||||||
log.info("Got invite for {}", id);
|
log.info("Got invite for {}", id);
|
||||||
|
|
||||||
boolean wasSent = false;
|
boolean wasSent = false;
|
||||||
for (_ThreePid tpid : profiler.getThreepids(mxid)) {
|
List<_ThreePid> tpids = profiler.getThreepids(mxid);
|
||||||
|
if (tpids.isEmpty()) {
|
||||||
|
log.info("No email found in identity stores for {}", id);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (_ThreePid tpid : tpids) {
|
||||||
if (!StringUtils.equals("email", tpid.getMedium())) {
|
if (!StringUtils.equals("email", tpid.getMedium())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -62,10 +62,13 @@ public class LdapProfileProvider extends LdapBackend implements ProfileProvider
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<String> getDisplayName(_MatrixID userId) {
|
public Optional<String> getDisplayName(_MatrixID userId) {
|
||||||
|
String uid = buildUidFromMatrixId(userId);
|
||||||
|
log.info("Searching for display name of {}:", uid);
|
||||||
|
|
||||||
try (LdapConnection conn = getConn()) {
|
try (LdapConnection conn = getConn()) {
|
||||||
bind(conn);
|
bind(conn);
|
||||||
|
|
||||||
String searchQuery = buildOrQueryWithFilter(getCfg().getProfile().getFilter(), buildUidFromMatrixId(userId), getUidAtt());
|
String searchQuery = buildOrQueryWithFilter(getCfg().getProfile().getFilter(), uid, getUidAtt());
|
||||||
|
|
||||||
log.debug("Base DN: {}", getBaseDn());
|
log.debug("Base DN: {}", getBaseDn());
|
||||||
log.debug("Query: {}", searchQuery);
|
log.debug("Query: {}", searchQuery);
|
||||||
@@ -74,7 +77,7 @@ public class LdapProfileProvider extends LdapBackend implements ProfileProvider
|
|||||||
while (cursor.next()) {
|
while (cursor.next()) {
|
||||||
Entry entry = cursor.get();
|
Entry entry = cursor.get();
|
||||||
log.info("Found possible match, DN: {}", entry.getDn().getName());
|
log.info("Found possible match, DN: {}", entry.getDn().getName());
|
||||||
Optional<String> v = getAttribute(entry, getAt().getName()).flatMap(uid -> {
|
Optional<String> v = getAttribute(entry, getAt().getName()).flatMap(id -> {
|
||||||
log.info("DN {} is a valid match", entry.getDn().getName());
|
log.info("DN {} is a valid match", entry.getDn().getName());
|
||||||
try {
|
try {
|
||||||
return getAttribute(entry, getAt().getName());
|
return getAttribute(entry, getAt().getName());
|
||||||
@@ -102,7 +105,7 @@ public class LdapProfileProvider extends LdapBackend implements ProfileProvider
|
|||||||
@Override
|
@Override
|
||||||
public List<_ThreePid> getThreepids(_MatrixID userId) {
|
public List<_ThreePid> getThreepids(_MatrixID userId) {
|
||||||
String uid = buildUidFromMatrixId(userId);
|
String uid = buildUidFromMatrixId(userId);
|
||||||
log.info("Looking for display name of {}", uid);
|
log.info("Searching for 3PIDs of {}:", uid);
|
||||||
|
|
||||||
List<_ThreePid> threePids = new ArrayList<>();
|
List<_ThreePid> threePids = new ArrayList<>();
|
||||||
try (LdapConnection conn = getConn()) {
|
try (LdapConnection conn = getConn()) {
|
||||||
|
@@ -23,7 +23,7 @@ package io.kamax.mxisd.backend.ldap.netiq;
|
|||||||
import io.kamax.matrix._MatrixID;
|
import io.kamax.matrix._MatrixID;
|
||||||
import io.kamax.mxisd.backend.ldap.LdapProfileProvider;
|
import io.kamax.mxisd.backend.ldap.LdapProfileProvider;
|
||||||
import io.kamax.mxisd.config.MatrixConfig;
|
import io.kamax.mxisd.config.MatrixConfig;
|
||||||
import io.kamax.mxisd.config.ldap.LdapConfig;
|
import io.kamax.mxisd.config.ldap.netiq.NetIqLdapConfig;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ import org.springframework.stereotype.Component;
|
|||||||
public class NetIqLdapProfileProvider extends LdapProfileProvider {
|
public class NetIqLdapProfileProvider extends LdapProfileProvider {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
public NetIqLdapProfileProvider(LdapConfig cfg, MatrixConfig mxCfg) {
|
public NetIqLdapProfileProvider(NetIqLdapConfig cfg, MatrixConfig mxCfg) {
|
||||||
super(cfg, mxCfg);
|
super(cfg, mxCfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -48,12 +48,13 @@ public class ProfileManager {
|
|||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
public void build() {
|
public void build() {
|
||||||
providers = providers.stream()
|
|
||||||
.filter(ProfileProvider::isEnabled)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
log.info("--- Profile providers ---");
|
log.info("--- Profile providers ---");
|
||||||
this.providers.forEach(pp -> log.info("\t- {}", pp.getClass().getSimpleName()));
|
providers = providers.stream()
|
||||||
|
.filter(pp -> {
|
||||||
|
log.info("\t- {} - Is enabled? {}", pp.getClass().getSimpleName(), pp.isEnabled());
|
||||||
|
return pp.isEnabled();
|
||||||
|
})
|
||||||
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> List<T> getList(Function<ProfileProvider, List<T>> function) {
|
public <T> List<T> getList(Function<ProfileProvider, List<T>> function) {
|
||||||
|
Reference in New Issue
Block a user