Convert apache-http, akka, and play to muzzle plugin
This commit is contained in:
parent
c6841c9d06
commit
f06eb57449
|
@ -16,6 +16,20 @@ compileLagomTestGroovy {
|
||||||
targetCompatibility = 1.8
|
targetCompatibility = 1.8
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
muzzle {
|
||||||
|
pass {
|
||||||
|
group = 'com.typesafe.akka'
|
||||||
|
module = 'akka-http_2.11'
|
||||||
|
versions = "[10.0.0,10.0.12)"
|
||||||
|
}
|
||||||
|
pass {
|
||||||
|
group = 'com.typesafe.akka'
|
||||||
|
module = 'akka-http_2.12'
|
||||||
|
versions = "[10.0.0,10.0.12)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.0.0'
|
compileOnly group: 'com.typesafe.akka', name: 'akka-http_2.11', version: '10.0.0'
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,23 @@
|
||||||
apply plugin: 'version-scan'
|
|
||||||
|
|
||||||
versionScan {
|
|
||||||
group = "org.apache.httpcomponents"
|
|
||||||
module = "httpclient"
|
|
||||||
versions = "[4.3,)"
|
|
||||||
legacyGroup = "commons-httpclient"
|
|
||||||
legacyModule = "commons-httpclient"
|
|
||||||
verifyPresent = [
|
|
||||||
// The commented out classes are required for the instrumentation (this is checked by our bytebuddy rules).
|
|
||||||
// Once the verifier can report on the failed versions these classes can be commented out and the pass range can be widened.
|
|
||||||
|
|
||||||
// "org.apache.http.HttpException" : null,
|
|
||||||
// "org.apache.http.HttpRequest" : null,
|
|
||||||
// "org.apache.http.client.RedirectStrategy" : null,
|
|
||||||
"org.apache.http.client.methods.CloseableHttpResponse": null,
|
|
||||||
"org.apache.http.client.methods.HttpExecutionAware" : null,
|
|
||||||
"org.apache.http.client.methods.HttpRequestWrapper" : null,
|
|
||||||
"org.apache.http.client.protocol.HttpClientContext" : null,
|
|
||||||
// "org.apache.http.conn.routing.HttpRoute" : null,
|
|
||||||
"org.apache.http.impl.execchain.ClientExecChain" : null
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
apply from: "${rootDir}/gradle/java.gradle"
|
apply from: "${rootDir}/gradle/java.gradle"
|
||||||
|
|
||||||
|
muzzle {
|
||||||
|
pass {
|
||||||
|
group = "org.apache.httpcomponents"
|
||||||
|
module = "httpclient"
|
||||||
|
versions = "[4.3,)"
|
||||||
|
}
|
||||||
|
pass {
|
||||||
|
group = "commons-httpclient"
|
||||||
|
module = "commons-httpclient"
|
||||||
|
versions = "[4.3,)"
|
||||||
|
}
|
||||||
|
fail {
|
||||||
|
group = "org.apache.httpcomponents"
|
||||||
|
module = "httpclient"
|
||||||
|
versions = "[,4.3)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
apply plugin: 'org.unbroken-dome.test-sets'
|
apply plugin: 'org.unbroken-dome.test-sets'
|
||||||
|
|
||||||
testSets {
|
testSets {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package datadog.trace.instrumentation.apachehttpclient;
|
package datadog.trace.instrumentation.apachehttpclient;
|
||||||
|
|
||||||
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
|
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
|
||||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
|
|
||||||
import static io.opentracing.log.Fields.ERROR_OBJECT;
|
import static io.opentracing.log.Fields.ERROR_OBJECT;
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
import static net.bytebuddy.matcher.ElementMatchers.isAbstract;
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
import static net.bytebuddy.matcher.ElementMatchers.isMethod;
|
||||||
|
@ -36,22 +35,6 @@ public class ApacheHttpClientInstrumentation extends Instrumenter.Default {
|
||||||
.or(safeHasSuperType(named("org.apache.http.impl.client.CloseableHttpClient")));
|
.or(safeHasSuperType(named("org.apache.http.impl.client.CloseableHttpClient")));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ElementMatcher<ClassLoader> classLoaderMatcher() {
|
|
||||||
return classLoaderHasClasses(
|
|
||||||
"org.apache.http.HttpException",
|
|
||||||
"org.apache.http.HttpRequest",
|
|
||||||
"org.apache.http.client.RedirectStrategy",
|
|
||||||
"org.apache.http.client.methods.CloseableHttpResponse",
|
|
||||||
"org.apache.http.client.methods.HttpExecutionAware",
|
|
||||||
"org.apache.http.client.methods.HttpRequestWrapper",
|
|
||||||
"org.apache.http.client.protocol.HttpClientContext",
|
|
||||||
"org.apache.http.conn.routing.HttpRoute",
|
|
||||||
"org.apache.http.impl.execchain.ClientExecChain",
|
|
||||||
"org.apache.http.impl.client.CloseableHttpClient",
|
|
||||||
"org.apache.http.impl.client.InternalHttpClient");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] helperClassNames() {
|
public String[] helperClassNames() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
|
|
|
@ -7,6 +7,19 @@ testSets {
|
||||||
latestDepTest
|
latestDepTest
|
||||||
}
|
}
|
||||||
|
|
||||||
|
muzzle {
|
||||||
|
pass {
|
||||||
|
group = 'com.typesafe.play'
|
||||||
|
module = 'play_2.11'
|
||||||
|
versions = '[2.4.0,2.7.0-M1)'
|
||||||
|
}
|
||||||
|
pass {
|
||||||
|
group = 'com.typesafe.play'
|
||||||
|
module = 'play_2.12'
|
||||||
|
versions = '[2.4.0,2.7.0-M1)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly group: 'com.typesafe.play', name: 'play_2.11', version: '2.4.0'
|
compileOnly group: 'com.typesafe.play', name: 'play_2.11', version: '2.4.0'
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package datadog.trace.instrumentation.play;
|
package datadog.trace.instrumentation.play;
|
||||||
|
|
||||||
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
|
import static datadog.trace.agent.tooling.ByteBuddyElementMatchers.safeHasSuperType;
|
||||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClassWithMethod;
|
|
||||||
import static datadog.trace.agent.tooling.ClassLoaderMatcher.classLoaderHasClasses;
|
|
||||||
import static io.opentracing.log.Fields.ERROR_OBJECT;
|
import static io.opentracing.log.Fields.ERROR_OBJECT;
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.named;
|
import static net.bytebuddy.matcher.ElementMatchers.named;
|
||||||
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
import static net.bytebuddy.matcher.ElementMatchers.returns;
|
||||||
|
@ -50,18 +48,6 @@ public final class PlayInstrumentation extends Instrumenter.Default {
|
||||||
return safeHasSuperType(named("play.api.mvc.Action"));
|
return safeHasSuperType(named("play.api.mvc.Action"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ElementMatcher<ClassLoader> classLoaderMatcher() {
|
|
||||||
return classLoaderHasClasses(
|
|
||||||
"akka.japi.JavaPartialFunction",
|
|
||||||
"play.api.mvc.Action",
|
|
||||||
"play.api.mvc.Result",
|
|
||||||
"scala.Option",
|
|
||||||
"scala.Tuple2",
|
|
||||||
"scala.concurrent.Future")
|
|
||||||
.and(classLoaderHasClassWithMethod("play.api.mvc.Request", "tags"));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] helperClassNames() {
|
public String[] helperClassNames() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
|
|
Loading…
Reference in New Issue