Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@
import org.apache.syncope.common.keymaster.client.api.KeymasterProperties;
import org.apache.syncope.common.keymaster.client.api.ServiceOps;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.client.ZKClientConfig;
import org.apache.zookeeper.common.X509Util;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.server.auth.DigestLoginModule;
import org.springframework.boot.autoconfigure.condition.ConditionOutcome;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.SpringBootCondition;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -63,8 +66,20 @@ public ConditionOutcome getMatchOutcome(final ConditionContext context, final An
}

@Conditional(ZookeeperCondition.class)
@ConditionalOnMissingBean
@Bean
public CuratorFramework curatorFramework(final KeymasterProperties props) throws InterruptedException {
public ZKClientConfig zkClientConfig() {
ZKClientConfig zkClientConfig = new ZKClientConfig();
zkClientConfig.setProperty(X509Util.FIPS_MODE_PROPERTY, "false");
return zkClientConfig;
}

@Conditional(ZookeeperCondition.class)
@Bean
public CuratorFramework curatorFramework(
final ZKClientConfig zkClientConfig,
final KeymasterProperties props) throws InterruptedException {

if (StringUtils.isNotBlank(props.getUsername()) && StringUtils.isNotBlank(props.getPassword())) {
javax.security.auth.login.Configuration.setConfiguration(new javax.security.auth.login.Configuration() {

Expand Down Expand Up @@ -102,7 +117,7 @@ public List<ACL> getAclForPath(final String path) {
}
});
}
CuratorFramework client = clientBuilder.build();
CuratorFramework client = clientBuilder.zkClientConfig(zkClientConfig).build();
client.start();
client.blockUntilConnected(3, TimeUnit.SECONDS);

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ under the License.
<antlr4.version>4.13.2</antlr4.version>

<curator.version>5.9.0</curator.version>
<zookeeper.version>3.9.3</zookeeper.version>
<zookeeper.version>3.9.4</zookeeper.version>

<zonky.embedded-postgres.version>2.1.1</zonky.embedded-postgres.version>
<zonky.embedded-postgres-binaries.version>17.6.0</zonky.embedded-postgres-binaries.version>
Expand Down
Loading