summaryrefslogtreecommitdiffstats
path: root/src/main/java/com
diff options
context:
space:
mode:
authorsu622b <sunil.unnava@att.com>2018-04-20 15:45:40 -0400
committersu622b <sunil.unnava@att.com>2018-04-20 15:45:54 -0400
commit1bc5db9215e0dc314d49e4e11a112e272bbc23ca (patch)
tree13bd1b4c967a34537e59892f5b4f6455669e9fe3 /src/main/java/com
parent6155c5b0c43bc3033a85e34224852fe7f02983e5 (diff)
Changes for AAF authentication
Issue-ID: DMAAP-245 Change-Id: I92076166f38ff948a4d2719fe983a2ef64514849 Signed-off-by: su622b <sunil.unnava@att.com>
Diffstat (limited to 'src/main/java/com')
-rw-r--r--src/main/java/com/att/nsa/cambria/security/DMaaPAAFAuthenticatorImpl.java30
-rw-r--r--src/main/java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java2
2 files changed, 5 insertions, 27 deletions
diff --git a/src/main/java/com/att/nsa/cambria/security/DMaaPAAFAuthenticatorImpl.java b/src/main/java/com/att/nsa/cambria/security/DMaaPAAFAuthenticatorImpl.java
index 6f4d9c9..e8f697e 100644
--- a/src/main/java/com/att/nsa/cambria/security/DMaaPAAFAuthenticatorImpl.java
+++ b/src/main/java/com/att/nsa/cambria/security/DMaaPAAFAuthenticatorImpl.java
@@ -21,17 +21,12 @@
*******************************************************************************/
package com.att.nsa.cambria.security;
-import java.util.Date;
import javax.servlet.http.HttpServletRequest;
-import org.apache.http.HttpStatus;
import com.att.nsa.cambria.CambriaApiException;
import com.att.nsa.cambria.constants.CambriaConstants;
-import com.att.nsa.cambria.exception.DMaaPResponseCode;
-import com.att.nsa.cambria.exception.ErrorResponse;
-import com.att.nsa.cambria.utils.Utils;
/**
@@ -60,28 +55,9 @@ public class DMaaPAAFAuthenticatorImpl implements DMaaPAAFAuthenticator {
public String aafPermissionString(String topicName, String action) throws CambriaApiException {
- String permission = "";
- String nameSpace ="";
- if(topicName.contains(".") && (topicName.contains("com.onap")||topicName.contains("org"))) {
- //String topic = topicName.substring(topicName.lastIndexOf(".")+1);
- nameSpace = topicName.substring(0,topicName.lastIndexOf("."));
- }
- else {
- nameSpace = null;
- nameSpace= com.att.ajsc.filemonitor.AJSCPropertiesMap.getProperty(CambriaConstants.msgRtr_prop,"defaultNSforUEB");
-
- if(null==nameSpace)nameSpace="com.onap.dmaap.mr.ueb";
-
-
- /*ErrorResponse errRes = new ErrorResponse(HttpStatus.SC_FORBIDDEN,
- DMaaPResponseCode.TOPIC_NOT_IN_AAF.getResponseCode(), "Topic does not exist in AAF"
- , null, Utils.getFormattedDate(new Date()), topicName,
- null, null, null, null);
-
- throw new CambriaApiException(errRes);*/
- }
-
- permission = nameSpace+".mr.topic|:topic."+topicName+"|"+action;
+ String mrNameS = com.att.ajsc.beans.PropertiesMapBean.getProperty(CambriaConstants.msgRtr_prop,
+ "msgRtr.namespace.aaf");
+ String permission = mrNameS+"|:topic."+topicName+"|"+action;
return permission;
}
diff --git a/src/main/java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java b/src/main/java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java
index f539199..7875b90 100644
--- a/src/main/java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java
+++ b/src/main/java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java
@@ -314,7 +314,9 @@ public class TopicServiceImpl implements TopicService {
// String permission = "com.att.dmaap.mr.topic"+"|"+topicName+"|"+"manage";
String permission = "";
String nameSpace="";
+ if(topicName.indexOf(".")>1){
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";