Fix regression due to bad replace
This commit is contained in:
@@ -28,7 +28,7 @@ public enum UserIdType {
|
|||||||
Localpart("localpart"),
|
Localpart("localpart"),
|
||||||
MatrixID("mxid"),
|
MatrixID("mxid"),
|
||||||
EmailLocalpart("email_localpart"),
|
EmailLocalpart("email_localpart"),
|
||||||
Email("threepids/email");
|
Email("email");
|
||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
@@ -20,12 +20,14 @@
|
|||||||
|
|
||||||
package io.kamax.mxisd.controller.identity.v1.io;
|
package io.kamax.mxisd.controller.identity.v1.io;
|
||||||
|
|
||||||
|
import io.kamax.matrix.ThreePidMedium;
|
||||||
|
|
||||||
public class SessionEmailTokenRequestJson extends GenericTokenRequestJson {
|
public class SessionEmailTokenRequestJson extends GenericTokenRequestJson {
|
||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
public String getMedium() {
|
public String getMedium() {
|
||||||
return "threepids/email";
|
return ThreePidMedium.Email.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
package io.kamax.mxisd.lookup.provider;
|
package io.kamax.mxisd.lookup.provider;
|
||||||
|
|
||||||
|
import io.kamax.matrix.ThreePidMedium;
|
||||||
import io.kamax.mxisd.config.MatrixConfig;
|
import io.kamax.mxisd.config.MatrixConfig;
|
||||||
import io.kamax.mxisd.lookup.SingleLookupReply;
|
import io.kamax.mxisd.lookup.SingleLookupReply;
|
||||||
import io.kamax.mxisd.lookup.SingleLookupRequest;
|
import io.kamax.mxisd.lookup.SingleLookupRequest;
|
||||||
@@ -83,7 +84,7 @@ class DnsLookupProvider implements IThreePidProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<SingleLookupReply> find(SingleLookupRequest request) {
|
public Optional<SingleLookupReply> find(SingleLookupRequest request) {
|
||||||
if (!StringUtils.equals("threepids/email", request.getType())) { // TODO use enum
|
if (!ThreePidMedium.Email.is(request.getType())) { // TODO use enum
|
||||||
log.info("Skipping unsupported type {} for {}", request.getType(), request.getThreePid());
|
log.info("Skipping unsupported type {} for {}", request.getType(), request.getThreePid());
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
@@ -106,7 +107,7 @@ class DnsLookupProvider implements IThreePidProvider {
|
|||||||
Map<String, List<ThreePidMapping>> domains = new HashMap<>();
|
Map<String, List<ThreePidMapping>> domains = new HashMap<>();
|
||||||
|
|
||||||
for (ThreePidMapping mapping : mappings) {
|
for (ThreePidMapping mapping : mappings) {
|
||||||
if (!StringUtils.equals("threepids/email", mapping.getMedium())) {
|
if (!ThreePidMedium.Email.is(mapping.getMedium())) {
|
||||||
log.info("Skipping unsupported type {} for {}", mapping.getMedium(), mapping.getValue());
|
log.info("Skipping unsupported type {} for {}", mapping.getMedium(), mapping.getValue());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,7 @@ import java.util.Optional;
|
|||||||
// FIXME placeholder, this must go in matrix-java-sdk for 1.0
|
// FIXME placeholder, this must go in matrix-java-sdk for 1.0
|
||||||
public class IdentityServerUtils {
|
public class IdentityServerUtils {
|
||||||
|
|
||||||
public static final String THREEPID_TEST_MEDIUM = "threepids/email";
|
public static final String THREEPID_TEST_MEDIUM = "email";
|
||||||
public static final String THREEPID_TEST_ADDRESS = "mxisd-email-forever-unknown@forever-invalid.kamax.io";
|
public static final String THREEPID_TEST_ADDRESS = "mxisd-email-forever-unknown@forever-invalid.kamax.io";
|
||||||
|
|
||||||
private static Logger log = LoggerFactory.getLogger(IdentityServerUtils.class);
|
private static Logger log = LoggerFactory.getLogger(IdentityServerUtils.class);
|
||||||
|
Reference in New Issue
Block a user