Merge branch 'tp32' into tp33
Conflicts:
docs/src/reference/gremlin-applications.asciidoc
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/17dcd902
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/17dcd902
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/17dcd902
Branch: refs/heads/master
Commit: 17dcd90224ac4836d8162ea97bcd384615704f07
Parents: 55fcbdc 2495e8e
Author: Stephen Mallette <[email protected]>
Authored: Mon Jun 18 09:23:27 2018 -0400
Committer: Stephen Mallette <[email protected]>
Committed: Mon Jun 18 09:23:27 2018 -0400
----------------------------------------------------------------------
.travis.yml | 7 +++----
CHANGELOG.asciidoc | 3 ++-
docs/src/reference/gremlin-applications.asciidoc | 6 ++++--
docs/src/upgrade/release-3.2.x-incubating.asciidoc | 8 ++++++++
.../gremlin/groovy/jsr223/GroovyCompilerGremlinPlugin.java | 7 +++++++
5 files changed, 24 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17dcd902/CHANGELOG.asciidoc
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17dcd902/docs/src/reference/gremlin-applications.asciidoc
----------------------------------------------------------------------
diff --cc docs/src/reference/gremlin-applications.asciidoc
index b7419df,f967a9c..bb1e5ad
--- a/docs/src/reference/gremlin-applications.asciidoc
+++ b/docs/src/reference/gremlin-applications.asciidoc
@@@ -1474,43 -1354,44 +1474,45 @@@ of safety. A Gremlin Server instance th
The previous sections discussed methods for securing Gremlin Server through
authentication and encryption, which is a
good first step in protection. Another layer of protection comes in the form
of specific configurations for the
-`GremlinGroovyScriptEngine`. A user can configure the script engine with
different `CompilerCustomizerProvider`
-implementations. Consider the basic configuration from the Gremlin Server
YAML file:
+`GremlinGroovyScriptEngine`. A user can configure the script engine with a
`GroovyCompilerGremlinPlugin`
+implementation. Consider the basic configuration from the Gremlin Server YAML
file:
[source,yaml]
+----
scriptEngines: {
gremlin-groovy: {
- imports: [java.lang.Math],
- staticImports: [java.lang.Math.PI],
- scripts: [scripts/empty-sample.groovy]}}
+ plugins: {
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {},
+ org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin:
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+ org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin:
{files: [scripts/empty-sample.groovy]}}}}
+----
-This configuration can be extended to include a `config` key as follows:
+This configuration can be expaded to include a the
`GroovyCompilerGremlinPlugin`:
[source,yaml]
+----
scriptEngines: {
gremlin-groovy: {
- imports: [java.lang.Math],
- staticImports: [java.lang.Math.PI],
- scripts: [scripts/empty-sample.groovy],
- config: {
- compilerCustomizerProviders: {
-
"org.apache.tinkerpop.gremlin.groovy.jsr223.customizer.ThreadInterruptCustomizerProvider":[]
}}}}
-
-This configuration sets up the script engine with a
`CompilerCustomizerProvider` implementation. The
-`ThreadInterruptCustomizerProvider` injects checks that ensure that loops
(like `while`) respect thread interruption
-requests. Note that the empty square brackets following the declaration of
the `ThreadInterruptCustomizerProvider`
-are for parameters - this particular `CustomizerProvider` takes no arguments
to enable it. With this configuration in
-place and assuming the `scriptEvaluationTimeout` is set to `30000`
milliseconds, consider the following remote
-execution:
+ plugins: {
org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {},
+
org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {}
+ org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin:
{classImports: [java.lang.Math], methodImports: [java.lang.Math#*]},
+ org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin:
{files: [scripts/empty-sample-secure.groovy]},
+
org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyCompilerGremlinPlugin:
{timedInterrupt: 10000}}}}
+----
+
+This configuration sets up the script engine with to ensure that loops (like
`while`) can only execute for `10000`
+milliseconds. With this configuration in place, a remote execution as
follows, now times out rather than consuming
+the thread continuously:
[source,groovy]
+ ----
gremlin> :remote connect tinkerpop.server conf/remote.yaml
==>Configured localhost/127.0.0.1:8182
gremlin> :> while(true) { }
- Execution timed out after 10000 units. Start time: Fri Jul 24 11:04:52 EDT
2015
+ Script evaluation exceeded the configured 'scriptEvaluationTimeout' threshold
of 30000 ms or evaluation was otherwise cancelled directly for request
[while(true) { }]
+ ----
-There are a number of pre-packaged `CustomizerProvider` implementations:
+The `GroovyCompilerGremlinPlugin` has a number of configuration options:
[width="100%",cols="3,10a",options="header"]
|=========================================================
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17dcd902/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------