diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d258a22..ab465f20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [11] + java: [11, 22] steps: - uses: actions/checkout@v4 @@ -19,7 +19,7 @@ jobs: with: distribution: 'temurin' java-version: ${{ matrix.java }} - - uses: gradle/wrapper-validation-action@v2 + - uses: gradle/actions/wrapper-validation@v3 - uses: gradle/actions/setup-gradle@v3 - run: ./gradlew assemble - run: ./gradlew check diff --git a/CHANGELOG.md b/CHANGELOG.md index 092321ae..15f27b13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - authentication/KratosBrowserAuthentication.js - A script to authenticate with Kratos using the browser flow ### Changed +- Update minimum ZAP version to 2.15.0. - Use Prettier to format all JavaScript scripts. - Update the following scripts to implement the `getMetadata()` function with revised metadata: - active/Cross Site WebSocket Hijacking.js diff --git a/build.gradle.kts b/build.gradle.kts index 3a5af369..61d202c9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ import org.zaproxy.gradle.addon.misc.ConvertMarkdownToHtml plugins { `java-library` - id("org.zaproxy.add-on") version "0.10.0" + id("org.zaproxy.add-on") version "0.11.0" id("org.zaproxy.crowdin") version "0.4.0" id("com.diffplug.spotless") id("com.github.node-gradle.node") version "7.0.2" @@ -22,7 +22,7 @@ val scriptsDir = layout.buildDirectory.dir("scripts") zapAddOn { addOnId.set("communityScripts") addOnName.set("Community Scripts") - zapVersion.set("2.14.0") + zapVersion.set("2.15.0") addOnStatus.set(AddOnStatus.ALPHA) releaseLink.set("https://github.com/zaproxy/community-scripts/compare/v@PREVIOUS_VERSION@...v@CURRENT_VERSION@") @@ -49,12 +49,12 @@ crowdin { } dependencies { - testImplementation("org.junit.jupiter:junit-jupiter:5.9.3") + testImplementation("org.junit.jupiter:junit-jupiter:5.10.2") testRuntimeOnly("org.junit.platform:junit-platform-launcher") - testImplementation("commons-io:commons-io:2.13.0") - testImplementation("org.assertj:assertj-core:3.24.2") - testImplementation("org.apache.commons:commons-lang3:3.12.0") + testImplementation("commons-io:commons-io:2.16.1") + testImplementation("org.assertj:assertj-core:3.26.0") + testImplementation("org.apache.commons:commons-lang3:3.14.0") // The following versions should match the ones of the add-ons. testImplementation("org.codehaus.groovy:groovy-all:3.0.14") @@ -62,7 +62,7 @@ dependencies { testImplementation("org.graalvm.js:js:$graalJsVersion") testImplementation("org.graalvm.js:js-scriptengine:$graalJsVersion") testImplementation("org.jruby:jruby-complete:1.7.4") - testImplementation("org.zaproxy:zest:0.18.0") + testImplementation("org.zaproxy:zest:0.21.0") testImplementation("org.python:jython-standalone:2.7.2") } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d64cd491..e6441136 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a7a990ab..515ab9d5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=c16d517b50dd28b3f5838f0e844b7520b8f1eb610f2f29de7e4e04a1b7c9c79b -distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip +distributionSha256Sum=f8b4f4772d302c8ff580bc40d0f56e715de69b163546944f787c87abf209c961 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 1aa94a42..b740cf13 100755 --- a/gradlew +++ b/gradlew @@ -55,7 +55,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index 93e3f59f..25da30db 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail diff --git a/settings.gradle.kts b/settings.gradle.kts index 975fc533..0206afb2 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("org.zaproxy.common.settings") version "0.2.0" + id("org.zaproxy.common.settings") version "0.3.0" id("com.diffplug.spotless") version "6.25.0" apply false } diff --git a/src/test/java/org/zaproxy/VerifyScripts.java b/src/test/java/org/zaproxy/VerifyScripts.java index d61280aa..cfed8d5a 100644 --- a/src/test/java/org/zaproxy/VerifyScripts.java +++ b/src/test/java/org/zaproxy/VerifyScripts.java @@ -52,6 +52,7 @@ import org.jruby.embed.jsr223.JRubyEngineFactory; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -102,6 +103,10 @@ private static Stream scriptsGroovy() { } private static Stream scriptsJavaScript() { + // Graal JS version being used does not yet support Java 22+ + if (JRE.JAVA_22.compareTo(JRE.currentVersion()) <= 0) { + return testData(".js", script -> {}); + } Engine engine = Engine.newBuilder() .allowExperimentalOptions(true)