Skip to content

Commit

Permalink
Fix settings names for script.allowed_types and script.allowed_contex…
Browse files Browse the repository at this point in the history
  • Loading branch information
jdconrad authored May 22, 2017
1 parent 52d504b commit 8887bcc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void testAllowAllScriptContextSettings() throws IOException {

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);
Expand All @@ -155,7 +155,7 @@ public void testAllowSomeScriptTypeSettings() throws IOException {

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);
Expand All @@ -165,7 +165,7 @@ public void testAllowSomeScriptContextSettings() throws IOException {

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);
Expand All @@ -174,7 +174,7 @@ public void testAllowNoScriptTypeSettings() throws IOException {

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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 8887bcc

Please sign in to comment.