Merge branch 'master' into feature/shield-ui

Original commit: elastic/x-pack-elasticsearch@bcda7dd9b0
This commit is contained in:
Lukas Olson 2016-05-13 11:31:39 -07:00
commit 749eb296ca
6 changed files with 18 additions and 21 deletions

View File

@ -42,7 +42,7 @@ public final class MessyTestUtils {
engineServiceSet.add(groovyScriptEngineService);
ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(
Arrays.asList(
new ScriptEngineRegistry.ScriptEngineRegistration(GroovyScriptEngineService.class, GroovyScriptEngineService.TYPES)
new ScriptEngineRegistry.ScriptEngineRegistration(GroovyScriptEngineService.class, GroovyScriptEngineService.NAME)
)
);
ScriptContextRegistry scriptContextRegistry = new ScriptContextRegistry(Arrays.asList(ScriptServiceProxy.INSTANCE));

View File

@ -56,7 +56,7 @@ public class WatcherTemplateTests extends ESTestCase {
ScriptEngineRegistry scriptEngineRegistry = new ScriptEngineRegistry(
Arrays.asList(
new ScriptEngineRegistry.ScriptEngineRegistration(MustacheScriptEngineService.class,
MustacheScriptEngineService.TYPES)
MustacheScriptEngineService.NAME)
)
);
ScriptSettings scriptSettings = new ScriptSettings(scriptEngineRegistry, registry);

View File

@ -107,11 +107,11 @@ public class ShieldServerTransportService extends TransportService {
@Override
public <Request extends TransportRequest> void registerRequestHandler(String action, Supplier<Request> request, String executor,
boolean forceExecution,
boolean forceExecution, boolean canTripCircuitBreaker,
TransportRequestHandler<Request> handler) {
TransportRequestHandler<Request> wrappedHandler = new ProfileSecuredRequestHandler<>(action, handler, profileFilters,
licenseState, threadPool.getThreadContext());
super.registerRequestHandler(action, request, executor, forceExecution, wrappedHandler);
super.registerRequestHandler(action, request, executor, forceExecution, canTripCircuitBreaker, wrappedHandler);
}
protected Map<String, ServerTransportFilter> initializeProfileFilters() {

View File

@ -5,6 +5,7 @@
*/
package org.elasticsearch.script;
import org.elasticsearch.script.ScriptMode;
import org.elasticsearch.xpack.common.text.DefaultTextTemplateEngine;
import java.util.Collections;
@ -29,19 +30,19 @@ public class MockMustacheScriptEngine extends MockScriptEngine {
public void onModule(ScriptModule module) {
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(MockMustacheScriptEngine.class,
Collections.singletonList(NAME)));
NAME, ScriptMode.ON));
}
}
@Override
public List<String> getTypes() {
return Collections.singletonList(NAME);
public String getType() {
return NAME;
}
@Override
public List<String> getExtensions() {
return getTypes();
public String getExtension() {
return NAME;
}
@Override

View File

@ -7,6 +7,7 @@ package org.elasticsearch.script;
import org.elasticsearch.common.Nullable;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.script.ScriptMode;
import org.elasticsearch.search.lookup.SearchLookup;
import java.io.IOException;
@ -21,8 +22,6 @@ public class SleepScriptEngine implements ScriptEngineService {
public static final String NAME = "sleep";
public static final List<String> TYPES = Collections.singletonList(NAME);
public static class TestPlugin extends Plugin {
public TestPlugin() {
@ -39,24 +38,20 @@ public class SleepScriptEngine implements ScriptEngineService {
}
public void onModule(ScriptModule module) {
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class, SleepScriptEngine.TYPES));
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(SleepScriptEngine.class,
SleepScriptEngine.NAME, ScriptMode.ON));
}
}
@Override
public List<String> getTypes() {
return TYPES;
public String getType() {
return NAME;
}
@Override
public List<String> getExtensions() {
return TYPES;
}
@Override
public boolean isSandboxed() {
return true;
public String getExtension() {
return NAME;
}
@Override

View File

@ -136,6 +136,7 @@ public abstract class AbstractWatcherIntegrationTestCase extends ESIntegTestCase
.put("xpack.watcher.watch.scroll.size", randomIntBetween(1, 100))
.put(ShieldSettings.settings(shieldEnabled))
.put("xpack.watcher.trigger.schedule.engine", scheduleImplName)
.put("script.inline", "true")
.build();
}