From 460b2066308869e50f7b5320726780676d0d1f05 Mon Sep 17 00:00:00 2001 From: su622b Date: Wed, 21 Mar 2018 16:22:41 -0400 Subject: changes for deployment errors Issue-ID: DMAAP-332 Change-Id: I28da5fea23c8680fb921c97348eee26edb86ed35 Signed-off-by: su622b --- .../java/com/att/nsa/cambria/security/DMaaPAuthenticatorImpl.java | 4 ---- .../java/com/att/nsa/cambria/service/impl/AdminServiceImpl.java | 2 +- .../java/com/att/nsa/cambria/service/impl/TopicServiceImpl.java | 6 ++---- 3 files changed, 3 insertions(+), 9 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/att/nsa/cambria/security/DMaaPAuthenticatorImpl.java b/src/main/java/com/att/nsa/cambria/security/DMaaPAuthenticatorImpl.java index dfcb0d5..709d035 100644 --- a/src/main/java/com/att/nsa/cambria/security/DMaaPAuthenticatorImpl.java +++ b/src/main/java/com/att/nsa/cambria/security/DMaaPAuthenticatorImpl.java @@ -132,9 +132,5 @@ public class DMaaPAuthenticatorImpl implements DMaaPAuthent this.fAuthenticators.add(a); } - public static boolean isIgnoreAuth(){ - return (System.getenv("ignoreAuth")!=null) ? Boolean.valueOf(System.getenv("ignoreAuth")):(System.getProperty("ignoreAuth")!=null? Boolean.valueOf(System.getProperty("ignoreAuth")):false ); - - } } diff --git a/src/main/java/com/att/nsa/cambria/service/impl/AdminServiceImpl.java b/src/main/java/com/att/nsa/cambria/service/impl/AdminServiceImpl.java index ead9c36..8b651f5 100644 --- a/src/main/java/com/att/nsa/cambria/service/impl/AdminServiceImpl.java +++ b/src/main/java/com/att/nsa/cambria/service/impl/AdminServiceImpl.java @@ -161,7 +161,7 @@ public class AdminServiceImpl implements AdminService { { final NsaApiKey user = DMaaPAuthenticatorImpl.getAuthenticatedUser(dMaaPContext); - if ( (!DMaaPAuthenticatorImpl.isIgnoreAuth())&&(user == null || !user.getKey ().equals ( "admin" )) ) + if ( (user == null || !user.getKey ().equals ( "admin" )) ) { throw new AccessDeniedException (); } 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 3690583..a9c1882 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 @@ -195,7 +195,6 @@ public class TopicServiceImpl implements TopicService { String key = null; String appName=dmaapContext.getRequest().getHeader("AppName"); String enfTopicName= com.att.ajsc.beans.PropertiesMapBean.getProperty(CambriaConstants.msgRtr_prop,"enforced.topic.name.AAF"); - if(DMaaPAuthenticatorImpl.isIgnoreAuth()){ if(user != null) { key = user.getKey(); @@ -214,7 +213,7 @@ public class TopicServiceImpl implements TopicService { } //else if (user==null && (null==dmaapContext.getRequest().getHeader("Authorization") && null == dmaapContext.getRequest().getHeader("cookie")) ) { - else if (user == null && null==dmaapContext.getRequest().getHeader("Authorization") && + /*else if (user == null && null==dmaapContext.getRequest().getHeader("Authorization") && (null == appName && null == dmaapContext.getRequest().getHeader("cookie"))) { LOGGER.error("Failed to create topic"+topicBean.getTopicName()+", Authentication failed."); @@ -223,7 +222,7 @@ public class TopicServiceImpl implements TopicService { errorMessages.getCreateTopicFail()+" "+errorMessages.getNotPermitted1()+" create "+errorMessages.getNotPermitted2()); LOGGER.info(errRes.toString()); throw new DMaaPAccessDeniedException(errRes); - } + }*/ if (user == null && (null!=dmaapContext.getRequest().getHeader("Authorization") || null != dmaapContext.getRequest().getHeader("cookie"))) { @@ -266,7 +265,6 @@ public class TopicServiceImpl implements TopicService { } } - } try { final String topicName = topicBean.getTopicName(); -- cgit 1.2.3-korg