Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelandis committed Jan 12, 2024
1 parent 8ab505a commit 8562f27
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,10 @@

package org.elasticsearch.test.cluster.local;


import org.elasticsearch.test.cluster.util.Version;
import org.elasticsearch.test.cluster.util.resource.Resource;

import java.util.HashMap;

public class FipsEnabledClusterConfigProvider implements LocalClusterConfigProvider {


@Override
public void apply(LocalClusterSpecBuilder<?> builder) {
if (isFipsEnabled()) {
Expand All @@ -38,14 +33,8 @@ public void apply(LocalClusterSpecBuilder<?> builder) {
.setting("xpack.security.fips_mode.enabled", "true")
.setting("xpack.license.self_generated.type", "trial")
.setting("xpack.security.authc.password_hashing.algorithm", "pbkdf2_stretch")
.keystorePassword("keystore-password")
.settings(node -> {
var settings = new HashMap<String, String>(1);
if(node.getVersion().onOrAfter(Version.fromString("8.13.0"))){
settings.put("xpack.security.fips_mode.required_providers", "[BCFIPS, BCJSSE]");
}
return settings;
});
.setting("xpack.security.fips_mode.required_providers", () -> "[BCFIPS, BCJSSE]", n -> n.getVersion().onOrAfter("8.13.0"))
.keystorePassword("keystore-password");
}
}

Expand Down

0 comments on commit 8562f27

Please sign in to comment.