From 9625e82afdf904bc8472cbdff1dafeb408f95248 Mon Sep 17 00:00:00 2001 From: "lcartey@github.com" Date: Mon, 18 May 2020 00:30:14 +0100 Subject: [PATCH] Java: Model Spring WebClients/RestTemplates. --- .../java/frameworks/spring/SpringWebClient.qll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 java/ql/src/semmle/code/java/frameworks/spring/SpringWebClient.qll diff --git a/java/ql/src/semmle/code/java/frameworks/spring/SpringWebClient.qll b/java/ql/src/semmle/code/java/frameworks/spring/SpringWebClient.qll new file mode 100644 index 00000000000..ce1c0521084 --- /dev/null +++ b/java/ql/src/semmle/code/java/frameworks/spring/SpringWebClient.qll @@ -0,0 +1,17 @@ +import java +import SpringHttp + +class SpringRestTemplate extends Class { + SpringRestTemplate() { hasQualifiedName("org.springframework.web.client", "RestTemplate") } +} + +class SpringRestTemplateResponseEntityMethod extends Method { + SpringRestTemplateResponseEntityMethod() { + getDeclaringType() instanceof SpringRestTemplate and + getReturnType() instanceof SpringResponseEntity + } +} + +class SpringWebClient extends Interface { + SpringWebClient() { hasQualifiedName("org.springframework.web.reactive.function.client", "WebClient")} +} \ No newline at end of file