Remove groovy scripting language (#21607)

* Scripting: Remove groovy scripting language

Groovy was deprecated in 5.0. This change removes it, along with the
legacy default language infrastructure in scripting.
This commit is contained in:
Ryan Ernst 2016-11-22 19:24:12 -08:00 committed by GitHub
parent dbdcf9e95c
commit 6940b2b8c7
40 changed files with 40 additions and 2022 deletions

View file

@ -14,16 +14,16 @@ to run scripts on your box or not, and apply the appropriate safety measures.
=== Enabling dynamic scripting
The `script.*` settings allow for <<security-script-fine,fine-grained>>
control of which script languages (e.g `groovy`, `painless`) are allowed to
control of which script languages (e.g `painless`) are allowed to
run in which context ( e.g. `search`, `aggs`, `update`), and where the script
source is allowed to come from (i.e. `inline`, `stored`, `file`).
For instance, the following setting enables `stored` `update` scripts for
`groovy`:
`painless`:
[source,yaml]
----------------
script.engine.groovy.inline.update: true
script.engine.painless.inline.update: true
----------------
Less fine-grained settings exist which allow you to enable or disable scripts
@ -128,9 +128,9 @@ script.inline: false <1>
script.stored: false <1>
script.file: false <1>
script.engine.groovy.inline: true <2>
script.engine.groovy.stored.search: true <3>
script.engine.groovy.stored.aggs: true <3>
script.engine.painless.inline: true <2>
script.engine.painless.stored.search: true <3>
script.engine.painless.stored.aggs: true <3>
script.engine.mustache.stored.search: true <4>
-----------------------------------
@ -184,7 +184,7 @@ will return the following exception:
{
"reason": {
"type": "script_exception",
"reason": "failed to run inline script [use(java.math.BigInteger); new BigInteger(1)] using lang [groovy]",
"reason": "failed to run inline script [use(java.math.BigInteger); new BigInteger(1)] using lang [painless]",
"caused_by": {
"type": "no_class_def_found_error",
"reason": "java/math/BigInteger",
@ -197,30 +197,6 @@ will return the following exception:
}
------------------------------
However, classloader issues may also result in more difficult to interpret
exceptions. For instance, this script:
[source,groovy]
------------------------------
use(groovy.time.TimeCategory); new Date(123456789).format('HH')
------------------------------
Returns the following exception:
[source,js]
------------------------------
{
"reason": {
"type": "script_exception",
"reason": "failed to run inline script [use(groovy.time.TimeCategory); new Date(123456789).format('HH')] using lang [groovy]",
"caused_by": {
"type": "missing_property_exception",
"reason": "No such property: groovy for class: 8d45f5c1a07a1ab5dda953234863e283a7586240"
}
}
}
------------------------------
[float]
== Dealing with Java Security Manager issues
@ -262,16 +238,6 @@ grant {
};
----------------------------------
Here is an example of how to enable the `groovy.time.TimeCategory` class:
[source,js]
----------------------------------
grant {
permission org.elasticsearch.script.ClassPermission "java.lang.Class";
permission org.elasticsearch.script.ClassPermission "groovy.time.TimeCategory";
};
----------------------------------
[TIP]
======================================