Fix response body of /3pid/bind to match spec

- synapse did not check/validate the response as per spec until 0.99.5 it seems
- mxisd was never compliant also
This commit is contained in:
Max Dor
2019-05-30 13:26:38 +02:00
parent 544f8e59f0
commit 0ddd086bda
11 changed files with 65 additions and 22 deletions

View File

@@ -33,11 +33,7 @@ public class MxisdDefaultTest {
@Test
public void defaultConfig() {
MxisdConfig cfg = new MxisdConfig();
cfg.getMatrix().setDomain(domain);
cfg.getKey().setPath(":memory:");
cfg.getStorage().getProvider().getSqlite().setDatabase(":memory:");
MxisdConfig cfg = MxisdConfig.forDomain(domain).inMemory();
Mxisd m = new Mxisd(cfg);
m.start();

View File

@@ -41,10 +41,7 @@ public class MxisdTest {
@Before
public void before() {
MxisdConfig cfg = new MxisdConfig();
cfg.getMatrix().setDomain("localhost");
cfg.getKey().setPath(":memory:");
cfg.getStorage().getProvider().getSqlite().setDatabase(":memory:");
MxisdConfig cfg = MxisdConfig.forDomain("localhost").inMemory();
MemoryThreePid mem3pid = new MemoryThreePid();
mem3pid.setMedium("email");

View File

@@ -24,6 +24,7 @@ import com.google.gson.JsonObject;
import io.kamax.matrix.event.EventKey;
import io.kamax.matrix.json.GsonUtil;
import io.kamax.matrix.json.MatrixJson;
import io.kamax.mxisd.config.MxisdConfig;
import io.kamax.mxisd.crypto.Signature;
import io.kamax.mxisd.crypto.SignatureManager;
import io.kamax.mxisd.crypto.ed25519.Ed25519Key;
@@ -52,7 +53,7 @@ public class SignatureManagerTest {
KeyStore store = new MemoryKeyStore();
store.add(key);
return new Ed25519SignatureManager(new Ed25519KeyManager(store));
return new Ed25519SignatureManager(MxisdConfig.forDomain("localhost").inMemory().build(), new Ed25519KeyManager(store));
}
@BeforeClass