Skip to content

Commit

Permalink
Revert "Fix tests failing due to JVM security exceptions (#41)"
Browse files Browse the repository at this point in the history
This reverts commit 6369a78.
  • Loading branch information
macohen authored Sep 12, 2024
1 parent 6369a78 commit 0d4da5a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
13 changes: 4 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,8 @@ githubRelease.doFirst {
}
}

tasks.withType(Test).configureEach { task ->
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
def policyFile = file("${projectDir}/src/main/plugin-metadata/plugin-security.policy").absolutePath
task.jvmArgs += [
"--add-opens", "java.base/java.lang=ALL-UNNAMED",
"-Djava.security.manager",
"-Djava.security.policy=" + policyFile
]
}
tasks.withType(Test) { task ->
if (JavaVersion.current().compareTo(JavaVersion.VERSION_17) > 0) {
task.jvmArgs += ["-Djava.security.manager=allow"]
}
}
4 changes: 2 additions & 2 deletions src/main/plugin-metadata/plugin-security.policy
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
grant {
// needed to generate runtime classes
permission java.lang.RuntimePermission "createClassLoader";

// expression runtime
permission org.opensearch.script.ClassPermission "java.lang.String";
permission org.opensearch.script.ClassPermission "org.apache.lucene.expressions.Expression";
permission org.opensearch.script.ClassPermission "org.apache.lucene.expressions.js.ExpressionMath";
permission org.opensearch.script.ClassPermission "org.apache.lucene.expressions.js.ExpressionMath"
permission org.opensearch.script.ClassPermission "org.apache.lucene.search.DoubleValues";
// available functions
permission org.opensearch.script.ClassPermission "java.lang.Math";
Expand Down

0 comments on commit 0d4da5a

Please sign in to comment.