Fix settings names for script.allowed_types and script.allowed_contexts. (#24831)
Fixes #24830
This commit is contained in:
parent
52d504bb5f
commit
8887bcc4c6
|
@ -74,9 +74,9 @@ public class ScriptService extends AbstractComponent implements Closeable, Clust
|
|||
public static final String ALLOW_NONE = "none";
|
||||
|
||||
public static final Setting<List<String>> TYPES_ALLOWED_SETTING =
|
||||
Setting.listSetting("script.types_allowed", Collections.emptyList(), Function.identity(), Setting.Property.NodeScope);
|
||||
Setting.listSetting("script.allowed_types", Collections.emptyList(), Function.identity(), Setting.Property.NodeScope);
|
||||
public static final Setting<List<String>> CONTEXTS_ALLOWED_SETTING =
|
||||
Setting.listSetting("script.contexts_allowed", Collections.emptyList(), Function.identity(), Setting.Property.NodeScope);
|
||||
Setting.listSetting("script.allowed_contexts", Collections.emptyList(), Function.identity(), Setting.Property.NodeScope);
|
||||
|
||||
private final Set<String> typesAllowed;
|
||||
private final Set<String> contextsAllowed;
|
||||
|
|
|
@ -146,7 +146,7 @@ public class ScriptServiceTests extends ESTestCase {
|
|||
|
||||
public void testAllowSomeScriptTypeSettings() throws IOException {
|
||||
Settings.Builder builder = Settings.builder();
|
||||
builder.put("script.types_allowed", "inline");
|
||||
builder.put("script.allowed_types", "inline");
|
||||
buildScriptService(builder.build());
|
||||
|
||||
assertCompileAccepted("painless", "script", ScriptType.INLINE, ScriptContext.SEARCH);
|
||||
|
@ -155,7 +155,7 @@ public class ScriptServiceTests extends ESTestCase {
|
|||
|
||||
public void testAllowSomeScriptContextSettings() throws IOException {
|
||||
Settings.Builder builder = Settings.builder();
|
||||
builder.put("script.contexts_allowed", "search, aggs");
|
||||
builder.put("script.allowed_contexts", "search, aggs");
|
||||
buildScriptService(builder.build());
|
||||
|
||||
assertCompileAccepted("painless", "script", ScriptType.INLINE, ScriptContext.SEARCH);
|
||||
|
@ -165,7 +165,7 @@ public class ScriptServiceTests extends ESTestCase {
|
|||
|
||||
public void testAllowNoScriptTypeSettings() throws IOException {
|
||||
Settings.Builder builder = Settings.builder();
|
||||
builder.put("script.types_allowed", "none");
|
||||
builder.put("script.allowed_types", "none");
|
||||
buildScriptService(builder.build());
|
||||
|
||||
assertCompileRejected("painless", "script", ScriptType.INLINE, ScriptContext.SEARCH);
|
||||
|
@ -174,7 +174,7 @@ public class ScriptServiceTests extends ESTestCase {
|
|||
|
||||
public void testAllowNoScriptContextSettings() throws IOException {
|
||||
Settings.Builder builder = Settings.builder();
|
||||
builder.put("script.contexts_allowed", "none");
|
||||
builder.put("script.allowed_contexts", "none");
|
||||
buildScriptService(builder.build());
|
||||
|
||||
assertCompileRejected("painless", "script", ScriptType.INLINE, ScriptContext.SEARCH);
|
||||
|
|
|
@ -40,7 +40,7 @@ public class StoredExpressionTests extends ESIntegTestCase {
|
|||
@Override
|
||||
protected Settings nodeSettings(int nodeOrdinal) {
|
||||
Settings.Builder builder = Settings.builder().put(super.nodeSettings(nodeOrdinal));
|
||||
builder.put("script.contexts_allowed", "update");
|
||||
builder.put("script.allowed_contexts", "update");
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue