Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b613415dc4 | ||
|
0549d23d21 | ||
|
b493ccd479 | ||
|
03e72ba155 | ||
|
32a3444a9e |
@@ -44,7 +44,7 @@ Example: `/path/to/sqlite/file.db`
|
|||||||
|
|
||||||
#### Others
|
#### Others
|
||||||
```yaml
|
```yaml
|
||||||
sql.connection: //<HOST[:PORT]/DB?username=USER&password=PASS
|
sql.connection: //<HOST[:PORT]/DB?user=USER&password=PASS
|
||||||
```
|
```
|
||||||
Set the connection info for the database by replacing the following values:
|
Set the connection info for the database by replacing the following values:
|
||||||
- `HOST`: Hostname of the SQL server
|
- `HOST`: Hostname of the SQL server
|
||||||
|
@@ -35,7 +35,7 @@ Example: `/path/to/synapse/sqliteFile.db`
|
|||||||
|
|
||||||
### PostgreSQL
|
### PostgreSQL
|
||||||
```yaml
|
```yaml
|
||||||
synapseSql.connection: //<HOST[:PORT]/DB?username=USER&password=PASS
|
synapseSql.connection: //<HOST[:PORT]/DB?user=USER&password=PASS
|
||||||
```
|
```
|
||||||
Set the connection info for the database by replacing the following values:
|
Set the connection info for the database by replacing the following values:
|
||||||
- `HOST`: Hostname of the SQL server
|
- `HOST`: Hostname of the SQL server
|
||||||
|
@@ -117,6 +117,7 @@ The following example of configuration (incomplete extract) shows which items ar
|
|||||||
**IMPORTANT:** Most configuration items shown have default values and should not be included in your own configuration
|
**IMPORTANT:** Most configuration items shown have default values and should not be included in your own configuration
|
||||||
file unless you want to specifically overwrite them.
|
file unless you want to specifically overwrite them.
|
||||||
```yaml
|
```yaml
|
||||||
|
# CONFIGURATION EXAMPLE
|
||||||
# DO NOT COPY/PASTE THIS IN YOUR CONFIGURATION
|
# DO NOT COPY/PASTE THIS IN YOUR CONFIGURATION
|
||||||
session.policy.validation.enabled: true
|
session.policy.validation.enabled: true
|
||||||
session.policy.validation.forLocal:
|
session.policy.validation.forLocal:
|
||||||
@@ -132,6 +133,7 @@ session.policy.validation.forRemote:
|
|||||||
enabled: true
|
enabled: true
|
||||||
server: 'configExample' # Not to be included in config! Already present in default config!
|
server: 'configExample' # Not to be included in config! Already present in default config!
|
||||||
# DO NOT COPY/PASTE THIS IN YOUR CONFIGURATION
|
# DO NOT COPY/PASTE THIS IN YOUR CONFIGURATION
|
||||||
|
# CONFIGURATION EXAMPLE
|
||||||
```
|
```
|
||||||
|
|
||||||
`session.policy.validation` is the core configuration to control what users configured to use your Identity server
|
`session.policy.validation` is the core configuration to control what users configured to use your Identity server
|
||||||
|
@@ -359,6 +359,7 @@ public abstract class LdapConfig {
|
|||||||
|
|
||||||
log.info("Host: {}", connection.getHost());
|
log.info("Host: {}", connection.getHost());
|
||||||
log.info("Port: {}", connection.getPort());
|
log.info("Port: {}", connection.getPort());
|
||||||
|
log.info("TLS: {}", connection.isTls());
|
||||||
log.info("Bind DN: {}", connection.getBindDn());
|
log.info("Bind DN: {}", connection.getBindDn());
|
||||||
log.info("Base DN: {}", connection.getBaseDn());
|
log.info("Base DN: {}", connection.getBaseDn());
|
||||||
|
|
||||||
|
@@ -20,8 +20,8 @@
|
|||||||
|
|
||||||
package io.kamax.mxisd.controller.directory.v1.io;
|
package io.kamax.mxisd.controller.directory.v1.io;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.Set;
|
||||||
|
|
||||||
public class UserDirectorySearchResult {
|
public class UserDirectorySearchResult {
|
||||||
|
|
||||||
@@ -55,10 +55,31 @@ public class UserDirectorySearchResult {
|
|||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
Result result = (Result) o;
|
||||||
|
|
||||||
|
if (displayName != null ? !displayName.equals(result.displayName) : result.displayName != null)
|
||||||
|
return false;
|
||||||
|
if (avatarUrl != null ? !avatarUrl.equals(result.avatarUrl) : result.avatarUrl != null) return false;
|
||||||
|
return userId.equals(result.userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = displayName != null ? displayName.hashCode() : 0;
|
||||||
|
result = 31 * result + (avatarUrl != null ? avatarUrl.hashCode() : 0);
|
||||||
|
result = 31 * result + userId.hashCode();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean limited;
|
private boolean limited;
|
||||||
private List<Result> results = new ArrayList<>();
|
private Set<Result> results = new HashSet<>();
|
||||||
|
|
||||||
public boolean isLimited() {
|
public boolean isLimited() {
|
||||||
return limited;
|
return limited;
|
||||||
@@ -68,11 +89,11 @@ public class UserDirectorySearchResult {
|
|||||||
this.limited = limited;
|
this.limited = limited;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Result> getResults() {
|
public Set<Result> getResults() {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResults(List<Result> results) {
|
public void setResults(Set<Result> results) {
|
||||||
this.results = results;
|
this.results = results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,7 +24,7 @@ import io.kamax.matrix.crypto.KeyFileStore;
|
|||||||
import io.kamax.matrix.crypto.KeyManager;
|
import io.kamax.matrix.crypto.KeyManager;
|
||||||
import io.kamax.matrix.crypto.SignatureManager;
|
import io.kamax.matrix.crypto.SignatureManager;
|
||||||
import io.kamax.mxisd.config.KeyConfig;
|
import io.kamax.mxisd.config.KeyConfig;
|
||||||
import io.kamax.mxisd.config.MatrixConfig;
|
import io.kamax.mxisd.config.ServerConfig;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
@@ -50,8 +50,8 @@ public class CryptoFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public SignatureManager getSignatureManager(KeyManager keyMgr, MatrixConfig mxCfg) {
|
public SignatureManager getSignatureManager(KeyManager keyMgr, ServerConfig cfg) {
|
||||||
return new SignatureManager(keyMgr, mxCfg.getDomain());
|
return new SignatureManager(keyMgr, cfg.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -33,8 +33,7 @@ import org.junit.Test;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import static com.github.tomakehurst.wiremock.client.WireMock.*;
|
import static com.github.tomakehurst.wiremock.client.WireMock.*;
|
||||||
import static org.junit.Assert.assertNotNull;
|
import static org.junit.Assert.*;
|
||||||
import static org.junit.Assert.assertTrue;
|
|
||||||
|
|
||||||
public class RestDirectoryProviderTest {
|
public class RestDirectoryProviderTest {
|
||||||
|
|
||||||
@@ -89,8 +88,8 @@ public class RestDirectoryProviderTest {
|
|||||||
|
|
||||||
UserDirectorySearchResult result = p.searchByDisplayName(byNameSearch);
|
UserDirectorySearchResult result = p.searchByDisplayName(byNameSearch);
|
||||||
assertTrue(!result.isLimited());
|
assertTrue(!result.isLimited());
|
||||||
assertTrue(result.getResults().size() == 1);
|
assertEquals(1, result.getResults().size());
|
||||||
UserDirectorySearchResult.Result entry = result.getResults().get(0);
|
UserDirectorySearchResult.Result entry = result.getResults().iterator().next();
|
||||||
assertNotNull(entry);
|
assertNotNull(entry);
|
||||||
assertTrue(StringUtils.equals(byNameAvatar, entry.getAvatarUrl()));
|
assertTrue(StringUtils.equals(byNameAvatar, entry.getAvatarUrl()));
|
||||||
assertTrue(StringUtils.equals(byNameDisplay, entry.getDisplayName()));
|
assertTrue(StringUtils.equals(byNameDisplay, entry.getDisplayName()));
|
||||||
@@ -132,8 +131,8 @@ public class RestDirectoryProviderTest {
|
|||||||
|
|
||||||
UserDirectorySearchResult result = p.searchBy3pid(byThreepidSearch);
|
UserDirectorySearchResult result = p.searchBy3pid(byThreepidSearch);
|
||||||
assertTrue(!result.isLimited());
|
assertTrue(!result.isLimited());
|
||||||
assertTrue(result.getResults().size() == 1);
|
assertEquals(1, result.getResults().size());
|
||||||
UserDirectorySearchResult.Result entry = result.getResults().get(0);
|
UserDirectorySearchResult.Result entry = result.getResults().iterator().next();
|
||||||
assertNotNull(entry);
|
assertNotNull(entry);
|
||||||
assertTrue(StringUtils.equals(byThreepidAvatar, entry.getAvatarUrl()));
|
assertTrue(StringUtils.equals(byThreepidAvatar, entry.getAvatarUrl()));
|
||||||
assertTrue(StringUtils.equals(byThreepidDisplay, entry.getDisplayName()));
|
assertTrue(StringUtils.equals(byThreepidDisplay, entry.getDisplayName()));
|
||||||
|
Reference in New Issue
Block a user