diff options
author | su622b <sunil.unnava@att.com> | 2018-03-21 16:22:41 -0400 |
---|---|---|
committer | su622b <sunil.unnava@att.com> | 2018-03-21 16:22:53 -0400 |
commit | 460b2066308869e50f7b5320726780676d0d1f05 (patch) | |
tree | 74a6512b80e5dd4bfc3ffc3a8a0d568a03c269de | |
parent | 30a84f5af13658f780270b6fc474b344310d7464 (diff) |
changes for deployment errorsv1.1.2
Issue-ID: DMAAP-332
Change-Id: I28da5fea23c8680fb921c97348eee26edb86ed35
Signed-off-by: su622b <sunil.unnava@att.com>
4 files changed, 3 insertions, 12 deletions
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<K extends NsaApiKey> 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(); diff --git a/src/test/java/com/att/nsa/cambria/service/impl/TopicServiceImplTest.java b/src/test/java/com/att/nsa/cambria/service/impl/TopicServiceImplTest.java index c90ba54..eb7e046 100644 --- a/src/test/java/com/att/nsa/cambria/service/impl/TopicServiceImplTest.java +++ b/src/test/java/com/att/nsa/cambria/service/impl/TopicServiceImplTest.java @@ -135,7 +135,6 @@ public class TopicServiceImplTest { public void testCreateTopicWithEnforcedName()
throws DMaaPAccessDeniedException, CambriaApiException, IOException, TopicExistsException {
- PowerMockito.when(DMaaPAuthenticatorImpl.isIgnoreAuth()).thenReturn(true);
Assert.assertNotNull(topicService);
PowerMockito.mockStatic(PropertiesMapBean.class);
@@ -201,7 +200,6 @@ public class TopicServiceImplTest { public void testCreateTopicNoUserInContextAndNoAuthHeader()
throws DMaaPAccessDeniedException, CambriaApiException, IOException, TopicExistsException {
- PowerMockito.when(DMaaPAuthenticatorImpl.isIgnoreAuth()).thenReturn(true);
Assert.assertNotNull(topicService);
PowerMockito.mockStatic(PropertiesMapBean.class);
@@ -225,7 +223,6 @@ public class TopicServiceImplTest { public void testCreateTopicNoUserInContextAndAuthHeaderAndPermitted()
throws DMaaPAccessDeniedException, CambriaApiException, IOException, TopicExistsException {
- PowerMockito.when(DMaaPAuthenticatorImpl.isIgnoreAuth()).thenReturn(true);
Assert.assertNotNull(topicService);
PowerMockito.mockStatic(PropertiesMapBean.class);
|