Sonar Major issues
This block of commented-out lines of code should be removed
Sonar Link:
https://sonar.onap.org/project/issues?assignees=surendraReddy&id=org.onap.dmaap.messagerouter.msgrtr%3Amsgrtr&open=AWXX4Dp7ligbnTmNIX6R&resolved=false&severities=MAJOR
Location:
src/main/java/com/att/dmf/mr/service/impl/TopicServiceImpl.java
Line No-L350 L355 L505 L515
Change-Id: Iadb3f456fa170c2430704f752eb6b741e2c8e56e
Issue-ID: DMAAP-782
Signed-off-by: Surendra Reddy Katam <SK00524980@techmahindra.com>
diff --git a/src/main/java/com/att/dmf/mr/service/impl/TopicServiceImpl.java b/src/main/java/com/att/dmf/mr/service/impl/TopicServiceImpl.java
index 29c7665..cef646e 100644
--- a/src/main/java/com/att/dmf/mr/service/impl/TopicServiceImpl.java
+++ b/src/main/java/com/att/dmf/mr/service/impl/TopicServiceImpl.java
@@ -347,12 +347,12 @@
if (user == null && null != dmaapContext.getRequest().getHeader("Authorization")) {
LOGGER.info("Authenticating the user, as ACL authentication is not provided");
// String permission =
- // "com.att.dmaap.mr.topic"+"|"+topicName+"|"+"manage";
+
String permission = "";
String nameSpace = topicName.substring(0, topicName.lastIndexOf("."));
String mrFactoryVal = AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,
"msgRtr.topicfactory.aaf");
- // String tokens[] = topicName.split(".mr.topic.");
+
permission = mrFactoryVal + nameSpace + "|destroy";
DMaaPAAFAuthenticator aaf = new DMaaPAAFAuthenticatorImpl();
if (!aaf.aafAuthentication(dmaapContext.getRequest(), permission)) {
@@ -502,7 +502,7 @@
//
- // if(!aaf.aafAuthentication(dmaapContext.getRequest(), permission))
+
// {
// LOGGER.error("Failed to permit write access to producer [" +
// producerId + "] for topic " + topicName
@@ -512,7 +512,7 @@
// errorMessages.getNotPermitted1()+" <Grant publish permissions>
- // throw new DMaaPAccessDeniedException(errRes);
+
// }
// }