Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

log4j2 vulnaribility changes #18

Open
wants to merge 3 commits into
base: release-4.6.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<artifactId>jaxb-impl</artifactId>
<version>2.2.11</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -108,7 +108,6 @@
<version>1.0</version>
<scope>compile</scope>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.uci.dao.repository.XMessageRepository;
import com.uci.utils.BotService;
import com.uci.utils.kafka.SimpleProducer;

import io.opentelemetry.api.trace.Tracer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
Expand Down Expand Up @@ -42,6 +44,9 @@ public class DikshaWebController {

@Autowired
public BotService botService;

@Autowired
public Tracer tracer;

@RequestMapping(value = "/web", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void dikshaWeb(@RequestBody SunbirdWebMessage message) throws JsonProcessingException, JAXBException {
Expand All @@ -59,6 +64,7 @@ public void dikshaWeb(@RequestBody SunbirdWebMessage message) throws JsonProcess
.topicSuccess(inboundProcessed)
.kafkaProducer(kafkaProducer)
.botService(botService)
.tracer(tracer)
.build()
.process();
}
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/com/uci/inbound/health/HealthController.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.uci.dao.service.HealthService;

import io.opentelemetry.api.trace.Span;
import io.opentelemetry.api.trace.Tracer;
import io.opentelemetry.context.Context;
import io.opentelemetry.context.Scope;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
Expand Down Expand Up @@ -41,4 +45,38 @@ public ResponseEntity<JsonNode> statusCheck() throws JsonProcessingException, IO

return ResponseEntity.ok(jsonNode);
}

// @Autowired
// private Tracer tracer;

@RequestMapping(value = "/test-lightstep", method = RequestMethod.GET, produces = { "application/json", "text/json" })
public ResponseEntity<JsonNode> test() throws JsonProcessingException, IOException {

// log.error("Health API called");
//
// Span span = tracer.spanBuilder("main-inbound-kafka").startSpan();
//
// int data;
// try (Scope scope = span.makeCurrent()) {
// Span childSpan = tracer.spanBuilder("child-inbound-kafka")
// .setParent(Context.current().with(span))
// .startSpan();
//
ObjectMapper mapper = new ObjectMapper();

JsonNode jsonNode = mapper.readTree("{\"id\":\"api.content.health\",\"ver\":\"3.0\",\"ts\":\"2021-06-26T22:47:05Z+05:30\",\"params\":{\"resmsgid\":\"859fee0c-94d6-4a0d-b786-2025d763b78a\",\"msgid\":null,\"err\":null,\"status\":\"successful\",\"errmsg\":null},\"responseCode\":\"OK\",\"result\":{\"checks\":[{\"name\":\"redis cache\",\"healthy\":true},{\"name\":\"graph db\",\"healthy\":true},{\"name\":\"cassandra db\",\"healthy\":true}],\"healthy\":true}}");

int i = 0;
while(i <= 1000) {
log.info("Value of i: "+i);
i++;
}

return ResponseEntity.ok(jsonNode);
// } finally {
// span.end();
// }


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
import com.uci.utils.BotService;
import com.uci.inbound.utils.XMsgProcessingUtil;
import com.uci.utils.kafka.SimpleProducer;

import io.opentelemetry.api.trace.Tracer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
Expand Down Expand Up @@ -44,6 +47,9 @@ public class GupShupWhatsappConverter {

@Autowired
public BotService botService;

@Autowired
public Tracer tracer;

@RequestMapping(value = "/whatsApp", method = RequestMethod.POST, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
public void gupshupWhatsApp(@Valid GSWhatsAppMessage message) throws JsonProcessingException, JAXBException {
Expand All @@ -61,6 +67,7 @@ public void gupshupWhatsApp(@Valid GSWhatsAppMessage message) throws JsonProcess
.topicSuccess(inboundProcessed)
.kafkaProducer(kafkaProducer)
.botService(botService)
.tracer(tracer)
.build()
.process();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import com.uci.inbound.utils.XMsgProcessingUtil;
import com.uci.dao.repository.XMessageRepository;
import com.uci.utils.kafka.SimpleProducer;

import io.opentelemetry.api.trace.Tracer;
import lombok.extern.slf4j.Slf4j;
import com.uci.utils.BotService;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -42,6 +44,9 @@ public class NetcoreWhatsappConverter {

@Autowired
public BotService botService;

@Autowired
public Tracer tracer;

@RequestMapping(value = "/whatsApp", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
public void netcoreWhatsApp(@RequestBody NetcoreMessageFormat message) throws JsonProcessingException, JAXBException {
Expand All @@ -60,6 +65,7 @@ public void netcoreWhatsApp(@RequestBody NetcoreMessageFormat message) throws Js
.topicSuccess(inboundProcessed)
.kafkaProducer(kafkaProducer)
.botService(botService)
.tracer(tracer)
.build()
.process();
}
Expand Down
Loading