From 1a5dccd365a75aa56bbac36bfedaa94f70758580 Mon Sep 17 00:00:00 2001 From: Andrea Marziali Date: Thu, 16 Jan 2025 10:01:48 +0100 Subject: [PATCH] Support vertx 5 --- .../vertx-web-4.0/build.gradle | 23 +- .../vertx-web-4.0/gradle.lockfile | 333 +++++++++--------- .../client/VertxHttpClientForkedTest.groovy | 81 +++++ .../core/BufferInstrumentationTest.groovy | 67 ++++ .../core/MultiMapInstrumentationTest.groovy | 184 ++++++++++ .../server/IastVertxHttp1ServerTest.groovy | 10 + .../server/IastVertxHttp2ServerTest.groovy | 64 ++++ .../server/IastVertxHttpServerTest.groovy | 82 +++++ .../groovy/server/IastVertxSinksTest.groovy | 95 +++++ .../server/VertxHttpServerForkedTest.groovy | 170 +++++++++ .../server/VertxInactiveAppSecTest.groovy | 15 + ...VertxMiddlewareHttpServerForkedTest.groovy | 44 +++ .../groovy/server/VertxServer.groovy | 52 +++ .../server/VertxSubrouterForkedTest.groovy | 22 ++ .../java/server/IastSinksVerticle.java | 61 ++++ .../java/server/IastSourcesVerticle.java | 179 ++++++++++ .../server/VertxMiddlewareTestServer.java | 17 + .../java/server/VertxSubrouterTestServer.java | 12 + .../java/server/VertxTestServer.java | 284 +++++++++++++++ ...rverResponseEndHandlerInstrumentation.java | 1 - .../server/RouteHandlerInstrumentation.java | 1 - .../vertx_4_0/server/VertxDecorator.java | 56 +-- .../server/VertxImplInstrumentation.java | 4 +- gradle/java_no_deps.gradle | 15 +- 24 files changed, 1630 insertions(+), 242 deletions(-) create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/client/VertxHttpClientForkedTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/BufferInstrumentationTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/MultiMapInstrumentationTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp1ServerTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp2ServerTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttpServerTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxSinksTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxInactiveAppSecTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxMiddlewareHttpServerForkedTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxServer.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxSubrouterForkedTest.groovy create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSinksVerticle.java create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSourcesVerticle.java create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxMiddlewareTestServer.java create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxSubrouterTestServer.java create mode 100644 dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/build.gradle b/dd-java-agent/instrumentation/vertx-web-4.0/build.gradle index 1f3deaca347..8cf087b22c3 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/build.gradle +++ b/dd-java-agent/instrumentation/vertx-web-4.0/build.gradle @@ -2,7 +2,11 @@ ext { // vertx-web doesn't support Java 17 until v4.2 maxJavaVersionForTests = JavaVersion.VERSION_15 - latestDepTestMaxJavaVersionForTests = JavaVersion.VERSION_17 + // unbound it for latest + latestDepTestMinJavaVersionForTests = JavaVersion.VERSION_11 + latestDepForkedTestMinJavaVersionForTests = JavaVersion.VERSION_11 + latestDepTestMaxJavaVersionForTests = JavaVersion.VERSION_25 + latestDepForkedTestMaxJavaVersionForTests = JavaVersion.VERSION_25 } apply from: "$rootDir/gradle/java.gradle" @@ -11,12 +15,13 @@ muzzle { pass { group = 'io.vertx' module = "vertx-web" - versions = "[4.0.0,5)" + versions = "[4.0.0,)" assertInverse = true } } -addTestSuiteForDir('latestDepTest', 'test') +addTestSuiteForDir('latestDepTest', 'latestDepTest') +addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'latestDepTest') configurations { testArtifacts @@ -45,7 +50,13 @@ dependencies { testRuntimeOnly project(':dd-java-agent:instrumentation:jackson-core') testRuntimeOnly project(':dd-java-agent:instrumentation:netty-buffer-4') - // TODO support v>=4.5 - latestDepTestImplementation group: 'io.vertx', name: 'vertx-web', version: '4.4.+' - latestDepTestImplementation group: 'io.vertx', name: 'vertx-web-client', version: '4.4.+' + latestDepTestImplementation group: 'io.vertx', name: 'vertx-web', version: '+' + latestDepTestImplementation group: 'io.vertx', name: 'vertx-web-client', version: '+' +} + +[compileLatestDepTestJava, compileLatestDepForkedTestJava].each { + setJavaVersion(it, 11) +} +[compileLatestDepForkedTestGroovy, compileLatestDepTestGroovy].each { + it.javaLauncher = getJavaLauncherFor(11) } diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/gradle.lockfile b/dd-java-agent/instrumentation/vertx-web-4.0/gradle.lockfile index aa6cac8abbc..9d5fda14035 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx-web-4.0/gradle.lockfile @@ -1,132 +1,115 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.randelshofer:fastdoubleparser:0.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.beust:jcommander:1.78=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.3=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.11.3=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.2=compileClasspath -com.fasterxml.jackson.core:jackson-core:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.2=compileClasspath -com.fasterxml.jackson:jackson-bom:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jffi:1.3.13=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.17=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.16=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.19=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.22=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +cafe.cryptography:curve25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.beust:jcommander:1.78=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.3=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.11.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.16.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.13=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.17=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.16=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.19=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.22=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.2.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.spotbugs:spotbugs-annotations:4.7.3=spotbugs com.github.spotbugs:spotbugs:4.7.3=spotbugs -com.github.stefanbirkner:system-rules:1.19.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.auto.service:auto-service-annotations:1.0-rc7=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.0-rc7=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:0.10=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.github.stefanbirkner:system-rules:1.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.auto.service:auto-service-annotations:1.0-rc7=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.0-rc7=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:0.10=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.9.1=spotbugs -com.google.errorprone:error_prone_annotations:2.2.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:27.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.thoughtworks.qdox:qdox:1.12.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.2.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:27.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.re2j:re2j:1.7=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath commons-codec:commons-codec:1.15=spotbugs -commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.1=compileClasspath -info.picocli:picocli:4.6.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-buffer:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.74.Final=compileClasspath -io.netty:netty-codec-dns:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-dns:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.1.74.Final=compileClasspath -io.netty:netty-codec-http2:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-http2:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.1.74.Final=compileClasspath -io.netty:netty-codec-http:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-http:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.1.74.Final=compileClasspath -io.netty:netty-codec-socks:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-socks:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.1.74.Final=compileClasspath -io.netty:netty-codec:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.1.74.Final=compileClasspath -io.netty:netty-common:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-common:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.1.74.Final=compileClasspath -io.netty:netty-handler-proxy:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-handler-proxy:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.1.74.Final=compileClasspath -io.netty:netty-handler:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-handler:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.1.74.Final=compileClasspath -io.netty:netty-resolver-dns:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.1.74.Final=compileClasspath -io.netty:netty-resolver:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.1.74.Final=compileClasspath -io.netty:netty-tcnative-classes:2.0.48.Final=compileClasspath -io.netty:netty-transport-native-unix-common:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.49.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.1.74.Final=compileClasspath -io.sqreen:libsqreen:11.2.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.vertx:vertx-auth-common:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-auth-common:4.2.7=compileClasspath -io.vertx:vertx-auth-common:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.vertx:vertx-bridge-common:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-bridge-common:4.2.7=compileClasspath -io.vertx:vertx-bridge-common:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.vertx:vertx-core:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-core:4.2.7=compileClasspath -io.vertx:vertx-core:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.vertx:vertx-uri-template:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +info.picocli:picocli:4.6.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-buffer:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-buffer:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-dns:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-http2:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-http:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-marshalling:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-protobuf:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-socks:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-common:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-handler-proxy:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-handler:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-resolver-dns:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-resolver:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport:4.2.0.RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:11.2.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.vertx:vertx-auth-common:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.vertx:vertx-auth-common:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-bridge-common:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.vertx:vertx-bridge-common:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core-logging:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.vertx:vertx-core:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-uri-template:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web-client:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web-client:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.vertx:vertx-web-common:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web-common:4.2.7=compileClasspath -io.vertx:vertx-web-common:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.vertx:vertx-web:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web:4.2.7=compileClasspath -io.vertx:vertx-web:4.4.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.vertx:vertx-web-client:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web-common:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.vertx:vertx-web-common:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.vertx:vertx-web:5.0.0.CR3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:1.2.0=spotbugs -jline:jline:2.14.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -junit:junit-dep:4.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.14.18=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.14.18=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -net.jcip:jcip-annotations:1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +jline:jline:2.14.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +junit:junit-dep:4.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.14.18=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.14.18=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +net.jcip:jcip-annotations:1.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:11.4=spotbugs -org.apache.ant:ant-antlr:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.ant:ant-antlr:1.10.12=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.apache.ant:ant-antlr:1.9.15=codenarc -org.apache.ant:ant-junit:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.ant:ant-junit:1.10.12=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.apache.ant:ant-junit:1.9.15=codenarc -org.apache.ant:ant-launcher:1.10.12=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.ant:ant:1.10.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.ant:ant-launcher:1.10.12=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.ant:ant:1.10.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.bcel:bcel:6.5.0=spotbugs org.apache.commons:commons-lang3:3.12.0=spotbugs org.apache.commons:commons-text:1.10.0=spotbugs @@ -135,84 +118,86 @@ org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=spotbugs org.apache.httpcomponents.core5:httpcore5:5.1.3=spotbugs org.apache.logging.log4j:log4j-api:2.19.0=spotbugs org.apache.logging.log4j:log4j-core:2.19.0=spotbugs -org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath -org.checkerframework:checker-qual:2.5.2=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.codehaus.groovy:groovy-all:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:2.5.2=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-all:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:2.5.14=codenarc -org.codehaus.groovy:groovy-ant:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-astbuilder:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-cli-picocli:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-console:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-datetime:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-docgenerator:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-ant:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-astbuilder:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-cli-picocli:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-console:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-datetime:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-docgenerator:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-groovydoc:2.5.14=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-groovysh:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-jmx:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-groovydoc:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-groovysh:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-jmx:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-json:2.5.14=codenarc -org.codehaus.groovy:groovy-json:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-jsr223:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-macro:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-nio:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-servlet:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-sql:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-swing:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-jsr223:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-macro:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-nio:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-servlet:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-sql:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-swing:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:2.5.14=codenarc -org.codehaus.groovy:groovy-templates:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-test-junit5:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-test:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-testng:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-test-junit5:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-test:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-testng:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-xml:2.5.14=codenarc -org.codehaus.groovy:groovy-xml:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-xml:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy:2.5.14=codenarc -org.codehaus.groovy:groovy:3.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.17=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy:3.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.17=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codenarc:CodeNarc:2.2.0=codenarc org.dom4j:dom4j:2.1.3=spotbugs -org.eclipse.jetty:jetty-http:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-io:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-server:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-util:9.4.56.v20240826=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-http:9.4.56.v20240826=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-io:9.4.56.v20240826=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-server:9.4.56.v20240826=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-util:9.4.56.v20240826=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:1.1=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core:3.3.0=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.9.2=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:2.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core:3.3.0=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.9.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.9.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.9.0=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.junit.platform:junit-platform-commons:1.9.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.9.0=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.junit.platform:junit-platform-engine:1.9.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.9.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.9.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.9.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.9.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.9.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit:junit-bom:5.9.1=spotbugs -org.junit:junit-bom:5.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.2=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.4=spotbugs org.ow2.asm:asm-commons:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath org.ow2.asm:asm-commons:9.4=spotbugs -org.ow2.asm:asm-commons:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath org.ow2.asm:asm-tree:9.4=spotbugs -org.ow2.asm:asm-tree:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.2=instrumentPluginClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.2=instrumentPluginClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.4=spotbugs org.ow2.asm:asm:9.2=instrumentPluginClasspath,muzzleTooling,runtimeClasspath org.ow2.asm:asm:9.4=spotbugs -org.ow2.asm:asm:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,instrumentPluginClasspath,latestDepTestCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath -org.slf4j:slf4j-api:1.7.32=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=compileClasspath,instrumentPluginClasspath,latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath +org.slf4j:slf4j-api:1.7.32=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.0=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.0=spotbugsSlf4j -org.spockframework:spock-core:2.2-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-junit4:2.2-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.testng:testng:7.5=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.webjars:jquery:3.5.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.2-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-junit4:2.2-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.testng:testng:7.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.webjars:jquery:3.5.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:4.4.3=spotbugs xml-apis:xml-apis:1.4.01=spotbugs empty=spotbugsPlugins,testArtifacts diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/client/VertxHttpClientForkedTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/client/VertxHttpClientForkedTest.groovy new file mode 100644 index 00000000000..0e528befe84 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/client/VertxHttpClientForkedTest.groovy @@ -0,0 +1,81 @@ +package client + +import datadog.trace.agent.test.base.HttpClientTest +import datadog.trace.agent.test.naming.TestingNettyHttpNamingConventions +import datadog.trace.instrumentation.netty41.client.NettyHttpClientDecorator +import io.vertx.core.Vertx +import io.vertx.core.VertxOptions +import io.vertx.core.buffer.Buffer +import io.vertx.core.http.HttpMethod +import io.vertx.ext.web.client.HttpResponse +import io.vertx.ext.web.client.WebClient +import io.vertx.ext.web.client.WebClientOptions +import spock.lang.AutoCleanup +import spock.lang.Shared + +import java.util.concurrent.CompletableFuture +import java.util.concurrent.TimeUnit + +class VertxHttpClientForkedTest extends HttpClientTest implements TestingNettyHttpNamingConventions.ClientV0 { + @Override + boolean useStrictTraceWrites() { + return false + } + + @AutoCleanup + @Shared + def vertx = Vertx.vertx(new VertxOptions()) + + @Shared + def clientOptions = new WebClientOptions() + // vertx default is in seconds + .setConnectTimeout(TimeUnit.SECONDS.toSeconds(3) as int) + .setIdleTimeout(TimeUnit.SECONDS.toSeconds(5) as int) + + @AutoCleanup + @Shared + def httpClient = WebClient.create(vertx, clientOptions) + + @Override + int doRequest(String method, URI uri, Map headers, String body, Closure callback) { + return doRequest(method, uri, headers, body, callback, -1) + } + + int doRequest(String method, URI uri, Map headers, String body, Closure callback, long timeout) { + CompletableFuture future = new CompletableFuture<>() + + def request = httpClient.request(HttpMethod.valueOf(method), uri.getPort(), uri.getHost(), uri.toString()) + headers.each { request.putHeader(it.key, it.value) } + request.sendBuffer(Buffer.buffer(body)).onSuccess { response -> + try { + callback?.call() + future.complete(response) + } catch (Exception e) { + future.completeExceptionally(e) + } + } + + def response = future.get(10, TimeUnit.SECONDS) + return response == null ? 0 : response.statusCode() + } + + @Override + CharSequence component() { + return NettyHttpClientDecorator.DECORATE.component() + } + + @Override + boolean testRedirects() { + false + } + + @Override + boolean testConnectionFailure() { + false + } + + boolean testRemoteConnection() { + // FIXME: figure out how to configure timeouts. + false + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/BufferInstrumentationTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/BufferInstrumentationTest.groovy new file mode 100644 index 00000000000..9d7992d9e37 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/BufferInstrumentationTest.groovy @@ -0,0 +1,67 @@ +package core + +import datadog.trace.agent.test.AgentTestRunner +import datadog.trace.api.iast.InstrumentationBridge +import datadog.trace.api.iast.SourceTypes +import datadog.trace.api.iast.Taintable +import datadog.trace.api.iast.propagation.PropagationModule +import groovy.transform.CompileDynamic +import io.vertx.core.buffer.Buffer +import io.vertx.core.buffer.impl.BufferImpl + +@CompileDynamic +class BufferInstrumentationTest extends AgentTestRunner { + + @Override + protected void configurePreAgent() { + injectSysConfig('dd.iast.enabled', 'true') + } + + void 'test that Buffer.#methodName is instrumented'() { + given: + final module = Mock(PropagationModule) + InstrumentationBridge.registerIastModule(module) + final buffer = taintedInstance(SourceTypes.REQUEST_BODY) + + when: + method.call(buffer) + + then: + 1 * module.taintStringIfTainted(_, buffer) + + where: + methodName | method + 'toString()' | { Buffer b -> b.toString() } + 'toString(String)' | { Buffer b -> b.toString('UTF-8') } + } + + void 'test that Buffer.#methodName is instrumented'() { + given: + final module = Mock(PropagationModule) + InstrumentationBridge.registerIastModule(module) + final buffer = new BufferImpl() + final tainted = taintedInstance(SourceTypes.REQUEST_BODY) + + when: + method.call(buffer, tainted) + + then: + 1 * module.taintObjectIfTainted(buffer, tainted) + + where: + methodName | method + 'appendBuffer(Buffer)' | { Buffer b, Buffer taint -> b.appendBuffer(taint) } + 'appendBuffer(buffer, int, int)' | { Buffer b, Buffer taint -> b.appendBuffer(taint, 0, taint.length()) } + } + + private Buffer taintedInstance(final byte origin) { + final buffer = new BufferImpl('Hello World!') + if (buffer instanceof Taintable) { + final source = Mock(Taintable.Source) { + getOrigin() >> origin + } + (buffer as Taintable).$$DD$setSource(source) + } + return buffer + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/MultiMapInstrumentationTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/MultiMapInstrumentationTest.groovy new file mode 100644 index 00000000000..69223b107a1 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/core/MultiMapInstrumentationTest.groovy @@ -0,0 +1,184 @@ +package core + +import datadog.trace.agent.test.AgentTestRunner +import datadog.trace.api.iast.IastContext +import datadog.trace.api.iast.InstrumentationBridge +import datadog.trace.api.iast.SourceTypes +import datadog.trace.api.iast.Taintable +import datadog.trace.api.iast.propagation.PropagationModule +import datadog.trace.bootstrap.instrumentation.api.AgentTracer +import datadog.trace.bootstrap.instrumentation.api.TagContext +import groovy.transform.CompileDynamic +import io.netty.handler.codec.http.DefaultHttpHeaders +import io.netty.handler.codec.http2.DefaultHttp2Headers +import io.vertx.core.MultiMap +import io.vertx.core.http.impl.headers.HeadersAdaptor +import io.vertx.core.http.impl.headers.HeadersMultiMap +import io.vertx.core.http.impl.headers.Http2HeadersAdaptor +import spock.lang.IgnoreIf + +import static datadog.trace.api.iast.SourceTypes.namedSource + +@CompileDynamic +class MultiMapInstrumentationTest extends AgentTestRunner { + + private Object iastCtx + + @Override + protected void configurePreAgent() { + injectSysConfig('dd.iast.enabled', 'true') + } + + void setup() { + iastCtx = Stub(IastContext) + } + + void 'test that #name get() is instrumented'() { + given: + final origin = SourceTypes.REQUEST_PARAMETER_VALUE + addAll([key: 'value'], instance) + final module = Mock(PropagationModule) + InstrumentationBridge.registerIastModule(module) + + when: + runUnderIastTrace { instance.get('key') } + + then: + 1 * module.findSource(iastCtx, instance) >> { null } + 0 * _ + + when: + runUnderIastTrace { instance.get('key') } + + then: + 1 * module.findSource(iastCtx, instance) >> { mockedSource(origin) } + 1 * module.taintString(iastCtx, 'value', origin, 'key') + + where: + instance << multiMaps() + name = instance.getClass().simpleName + } + + void 'test that #name getAll() is instrumented'() { + given: + final origin = SourceTypes.REQUEST_PARAMETER_VALUE + addAll([[key: 'value1'], [key: 'value2']], instance) + final module = Mock(PropagationModule) + InstrumentationBridge.registerIastModule(module) + + when: + runUnderIastTrace { instance.getAll('key') } + + then: + 1 * module.findSource(iastCtx, instance) >> { null } + 0 * _ + + when: + runUnderIastTrace { instance.getAll('key') } + + then: + 1 * module.findSource(iastCtx, instance) >> { mockedSource(origin) } + 1 * module.taintString(iastCtx, 'value1', origin, 'key') + 1 * module.taintString(iastCtx, 'value2', origin, 'key') + + where: + instance << multiMaps() + name = instance.getClass().simpleName + } + + void 'test that #name names() is instrumented'() { + given: + final origin = SourceTypes.REQUEST_PARAMETER_VALUE + addAll([[key: 'value1'], [key: 'value2']], instance) + final module = Mock(PropagationModule) + InstrumentationBridge.registerIastModule(module) + + when: + runUnderIastTrace { instance.names() } + + then: + 1 * module.findSource(iastCtx, instance) >> { null } + 0 * _ + + when: + runUnderIastTrace { instance.names() } + + then: + 1 * module.findSource(iastCtx, instance) >> { mockedSource(origin) } + 1 * module.taintString(iastCtx, 'key', namedSource(origin), 'key') + + where: + instance << multiMaps() + name = instance.getClass().simpleName + } + + // some implementations do not override the entries() method so we will lose propagation in those cases + @IgnoreIf({ !MultiMapInstrumentationTest.hasMethod(data['instance'].class, 'entries')}) + void 'test that #name entries() is instrumented'() { + given: + final origin = SourceTypes.REQUEST_PARAMETER_VALUE + addAll([[key: 'value1'], [key: 'value2']], instance) + final module = Mock(PropagationModule) + InstrumentationBridge.registerIastModule(module) + + when: + runUnderIastTrace { instance.entries() } + + then: + 1 * module.findSource(iastCtx, instance) >> { null } + 0 * _ + + when: + runUnderIastTrace { instance.entries() } + + then: + 1 * module.findSource(iastCtx, instance) >> { mockedSource(origin) } + 1 * module.taintString(iastCtx, 'key', namedSource(origin), 'key') + 1 * module.taintString(iastCtx, 'value1', origin, 'key') + 1 * module.taintString(iastCtx, 'value2', origin, 'key') + + where: + instance << multiMaps() + name = instance.getClass().simpleName + } + + protected E runUnderIastTrace(Closure cl) { + final ddctx = new TagContext().withRequestContextDataIast(iastCtx) + final span = TEST_TRACER.startSpan("test", "test-iast-span", ddctx) + try { + return AgentTracer.activateSpan(span).withCloseable(cl) + } finally { + span.finish() + } + } + + private mockedSource(final byte origin) { + return Mock(Taintable.Source) { + getOrigin() >> origin + } + } + + private static boolean hasMethod(final Class target, final String name) { + try { + return target.getDeclaredMethods().any { it.name == name } + } catch (Throwable e) { + return false + } + } + + private List multiMaps() { + return [ + new HeadersMultiMap(), + new HeadersAdaptor(new DefaultHttpHeaders()), + new Http2HeadersAdaptor(new DefaultHttp2Headers()) + ] + } + + private static void addAll(final Map map, final MultiMap headers) { + map.each { key, value -> headers.add(key, value) } + } + + private static void addAll(final List> list, final MultiMap headers) { + list.each { addAll(it, headers) } + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp1ServerTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp1ServerTest.groovy new file mode 100644 index 00000000000..2d35d6c9634 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp1ServerTest.groovy @@ -0,0 +1,10 @@ +package server + +import datadog.trace.agent.test.utils.OkHttpUtils +import okhttp3.OkHttpClient +import okhttp3.Protocol + +class IastVertxHttp1ServerTest extends IastVertxHttpServerTest { + + OkHttpClient client = OkHttpUtils.clientBuilder().protocols([Protocol.HTTP_1_1]).build() +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp2ServerTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp2ServerTest.groovy new file mode 100644 index 00000000000..5f08aa82f86 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttp2ServerTest.groovy @@ -0,0 +1,64 @@ +package server + +import datadog.trace.agent.test.utils.OkHttpUtils +import spock.lang.Ignore + +import javax.net.ssl.HostnameVerifier +import javax.net.ssl.SSLContext +import javax.net.ssl.SSLSession +import javax.net.ssl.SSLSocketFactory +import javax.net.ssl.TrustManager +import javax.net.ssl.X509TrustManager +import java.security.SecureRandom +import java.security.cert.CertificateException +import java.security.cert.X509Certificate + +// http2 seems to be not supported from the tracer +@Ignore +class IastVertxHttp2ServerTest extends IastVertxHttpServerTest { + + def setupSpec() { + final trustManager = trustManager() + client = OkHttpUtils.clientBuilder() + .sslSocketFactory(socketFactory(trustManager), trustManager) + .hostnameVerifier(hostnameVerifier()) + .build() + } + + @Override + boolean isHttps() { + true + } + + private static HostnameVerifier hostnameVerifier() { + return new HostnameVerifier() { + @Override + boolean verify(String s, SSLSession sslSession) { + true + } + } + } + + private static X509TrustManager trustManager() { + return new X509TrustManager() { + @Override + void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + } + + @Override + void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException { + } + + @Override + X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0] + } + } + } + + private static SSLSocketFactory socketFactory(final X509TrustManager trustManager) { + final sslContext = SSLContext.getInstance("TLSv1.2") + sslContext.init(null, [trustManager].toArray(new TrustManager[0]), new SecureRandom()) + return sslContext.getSocketFactory() + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttpServerTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttpServerTest.groovy new file mode 100644 index 00000000000..bf2f6491823 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxHttpServerTest.groovy @@ -0,0 +1,82 @@ +package server + +import com.datadog.iast.test.IastSourcesTest +import datadog.trace.agent.test.base.HttpServer +import io.vertx.core.DeploymentOptions +import io.vertx.core.Vertx +import io.vertx.core.http.HttpServerRequest +import io.vertx.core.json.JsonObject +import okhttp3.MediaType +import okhttp3.Request +import okhttp3.RequestBody + +import java.util.concurrent.CompletableFuture + +abstract class IastVertxHttpServerTest extends IastSourcesTest { + + @Override + HttpServer server() { + return new IastVertxServer() + } + + boolean isHttps() { + false + } + + //FIXME: does not work with latestDep + @Override + protected boolean ignoreParameters() { + true + } + + void 'test event bus'() { + when: + final url = "${address}/iast/sources/eventBus" + final body = RequestBody.create(MediaType.get('application/json'), '{ "name": "value" }') + final request = new Request.Builder().url(url).post(body).build() + final response = client.newCall(request).execute() + + then: + response.code() == 200 + response.body().string() == 'OK' + } + + class IastVertxServer implements HttpServer { + private Vertx server + private port + + @Override + void start() { + server = Vertx.vertx() + final future = new CompletableFuture<>() + server.eventBus().localConsumer('PORT_DATA') + .handler({ message -> + port = message.body() + message.reply(null) + future.complete(null) + }) + final deployment = new DeploymentOptions() + .setInstances(1) + .setConfig(new JsonObject().put('https', isHttps())) + server.deployVerticle('server.IastSourcesVerticle', deployment).await() + future.get() + } + + @Override + void stop() { + server.close() + } + + @Override + URI address() { + return new URI("http${https ? 's' : ''}://localhost:$port/") + } + } + + // Cookies not supported in Vert.x 4.0.0 + @Override + protected boolean ignoreCookies() { + final hasCookies = HttpServerRequest.declaredMethods.any { it.name == 'cookies' } + return !hasCookies + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxSinksTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxSinksTest.groovy new file mode 100644 index 00000000000..3ec89d86398 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/IastVertxSinksTest.groovy @@ -0,0 +1,95 @@ +package server + +import com.datadog.iast.test.IastHttpServerTest +import datadog.trace.agent.test.base.HttpServer +import datadog.trace.api.iast.InstrumentationBridge +import datadog.trace.api.iast.sink.UnvalidatedRedirectModule +import io.vertx.core.DeploymentOptions +import io.vertx.core.Vertx +import io.vertx.core.internal.VertxInternal +import okhttp3.Request + +import java.util.concurrent.CompletableFuture + +class IastVertxSinksTest extends IastHttpServerTest { + + @Override + HttpServer server() { + return new Vertx40Server() + } + + + + void 'test unvalidated redirect reroute1'() { + given: + final module = Mock(UnvalidatedRedirectModule) + InstrumentationBridge.registerIastModule(module) + final url = "${address}/iast/sinks/reroute1?path=rerouted" + final request = new Request.Builder().url(url).build() + + when: + client.newCall(request).execute() + + then: + 1 * module.onRedirect("rerouted") + } + + void 'test unvalidated redirect reroute2'() { + given: + final module = Mock(UnvalidatedRedirectModule) + InstrumentationBridge.registerIastModule(module) + final url = "${address}/iast/sinks/reroute2?path=rerouted" + final request = new Request.Builder().url(url).build() + + when: + client.newCall(request).execute() + + then: + 1 * module.onRedirect("rerouted") + } + + void 'test unvalidated redirect location header'() { + given: + final module = Mock(UnvalidatedRedirectModule) + InstrumentationBridge.registerIastModule(module) + final url = "${address}/iast/sinks/redirectheader?name=Location&value=path" + final request = new Request.Builder().url(url).build() + + when: + client.newCall(request).execute() + + then: + 1 * module.onHeader("Location", "path") + } + + private class Vertx40Server implements HttpServer { + private VertxInternal server + private int port = 0 + + @Override + void start() { + server = Vertx.vertx() + final future = new CompletableFuture<>() + server.eventBus().localConsumer('PORT_DATA') + .handler({ message -> + port = message.body() + message.reply(null) + future.complete(null) + }) + final deployment = new DeploymentOptions() + .setInstances(1) + server.deployVerticle('server.IastSinksVerticle', deployment).await() + future.get() + } + + @Override + void stop() { + server.close() + } + + @Override + URI address() { + return new URI("http://localhost:$port/") + } + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy new file mode 100644 index 00000000000..a6cf1aa49a3 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy @@ -0,0 +1,170 @@ +package server + +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.LOGIN +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS + +import datadog.trace.agent.test.asserts.TraceAssert +import datadog.trace.agent.test.base.HttpServer +import datadog.trace.agent.test.base.HttpServerTest +import datadog.trace.api.DDSpanTypes +import datadog.trace.bootstrap.instrumentation.api.Tags +import datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator +import datadog.trace.instrumentation.vertx_4_0.server.VertxDecorator +import io.vertx.core.AbstractVerticle +import io.vertx.core.Vertx + +class VertxHttpServerForkedTest extends HttpServerTest { + @Override + HttpServer server() { + return new VertxServer(verticle(), routerBasePath()) + } + + protected Class verticle() { + VertxTestServer + } + + String routerBasePath() { + return "/" + } + + @Override + String component() { + return NettyHttpServerDecorator.DECORATE.component() + } + + @Override + String expectedOperationName() { + "netty.request" + } + + @Override + protected boolean enabledFinishTimingChecks() { + true + } + + @Override + String testPathParam() { + routerBasePath() + "path/:id/param" + } + + @Override + boolean testExceptionBody() { + // Vertx wraps the exception + false + } + + @Override + Map expectedIGPathParams() { + [id: '123'] + } + + @Override + boolean testRequestBody() { + //FIXME: it does not work with latestDep + false + } + + @Override + boolean testBodyUrlencoded() { + //FIXME: it does not work with latestDep + false + } + + @Override + boolean testBodyMultipart() { + true + } + + @Override + boolean testBodyJson() { + //FIXME: it does not work with latestDep + false + } + + @Override + boolean testBlocking() { + true + } + + @Override + boolean testBlockingOnResponse() { + true + } + + @Override + boolean isRequestBodyNoStreaming() { + true + } + + @Override + Class expectedExceptionType() { + return RuntimeException + } + + boolean testExceptionTag() { + true + } + + @Override + boolean hasDecodedResource() { + return false + } + + @Override + int spanCount(ServerEndpoint endpoint) { + if (endpoint == NOT_FOUND) { + return super.spanCount(endpoint) - 1 + } + return super.spanCount(endpoint) + } + + @Override + boolean hasHandlerSpan() { + true + } + + @Override + boolean testSessionId() { + true + } + + @Override + Serializable expectedServerSpanRoute(ServerEndpoint endpoint) { + switch (endpoint) { + case LOGIN: + case NOT_FOUND: + return null + case PATH_PARAM: + return testPathParam() + default: + return routerBasePath() + endpoint.relativePath() + } + } + + @Override + void handlerSpan(TraceAssert trace, ServerEndpoint endpoint = SUCCESS) { + if (endpoint == NOT_FOUND) { + return + } + trace.span { + serviceName expectedServiceName() + operationName "vertx.route-handler" + spanType DDSpanTypes.HTTP_SERVER + errored endpoint == ERROR || endpoint == EXCEPTION + childOfPrevious() + tags { + "$Tags.COMPONENT" VertxDecorator.DECORATE.component() + "$Tags.SPAN_KIND" Tags.SPAN_KIND_SERVER + "$Tags.HTTP_STATUS" Integer + if (endpoint == EXCEPTION && this.testExceptionTag()) { + errorTags(RuntimeException, EXCEPTION.body) + } + defaultTags() + } + } + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxInactiveAppSecTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxInactiveAppSecTest.groovy new file mode 100644 index 00000000000..31009d5c33c --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxInactiveAppSecTest.groovy @@ -0,0 +1,15 @@ +package server + +import com.datadog.appsec.AppSecInactiveHttpServerTest +import datadog.trace.agent.test.base.HttpServer + +class VertxInactiveAppSecTest extends AppSecInactiveHttpServerTest { + @Override + boolean isTestPathParam() { + true + } + + HttpServer server() { + new VertxServer(VertxTestServer, '/') + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxMiddlewareHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxMiddlewareHttpServerForkedTest.groovy new file mode 100644 index 00000000000..ca82d1aa6be --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxMiddlewareHttpServerForkedTest.groovy @@ -0,0 +1,44 @@ +package server + +import datadog.trace.agent.test.asserts.TraceAssert +import datadog.trace.api.DDSpanTypes +import datadog.trace.bootstrap.instrumentation.api.Tags +import datadog.trace.instrumentation.vertx_4_0.server.VertxDecorator +import io.vertx.core.AbstractVerticle + +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS + +class VertxMiddlewareHttpServerForkedTest extends VertxHttpServerForkedTest { + @Override + protected Class verticle() { + VertxMiddlewareTestServer + } + + @Override + int spanCount(ServerEndpoint endpoint) { + return 2 + (hasHandlerSpan() ? 1 : 0) + (hasResponseSpan(endpoint) ? 1 : 0) + } + + @Override + void handlerSpan(TraceAssert trace, ServerEndpoint endpoint = SUCCESS) { + trace.span { + serviceName expectedServiceName() + operationName "vertx.route-handler" + spanType DDSpanTypes.HTTP_SERVER + errored endpoint == ERROR || endpoint == EXCEPTION + childOfPrevious() + tags { + "$Tags.COMPONENT" VertxDecorator.DECORATE.component() + "$Tags.SPAN_KIND" Tags.SPAN_KIND_SERVER + "$Tags.HTTP_STATUS" Integer + "before" true + if (endpoint == EXCEPTION && this.testExceptionTag()) { + errorTags(RuntimeException, EXCEPTION.body) + } + defaultTags() + } + } + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxServer.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxServer.groovy new file mode 100644 index 00000000000..07ec84c9be2 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxServer.groovy @@ -0,0 +1,52 @@ +package server + +import datadog.trace.agent.test.base.HttpServer +import io.vertx.core.AbstractVerticle +import io.vertx.core.DeploymentOptions +import io.vertx.core.Vertx +import io.vertx.core.internal.VertxInternal +import io.vertx.core.json.JsonObject + +import java.util.concurrent.CompletableFuture + +class VertxServer implements HttpServer { + private VertxInternal server + private String routerBasePath + private port + Class verticle + + VertxServer(Class verticle, String routerBasePath) { + this.routerBasePath = routerBasePath + this.verticle = verticle + } + + @Override + void start() { + server = Vertx.vertx() + + final CompletableFuture future = new CompletableFuture<>() + server.eventBus().localConsumer("PORT_DATA") + .handler({ message -> + port = message.body() + message.reply(null) + future.complete(null) + }) + + server.deployVerticle(verticle.name, + new DeploymentOptions() + .setConfig(new JsonObject().put(VertxTestServer.CONFIG_HTTP_SERVER_PORT, 0)) + .setInstances(1)).await() + + future.get() + } + + @Override + void stop() { + server.close() + } + + @Override + URI address() { + return new URI("http://localhost:$port$routerBasePath") + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxSubrouterForkedTest.groovy b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxSubrouterForkedTest.groovy new file mode 100644 index 00000000000..b01e94c4065 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/groovy/server/VertxSubrouterForkedTest.groovy @@ -0,0 +1,22 @@ +package server + + +import io.vertx.core.AbstractVerticle + +class VertxSubrouterForkedTest extends VertxHttpServerForkedTest { + @Override + protected Class verticle() { + VertxSubrouterTestServer + } + + @Override + String routerBasePath() { + return "/sub/" + } + + @Override + boolean testEncodedQuery() { + // FIXME: test instrumentation gateway callback ... is failing for latest + false + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSinksVerticle.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSinksVerticle.java new file mode 100644 index 00000000000..a518d274e99 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSinksVerticle.java @@ -0,0 +1,61 @@ +package server; + +import io.vertx.core.AbstractVerticle; +import io.vertx.core.Promise; +import io.vertx.core.eventbus.EventBus; +import io.vertx.core.http.HttpMethod; +import io.vertx.core.http.HttpServerOptions; +import io.vertx.ext.web.Router; +import io.vertx.ext.web.handler.BodyHandler; + +public class IastSinksVerticle extends AbstractVerticle { + + @Override + public void start(final Promise startPromise) throws Exception { + final Router router = Router.router(vertx); + router.route().handler(BodyHandler.create()); + router + .route("/iast/sinks/reroute1") + .handler( + rc -> { + final String path = rc.request().getParam("path"); + rc.reroute(path); + }); + router + .route("/iast/sinks/reroute2") + .handler( + rc -> { + final String path = rc.request().getParam("path"); + rc.reroute(HttpMethod.GET, path); + }); + router + .route("/iast/sinks/redirectheader") + .handler( + rc -> { + final String name = rc.request().getParam("name"); + final String value = rc.request().getParam("value"); + rc.response().putHeader(name, value).end(); + }); + + final EventBus eventBus = vertx.eventBus(); + final HttpServerOptions serverOptions = new HttpServerOptions(); + serverOptions.setHandle100ContinueAutomatically(true); + vertx + .createHttpServer(serverOptions) + .requestHandler(router) + .listen(0) + .onSuccess( + server -> + eventBus + .request("PORT_DATA", server.actualPort()) + .andThen( + ar -> { + if (ar.succeeded()) { + startPromise.complete(); + } else { + startPromise.fail(ar.cause()); + } + })) + .onFailure(startPromise::fail); + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSourcesVerticle.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSourcesVerticle.java new file mode 100644 index 00000000000..35cef8bc955 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/IastSourcesVerticle.java @@ -0,0 +1,179 @@ +package server; + +import com.datadog.iast.taint.TaintedObjects; +import datadog.trace.api.iast.IastContext; +import io.vertx.core.AbstractVerticle; +import io.vertx.core.MultiMap; +import io.vertx.core.Promise; +import io.vertx.core.eventbus.EventBus; +import io.vertx.core.http.Cookie; +import io.vertx.core.http.HttpServerOptions; +import io.vertx.core.json.JsonObject; +import io.vertx.core.net.SelfSignedCertificate; +import io.vertx.ext.web.Router; +import io.vertx.ext.web.handler.BodyHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class IastSourcesVerticle extends AbstractVerticle { + + private static final String EVENT_BUS_ENDPOINT = "EVENT_BUS"; + + private static final Logger LOGGER = LoggerFactory.getLogger(IastSourcesVerticle.class); + + @Override + public void start(final Promise startPromise) throws Exception { + final Router router = Router.router(vertx); + router.route().handler(BodyHandler.create()); + router + .route("/iast/sources/header") + .handler( + rc -> { + final String value = rc.request().getHeader("name"); + rc.response().end("Received " + value); + }); + router + .route("/iast/sources/headers") + .handler( + rc -> { + final MultiMap value = rc.request().headers(); + rc.response().end("Received " + value.get("name")); + }); + router + .route("/iast/sources/cookie") + .handler( + rc -> { + final Cookie cookie = rc.request().getCookie("name"); + rc.response().end("Received " + cookie.getName() + " " + cookie.getValue()); + }); + router + .route("/iast/sources/path/:name") + .handler( + rc -> { + final String value = rc.pathParam("name"); + rc.response().end("Received " + value); + }); + router + .route("/iast/sources/parameter") + .handler( + rc -> { + final String value = rc.request().getParam("name"); + rc.response().end("Received " + value); + }); + router + .route("/iast/sources/parameters") + .handler( + rc -> { + final MultiMap value = rc.request().params(); + rc.response().end("Received " + value.get("name")); + }); + router + .route("/iast/sources/form") + .handler( + rc -> { + final String value = rc.request().getFormAttribute("name"); + rc.response().end("Received " + value); + }); + router + .route("/iast/sources/body/string") + .handler( + rc -> { + final String encoding = rc.request().getParam("encoding"); + if (encoding != null) { + rc.response().end("Received " + rc.body().asString(encoding)); + } else { + rc.response().end("Received " + rc.body().asString()); + } + }); + router + .route("/iast/sources/body/json") + .handler( + rc -> { + rc.response().end("Received " + rc.body().asJsonObject()); + }); + router + .route("/body/jsonArray") + .handler( + rc -> { + rc.response().end("Received " + rc.body().asJsonArray()); + }); + + router + .route("/iast/sources/eventBus") + .handler( + rc -> { + final JsonObject target = rc.body().asJsonObject(); + rc.vertx() + .eventBus() + .request(EVENT_BUS_ENDPOINT, target) + .andThen( + reply -> { + if (reply.succeeded()) { + rc.response().end(reply.result().body().toString()); + } else { + rc.fail(reply.cause()); + } + }); + }); + router + .route("/iast/vulnerabilities/insecureCookie") + .handler( + rc -> { + final String cookieName = rc.request().getParam("name"); + final String cookieValue = rc.request().getParam("value"); + final String secure = rc.request().getParam("secure"); + Cookie cookie = Cookie.cookie(cookieName, cookieValue); + if ("true".equals(secure)) { + cookie.setSecure(true); + } + rc.response().addCookie(cookie).end("Cookie Set"); + }); + + final EventBus eventBus = vertx.eventBus(); + eventBus.consumer( + EVENT_BUS_ENDPOINT, + message -> { + final JsonObject payload = (JsonObject) message.body(); + final String name = payload.getString("name"); + try { + final IastContext ctx = IastContext.Provider.get(); + if (ctx == null) { + throw new IllegalStateException("No IAST context present"); + } + final TaintedObjects to = ctx.getTaintedObjects(); + final boolean tainted = to.get(name) != null; + message.reply(tainted ? "OK" : "NO_OK"); + } catch (Throwable e) { + LOGGER.error("Failed to handle event bus message", e); + message.reply("NO_OK"); + } + }); + + final HttpServerOptions serverOptions = new HttpServerOptions(); + if (config().getBoolean("https")) { + final SelfSignedCertificate certificate = SelfSignedCertificate.create(); + serverOptions.setSsl(true); + serverOptions.setUseAlpn(true); + serverOptions.setTrustOptions(certificate.trustOptions()); + serverOptions.setKeyCertOptions(certificate.keyCertOptions()); + } + serverOptions.setHandle100ContinueAutomatically(true); + vertx + .createHttpServer(serverOptions) + .requestHandler(router) + .listen(0) + .onSuccess( + server -> + eventBus + .request("PORT_DATA", server.actualPort()) + .andThen( + ar -> { + if (ar.succeeded()) { + startPromise.complete(); + } else { + startPromise.fail(ar.cause()); + } + })) + .onFailure(startPromise::fail); + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxMiddlewareTestServer.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxMiddlewareTestServer.java new file mode 100644 index 00000000000..e77f1b6fb65 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxMiddlewareTestServer.java @@ -0,0 +1,17 @@ +package server; + +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import io.vertx.ext.web.Router; +import io.vertx.ext.web.RoutingContext; + +public class VertxMiddlewareTestServer extends VertxTestServer { + @Override + protected void customizeBeforeRoutes(Router router) { + router.route().handler(VertxMiddlewareTestServer::firstHandler); + } + + private static void firstHandler(final RoutingContext ctx) { + AgentTracer.activeSpan().setTag("before", true); + ctx.next(); + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxSubrouterTestServer.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxSubrouterTestServer.java new file mode 100644 index 00000000000..36f1814b1c6 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxSubrouterTestServer.java @@ -0,0 +1,12 @@ +package server; + +import io.vertx.ext.web.Router; + +public class VertxSubrouterTestServer extends VertxTestServer { + @Override + protected Router customizeAfterRoutes(Router configured) { + Router router = Router.router(vertx); + router.route("/sub/*").subRouter(configured); + return router; + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java new file mode 100644 index 00000000000..10dc9526df0 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java @@ -0,0 +1,284 @@ +package server; + +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_JSON; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_URLENCODED; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.FORWARDED; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_ENCODED_BOTH; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_ENCODED_QUERY; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.REDIRECT; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SESSION_ID; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.UNKNOWN; +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.USER_BLOCK; +import static datadog.trace.agent.test.utils.TraceUtils.runnableUnderTraceAsync; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeScope; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; + +import datadog.appsec.api.blocking.Blocking; +import datadog.trace.agent.test.base.HttpServerTest; +import datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint; +import io.vertx.core.AbstractVerticle; +import io.vertx.core.MultiMap; +import io.vertx.core.Promise; +import io.vertx.core.http.HttpServerOptions; +import io.vertx.core.json.JsonObject; +import io.vertx.ext.web.Router; +import io.vertx.ext.web.RoutingContext; +import io.vertx.ext.web.handler.BodyHandler; +import io.vertx.ext.web.handler.SessionHandler; +import io.vertx.ext.web.sstore.LocalSessionStore; + +public class VertxTestServer extends AbstractVerticle { + public static final String CONFIG_HTTP_SERVER_PORT = "http.server.port"; + public static final String PORT_DATA_ADDRESS = "PORT_DATA"; + + @Override + public void start(final Promise startPromise) { + final int port = config().getInteger(CONFIG_HTTP_SERVER_PORT); + Router router = Router.router(vertx); + + customizeBeforeRoutes(router); + + router + .route(SUCCESS.getPath()) + .handler( + ctx -> + controller( + ctx, + SUCCESS, + () -> + ctx.response().setStatusCode(SUCCESS.getStatus()).end(SUCCESS.getBody()))); + router + .route(FORWARDED.getPath()) + .handler( + ctx -> + controller( + ctx, + FORWARDED, + () -> + ctx.response() + .setStatusCode(FORWARDED.getStatus()) + .end(ctx.request().getHeader("x-forwarded-for")))); + router + .route(CREATED.getPath()) + .handler( + ctx -> + controller( + ctx, + CREATED, + () -> + ctx.request() + .bodyHandler( + body -> + ctx.response() + .setStatusCode(CREATED.getStatus()) + .end(CREATED.getBody() + ": " + body.toString())))); + router.route(BODY_URLENCODED.getPath()).handler(BodyHandler.create()); + router + .route(BODY_URLENCODED.getPath()) + .handler( + ctx -> + controller( + ctx, + BODY_URLENCODED, + () -> { + String res = convertFormAttributes(ctx); + ctx.response().setStatusCode(BODY_URLENCODED.getStatus()).end(res); + })); + router + .route(BODY_MULTIPART.getPath()) + .handler( + ctx -> + controller( + ctx, + BODY_MULTIPART, + () -> { + ctx.request().setExpectMultipart(true); + ctx.request() + .endHandler( + (_void) -> { + String res = convertFormAttributes(ctx); + ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); + }); + })); + router.route(BODY_JSON.getPath()).handler(BodyHandler.create()); + router + .route(BODY_JSON.getPath()) + .handler( + ctx -> + controller( + ctx, + BODY_JSON, + () -> { + JsonObject json = ctx.body().asJsonObject(); + ctx.response().setStatusCode(BODY_JSON.getStatus()).end(json.toString()); + })); + router + .route(QUERY_ENCODED_BOTH.getRawPath()) + .handler( + ctx -> + controller( + ctx, + QUERY_ENCODED_BOTH, + () -> + ctx.response() + .setStatusCode(QUERY_ENCODED_BOTH.getStatus()) + .end(QUERY_ENCODED_BOTH.bodyForQuery(ctx.request().query())))); + router + .route(QUERY_ENCODED_QUERY.getPath()) + .handler( + ctx -> + controller( + ctx, + QUERY_ENCODED_QUERY, + () -> + ctx.response() + .setStatusCode(QUERY_ENCODED_QUERY.getStatus()) + .end(QUERY_ENCODED_QUERY.bodyForQuery(ctx.request().query())))); + router + .route(QUERY_PARAM.getPath()) + .handler( + ctx -> + controller( + ctx, + QUERY_PARAM, + () -> + ctx.response() + .setStatusCode(QUERY_PARAM.getStatus()) + .end(ctx.request().query()))); + + router + .route(USER_BLOCK.getPath()) + .handler( + ctx -> + controller( + ctx, + USER_BLOCK, + () -> { + Blocking.forUser("user-to-block").blockIfMatch(); + ctx.response().end("Should not be reached"); + })); + + router + .route("/path/:id/param") + .handler( + ctx -> + controller( + ctx, + PATH_PARAM, + () -> + ctx.response() + .setStatusCode(PATH_PARAM.getStatus()) + .end(ctx.request().getParam("id")))); + router + .route(REDIRECT.getPath()) + .handler( + ctx -> + controller( + ctx, + REDIRECT, + () -> + ctx.response() + .setStatusCode(REDIRECT.getStatus()) + .putHeader("location", REDIRECT.getBody()) + .end())); + router + .route(ERROR.getPath()) + .handler( + ctx -> + controller( + ctx, + ERROR, + () -> ctx.response().setStatusCode(ERROR.getStatus()).end(ERROR.getBody()))); + router + .route(EXCEPTION.getPath()) + .handler(ctx -> controller(ctx, EXCEPTION, VertxTestServer::exception)); + + router + .route(SESSION_ID.getPath()) + .handler(SessionHandler.create(LocalSessionStore.create(vertx))); + router + .route(SESSION_ID.getPath()) + .handler( + ctx -> ctx.response().setStatusCode(SESSION_ID.getStatus()).end(ctx.session().id())); + + router = customizeAfterRoutes(router); + + vertx + .createHttpServer(new HttpServerOptions().setHandle100ContinueAutomatically(true)) + .requestHandler(router) + .listen(port) + .andThen( + event -> { + // send this though event bus and succeed deploy after successful response + int actualPort = event.result().actualPort(); + vertx + .eventBus() + .request(PORT_DATA_ADDRESS, actualPort) + .andThen( + ar -> { + if (ar.succeeded()) { + startPromise.complete(); + } else { + startPromise.fail(ar.cause()); + } + }); + }); + } + + private static String convertFormAttributes(RoutingContext ctx) { + String res = "["; + MultiMap entries = ctx.request().formAttributes(); + for (String name : entries.names()) { + if (name.equals("ignore")) { + continue; + } + if (res.length() > 1) { + res += ", "; + } + res += name; + res += ":["; + int i = 0; + for (String s : entries.getAll(name)) { + if (i++ > 0) { + res += ", "; + } + res += s; + } + res += ']'; + } + res += ']'; + return res; + } + + protected void customizeBeforeRoutes(Router router) {} + + protected Router customizeAfterRoutes(final Router router) { + return router; + } + + private static void exception() { + throw new RuntimeException(EXCEPTION.getBody()); + } + + private static void controller( + RoutingContext ctx, final ServerEndpoint endpoint, final Runnable runnable) { + assert activeSpan() != null : "Controller should have a parent span."; + assert activeScope().isAsyncPropagating() : "Scope should be propagating async."; + ctx.response() + .putHeader( + HttpServerTest.getIG_RESPONSE_HEADER(), HttpServerTest.getIG_RESPONSE_HEADER_VALUE()); + if (endpoint == NOT_FOUND || endpoint == UNKNOWN) { + runnable.run(); + return; + } + runnableUnderTraceAsync("controller", runnable); + } +} diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java index a9860531a15..5cfdf5767b2 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java @@ -28,7 +28,6 @@ public String[] helperClassNames() { packageName + ".EndHandlerWrapper", packageName + ".RouteHandlerWrapper", packageName + ".VertxDecorator", - packageName + ".VertxDecorator$VertxURIDataAdapter", }; } diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerInstrumentation.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerInstrumentation.java index 6d31efd5fe2..5cb72e52e65 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerInstrumentation.java @@ -29,7 +29,6 @@ public String[] helperClassNames() { packageName + ".EndHandlerWrapper", packageName + ".RouteHandlerWrapper", packageName + ".VertxDecorator", - packageName + ".VertxDecorator$VertxURIDataAdapter", }; } diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java index ec3877450c8..f79f53d8c6f 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java @@ -5,6 +5,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter; import datadog.trace.bootstrap.instrumentation.api.URIDataAdapterBase; +import datadog.trace.bootstrap.instrumentation.api.URIDefaultDataAdapter; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator; import io.vertx.core.http.HttpServerResponse; @@ -50,7 +51,7 @@ protected String method(final RoutingContext routingContext) { @Override protected URIDataAdapter url(final RoutingContext routingContext) { - return new VertxURIDataAdapter(routingContext); + return URIDataAdapterBase.fromURI(routingContext.request().uri(), URIDefaultDataAdapter::new); } @Override @@ -76,57 +77,4 @@ protected int peerPort(final RoutingContext routingContext) { protected int status(final HttpServerResponse httpServerResponse) { return httpServerResponse.getStatusCode(); } - - protected static final class VertxURIDataAdapter extends URIDataAdapterBase { - private final RoutingContext routingContext; - - public VertxURIDataAdapter(final RoutingContext routingContext) { - this.routingContext = routingContext; - } - - @Override - public String scheme() { - return routingContext.request().scheme(); - } - - @Override - public String host() { - return routingContext.request().host(); - } - - @Override - public int port() { - return routingContext.request().localAddress().port(); - } - - @Override - public String path() { - return routingContext.request().path(); - } - - @Override - public String fragment() { - return null; - } - - @Override - public String query() { - return routingContext.request().query(); - } - - @Override - public boolean supportsRaw() { - return false; - } - - @Override - public String rawPath() { - return null; - } - - @Override - public String rawQuery() { - return null; - } - } } diff --git a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxImplInstrumentation.java b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxImplInstrumentation.java index eaac9c36086..ce3dcab5b3d 100644 --- a/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxImplInstrumentation.java +++ b/dd-java-agent/instrumentation/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxImplInstrumentation.java @@ -34,9 +34,7 @@ public Reference[] additionalMuzzleReferences() { @Override public String[] helperClassNames() { return new String[] { - packageName + ".BlockingExceptionHandler", - packageName + ".VertxDecorator", - packageName + ".VertxDecorator$VertxURIDataAdapter", + packageName + ".BlockingExceptionHandler", packageName + ".VertxDecorator", }; } diff --git a/gradle/java_no_deps.gradle b/gradle/java_no_deps.gradle index fe6f3c85f3d..4a05431c074 100644 --- a/gradle/java_no_deps.gradle +++ b/gradle/java_no_deps.gradle @@ -291,17 +291,26 @@ ext.getJavaLauncherFor = (javaVersionInteger) -> { def isJavaVersionAllowedForProperty(JavaVersion version, String propertyPrefix = "") { def minProp = propertyPrefix.isEmpty() ? 'minJavaVersionForTests' : "${propertyPrefix}MinJavaVersionForTests" def maxProp = propertyPrefix.isEmpty() ? 'maxJavaVersionForTests' : "${propertyPrefix}MaxJavaVersionForTests" - if (project.hasProperty(minProp) && project.getProperty(minProp).compareTo(version) > 0) { + def definedMin = project.hasProperty(minProp) + def definedMax = project.hasProperty(maxProp) + if (definedMin && project.getProperty(minProp).compareTo(version) > 0) { return false } - if (project.hasProperty(maxProp) && project.getProperty(maxProp).compareTo(version) < 0) { + //default to the general min if defined and specific one is was not defined + if (!propertyPrefix.isEmpty() && !definedMin && project.hasProperty('minJavaVersionForTests') && project.getProperty('minJavaVersionForTests').compareTo(version) > 0) { + return false + } + if (definedMax && project.getProperty(maxProp).compareTo(version) < 0) { + return false + } + if (!propertyPrefix.isEmpty() && !definedMax && project.hasProperty('maxJavaVersionForTests') && project.getProperty('maxJavaVersionForTests').compareTo(version) < 0) { return false } return true } def isJavaVersionAllowed(JavaVersion version, String testTaskName) { - return isJavaVersionAllowedForProperty(version) && isJavaVersionAllowedForProperty(version, testTaskName) + return isJavaVersionAllowedForProperty(version, testTaskName) } def isJavaLanguageVersionAllowed(JavaLanguageVersion languageVersion, String testTaskName) {