only set the key, rest of config is in config file (#16442)

This commit is contained in:
Jan Heise
2023-09-16 07:32:52 +02:00
committed by GitHub
parent 70d6edc8a2
commit cc266351fb

View File

@@ -146,20 +146,8 @@ public class OpensearchSecurityConfiguration {
final File file = opensearchConfigDir.resolve(Path.of("opensearch-security", "config.yml")).toFile();
Map<String, Object> contents = objectMapper.readValue(file, new TypeReference<>() {});
/* TODO: the following two lines should be active, once #16334 is merged and there are nightly builds of master available to build a compatible 5.2-dev DataNode Docker image
Map<String, Object> config = filterConfigurationMap(contents, "config", "dynamic", "authc", "jwt_auth_domain", "http_authenticator", "config");
config.put("signing_key", Base64.getEncoder().encodeToString(signingKey));
*/
// TODO: remove the following block, once #16334 is merged and there are nightly builds of master available to build a compatible 5.2-dev DataNode Docker image
Map<String, Object> jwt_auth_domain = filterConfigurationMap(contents, "config", "dynamic", "authc", "jwt_auth_domain");
jwt_auth_domain.put("http_enabled", true);
jwt_auth_domain.put("transport_enabled", true);
Map<String, Object> config = filterConfigurationMap(jwt_auth_domain, "http_authenticator", "config");
config.put("signing_key", Base64.getEncoder().encodeToString(signingKey));
config.put("roles_key", "os_roles");
// TODO: remove up until here
objectMapper.writeValue(file, contents);
}