Create replacement for java.security.Policy which is marked for removal#19631
Create replacement for java.security.Policy which is marked for removal#19631cwperks wants to merge 7 commits intoopensearch-project:mainfrom
Conversation
…e repacement for java.security.Policy which is marked for removal Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
❌ Gradle check result for fa5211c: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
❌ Gradle check result for c0d489c: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 9f25041: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #19631 +/- ##
============================================
+ Coverage 72.96% 72.99% +0.02%
+ Complexity 70655 70570 -85
============================================
Files 5725 5726 +1
Lines 323697 323764 +67
Branches 46875 46882 +7
============================================
+ Hits 236198 236330 +132
+ Misses 68436 68357 -79
- Partials 19063 19077 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
❌ Gradle check result for 973c04b: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
| // agent-sm libs - grant read access to avoid SecurityException with junit | ||
| for (URL url : JarHell.parseClassPath()) { | ||
| Path path = PathUtils.get(url.toURI()); | ||
| if (path.toString().contains("agent-sm") && Files.isDirectory(path.getParent())) { | ||
| Path agentSmRoot = path; | ||
| while (agentSmRoot != null && !agentSmRoot.endsWith("agent-sm")) { | ||
| agentSmRoot = agentSmRoot.getParent(); | ||
| } | ||
| if (agentSmRoot != null && Files.exists(agentSmRoot)) { | ||
| FilePermissionUtils.addDirectoryPath(perms, "agent-sm", agentSmRoot, "read,readlink", false); | ||
| break; | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Fixes SecurityException
java.lang.AssertionError: ERROR:An exception occurred processing Appender consoleSource:
DefaultErrorHandler.java@93
Throwable:
java.lang.SecurityException: Denied OPEN (read) access to file: /var/jenkins/workspace/gradle-check/search/libs/agent-sm/agent/build/distributions/opensearch-agent-policy-3.4.0-SNAPSHOT.jar, domain: ProtectionDomain (file:/home/ubuntu/.gradle/caches/modules-2/files-2.1/org.apache.lucene/lucene-test-framework/10.3.1/dc0c9079bf5c7d660989bb37e822cd53e65ae103/lucene-test-framework-10.3.1.jar <no signer certificates>)
jdk.internal.loader.ClassLoaders$AppClassLoader@73d16e93
<no principals>
java.security.Permissions@5ec6f378 (
)
at java.base/java.nio.file.Files.newByteChannel(Files.java:393)
at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:371)
at java.base/java.nio.file.Files.newInputStream(Files.java:154)
at java.base/jdk.internal.loader.BootLoader$PackageHelper.getManifest(BootLoader.java:301)
at java.base/jdk.internal.loader.BootLoader$PackageHelper.definePackage(BootLoader.java:246)
at java.base/jdk.internal.loader.BootLoader.getDefinedPackage(BootLoader.java:198)
at java.base/jdk.internal.loader.BootLoader.definePackage(BootLoader.java:186)
at java.base/java.lang.Class.getPackage(Class.java:1118)
at org.apache.logging.log4j.core.impl.ThrowableProxyHelper.toCacheEntry(ThrowableProxyHelper.java:176)
at org.apache.logging.log4j.core.impl.ThrowableProxyHelper.toExtendedStackTrace(ThrowableProxyHelper.java:112)
at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:113)
at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:97)
at org.apache.logging.log4j.core.impl.MutableLogEvent.getThrownProxy(MutableLogEvent.java:354)
at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:63)
at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:44)
at org.apache.logging.log4j.core.layout.PatternLayout$PatternFormatterPatternSerializer.toSerializable(PatternLayout.java:384)
at org.apache.logging.log4j.core.layout.PatternLayout.toText(PatternLayout.java:240)
at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:225)
at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:59)
Received on tests like ./gradlew :plugins:discovery-gce:test --tests GceDiscoveryTests.testIllegalSettingsMissingZone -i
Signed-off-by: Craig Perkins <cwperx@amazon.com>
|
❌ Gradle check result for f5f358e: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Description
This PR ensure jdk 21 minimum compatibility across all sub-projects (a few projects had it set to Java 8) and create replacement for java.security.Policy which is marked for removal
Related Issues
Related to #18339
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.