From 597fc95cef4f19f8572e25e2f31bc709adf2f74b Mon Sep 17 00:00:00 2001 From: Maxime Dor Date: Sun, 24 Sep 2017 01:49:56 +0200 Subject: [PATCH] Clean-up --- .../kamax/mxisd/session/SessionMananger.java | 9 +----- src/main/resources/application.yaml | 28 ++++++++++--------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/main/groovy/io/kamax/mxisd/session/SessionMananger.java b/src/main/groovy/io/kamax/mxisd/session/SessionMananger.java index 9d0cd52..1f41029 100644 --- a/src/main/groovy/io/kamax/mxisd/session/SessionMananger.java +++ b/src/main/groovy/io/kamax/mxisd/session/SessionMananger.java @@ -31,7 +31,6 @@ import io.kamax.mxisd.controller.v1.io.RequestTokenResponse; import io.kamax.mxisd.controller.v1.remote.RemoteIdentityAPIv1; import io.kamax.mxisd.exception.*; import io.kamax.mxisd.lookup.ThreePidValidation; -import io.kamax.mxisd.lookup.strategy.LookupStrategy; import io.kamax.mxisd.matrix.IdentityServerUtils; import io.kamax.mxisd.notification.NotificationManager; import io.kamax.mxisd.storage.IStorage; @@ -72,18 +71,16 @@ public class SessionMananger { private SessionConfig cfg; private MatrixConfig mxCfg; private IStorage storage; - private LookupStrategy lookup; private NotificationManager notifMgr; // FIXME export into central class, set version private CloseableHttpClient client = HttpClients.custom().setUserAgent("mxisd").build(); @Autowired - public SessionMananger(SessionConfig cfg, MatrixConfig mxCfg, IStorage storage, LookupStrategy lookup, NotificationManager notifMgr) { + public SessionMananger(SessionConfig cfg, MatrixConfig mxCfg, IStorage storage, NotificationManager notifMgr) { this.cfg = cfg; this.mxCfg = mxCfg; this.storage = storage; - this.lookup = lookup; this.notifMgr = notifMgr; } @@ -96,10 +93,6 @@ public class SessionMananger { return StringUtils.equalsIgnoreCase(cfg.getMatrixCfg().getDomain(), domain); } - private boolean isKnownLocal(ThreePid tpid) { - return lookup.findLocal(tpid.getMedium(), tpid.getAddress()).isPresent(); - } - private ThreePidSession getSession(String sid, String secret) { Optional dao = storage.getThreePidSession(sid); if (!dao.isPresent() || !StringUtils.equals(dao.get().getSecret(), secret)) { diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 35c99f9..3a147f4 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -91,20 +91,22 @@ threepid: local: 'classpath:email/validate-local-template.eml' remote: 'classpath:email/validate-remote-template.eml' -session.policy.validation: - enabled: true - forLocal: - enabled: true - toLocal: true # This should not be changed unless you know exactly the implications! - toRemote: +session: + policy: + validation: enabled: true - server: 'root' - forRemote: - enabled: true - toLocal: false - toRemote: - enabled: true - server: 'root' + forLocal: + enabled: true + toLocal: true + toRemote: + enabled: true + server: 'root' + forRemote: + enabled: true + toLocal: false + toRemote: + enabled: true + server: 'root' view: session: