Search in sources :

Example 16 with StructuredRestCallEvent

use of com.sequenceiq.cloudbreak.structuredevent.event.StructuredRestCallEvent in project cloudbreak by hortonworks.

the class LegacyKafkaStructuredEventHandler method sanitizeSensitiveRestData.

protected void sanitizeSensitiveRestData(StructuredEvent event) {
    if ("StructuredRestCallEvent".equals(event.getType())) {
        StructuredRestCallEvent restEvent = (StructuredRestCallEvent) event;
        RestRequestDetails restRequestDetails = restEvent.getRestCall().getRestRequest();
        restRequestDetails.setBody(REPLACEMENT);
        restRequestDetails.setHeaders(new HashMap());
        RestResponseDetails restResponseDetails = restEvent.getRestCall().getRestResponse();
        restResponseDetails.setBody(REPLACEMENT);
        restResponseDetails.setHeaders(new HashMap<>());
    }
}
Also used : StructuredRestCallEvent(com.sequenceiq.cloudbreak.structuredevent.event.StructuredRestCallEvent) HashMap(java.util.HashMap) RestRequestDetails(com.sequenceiq.cloudbreak.structuredevent.event.rest.RestRequestDetails) RestResponseDetails(com.sequenceiq.cloudbreak.structuredevent.event.rest.RestResponseDetails)

Aggregations

StructuredRestCallEvent (com.sequenceiq.cloudbreak.structuredevent.event.StructuredRestCallEvent)16 RestCallDetails (com.sequenceiq.cloudbreak.structuredevent.event.rest.RestCallDetails)11 RestRequestDetails (com.sequenceiq.cloudbreak.structuredevent.event.rest.RestRequestDetails)11 Test (org.junit.jupiter.api.Test)9 OperationDetails (com.sequenceiq.cloudbreak.structuredevent.event.legacy.OperationDetails)8 HashMap (java.util.HashMap)8 RestResponseDetails (com.sequenceiq.cloudbreak.structuredevent.event.rest.RestResponseDetails)7 Json (com.sequenceiq.cloudbreak.common.json.Json)5 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)2 Test (org.junit.Test)2 CloudbreakUser (com.sequenceiq.cloudbreak.common.user.CloudbreakUser)1 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)1 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)1 InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)1 RestResourceAuditEventConverter (com.sequenceiq.cloudbreak.structuredevent.auditeventname.rest.RestResourceAuditEventConverter)1 StructuredEvent (com.sequenceiq.cloudbreak.structuredevent.event.StructuredEvent)1 ContainerResponseContext (javax.ws.rs.container.ContainerResponseContext)1 ContainerRequest (org.glassfish.jersey.server.ContainerRequest)1 ContainerResponse (org.glassfish.jersey.server.ContainerResponse)1 SendResult (org.springframework.kafka.support.SendResult)1