summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavid.mcweeney <david.mcweeney@est.tech>2021-08-10 14:23:28 +0100
committerdavid.mcweeney <david.mcweeney@est.tech>2021-08-10 14:28:29 +0100
commit73ca35d85189b7b74417ad4166f00fccdaf12436 (patch)
tree8b1ddfc2844839342d4415e5b04f6c62d0033bb9
parent17d92be56eca65f78c90e267ecd22bae1f282633 (diff)
DMAAP-DR - Whitelist removal
Signed-off-by: david.mcweeney <david.mcweeney@est.tech> Change-Id: I6a12c9ae5f5aaff6045b9b6ee7d5c33274e94dc3 Issue-ID: DMAAP-1624
-rw-r--r--datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java8
-rw-r--r--datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java11
2 files changed, 1 insertions, 18 deletions
diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
index 27fa5f3e..aa827de1 100644
--- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
+++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeServlet.java
@@ -253,14 +253,8 @@ public class NodeServlet extends HttpServlet {
return;
}
fileid = fileid.substring(18);
- if (req.getHeader("X-DMAAP-DR-PUBLISH-ID") != null && !req.getHeader("X-DMAAP-DR-PUBLISH-ID").matches("^[a-zA-Z0-9_]+$")) {
- String reason = "Error validating header";
- eelfLogger.error(reason);
- resp.sendError(HttpServletResponse.SC_BAD_REQUEST, reason);
- eelfLogger.info(EelfMsgs.EXIT);
- return;
- }
pubid = req.getHeader("X-DMAAP-DR-PUBLISH-ID");
+
user = "datartr"; // SP6 : Added usr as datartr to avoid null entries for internal routing
targets = config.parseRouting(req.getHeader("X-DMAAP-DR-ROUTING"));
} else {
diff --git a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
index ad2fcf5d..4340b018 100644
--- a/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
+++ b/datarouter-node/src/test/java/org/onap/dmaap/datarouter/node/NodeServletTest.java
@@ -205,17 +205,6 @@ public class NodeServletTest {
}
@Test
- public void Given_Request_Is_HTTP_PUT_And_Internal_Publish_But_Invalid_Header_Then_Bad_Request_Response_Is_Generated() throws Exception {
- when(request.getPathInfo()).thenReturn("/internal/publish/1/blah");
- when(request.getRemoteAddr()).thenReturn("1.2.3.4");
- when(config.isAnotherNode(anyString(), anyString())).thenReturn(true);
- when(request.getHeader("X-DMAAP-DR-PUBLISH-ID")).thenReturn("User1+");
- nodeServlet.doPut(request, response);
- verify(response).sendError(eq(HttpServletResponse.SC_BAD_REQUEST), anyString());
- verifyEnteringExitCalled(listAppender);
- }
-
- @Test
public void Given_Request_Is_HTTP_PUT_On_Publish_And_Ingress_Node_Is_Provided_Then_Request_Is_Redirected() throws Exception {
setNodeConfigManagerToAllowRedirectOnIngressNode();
when(request.getPathInfo()).thenReturn("/publish/1/fileName");