Properly split authoritative domain and public IS host
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
package io.kamax.mxisd.lookup.provider
|
||||
|
||||
import io.kamax.mxisd.config.ServerConfig
|
||||
import io.kamax.mxisd.config.MatrixConfig
|
||||
import io.kamax.mxisd.lookup.SingleLookupReply
|
||||
import io.kamax.mxisd.lookup.SingleLookupRequest
|
||||
import io.kamax.mxisd.lookup.ThreePidMapping
|
||||
@@ -44,7 +44,7 @@ class DnsLookupProvider implements IThreePidProvider {
|
||||
private Logger log = LoggerFactory.getLogger(DnsLookupProvider.class)
|
||||
|
||||
@Autowired
|
||||
private ServerConfig srvCfg
|
||||
private MatrixConfig mxCfg
|
||||
|
||||
@Autowired
|
||||
private IRemoteIdentityServerFetcher fetcher
|
||||
@@ -79,7 +79,7 @@ class DnsLookupProvider implements IThreePidProvider {
|
||||
|
||||
// TODO use caching mechanism
|
||||
Optional<String> findIdentityServerForDomain(String domain) {
|
||||
if (StringUtils.equals(srvCfg.getName(), domain)) {
|
||||
if (StringUtils.equals(mxCfg.getDomain(), domain)) {
|
||||
log.info("We are authoritative for {}, no remote lookup", domain)
|
||||
return Optional.empty()
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
package io.kamax.mxisd.lookup.provider
|
||||
|
||||
import io.kamax.mxisd.config.ServerConfig
|
||||
import io.kamax.mxisd.config.MatrixConfig
|
||||
import io.kamax.mxisd.config.ldap.LdapConfig
|
||||
import io.kamax.mxisd.lookup.SingleLookupReply
|
||||
import io.kamax.mxisd.lookup.SingleLookupRequest
|
||||
@@ -47,7 +47,7 @@ class LdapProvider implements IThreePidProvider {
|
||||
private Logger log = LoggerFactory.getLogger(LdapProvider.class)
|
||||
|
||||
@Autowired
|
||||
private ServerConfig srvCfg
|
||||
private MatrixConfig mxCfg
|
||||
|
||||
@Autowired
|
||||
private LdapConfig ldapCfg
|
||||
@@ -111,7 +111,7 @@ class LdapProvider implements IThreePidProvider {
|
||||
// TODO Should we turn this block into a map of functions?
|
||||
String uidType = ldapCfg.getAttribute().getUid().getType()
|
||||
if (StringUtils.equals(UID, uidType)) {
|
||||
matrixId.append("@").append(data).append(":").append(srvCfg.getName())
|
||||
matrixId.append("@").append(data).append(":").append(mxCfg.getDomain())
|
||||
} else if (StringUtils.equals(MATRIX_ID, uidType)) {
|
||||
matrixId.append(data)
|
||||
} else {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
package io.kamax.mxisd.lookup.provider;
|
||||
|
||||
import io.kamax.matrix.MatrixID;
|
||||
import io.kamax.mxisd.config.ServerConfig;
|
||||
import io.kamax.mxisd.config.MatrixConfig;
|
||||
import io.kamax.mxisd.config.sql.SqlProviderConfig;
|
||||
import io.kamax.mxisd.lookup.SingleLookupReply;
|
||||
import io.kamax.mxisd.lookup.SingleLookupRequest;
|
||||
@@ -43,7 +43,7 @@ public class SqlProvider implements IThreePidProvider {
|
||||
private Logger log = LoggerFactory.getLogger(SqlProvider.class);
|
||||
|
||||
@Autowired
|
||||
private ServerConfig srvCfg;
|
||||
private MatrixConfig mxCfg;
|
||||
|
||||
@Autowired
|
||||
private SqlProviderConfig cfg;
|
||||
@@ -82,7 +82,7 @@ public class SqlProvider implements IThreePidProvider {
|
||||
log.info("Found match: {}", uid);
|
||||
if (StringUtils.equals("uid", cfg.getIdentity().getType())) {
|
||||
log.info("Resolving as localpart");
|
||||
return Optional.of(new SingleLookupReply(request, new MatrixID(uid, srvCfg.getName())));
|
||||
return Optional.of(new SingleLookupReply(request, new MatrixID(uid, mxCfg.getDomain())));
|
||||
}
|
||||
if (StringUtils.equals("mxid", cfg.getIdentity().getType())) {
|
||||
log.info("Resolving as MXID");
|
||||
|
||||
Reference in New Issue
Block a user