From 80d6c640248271da46157fd3189f72b20596ea1b Mon Sep 17 00:00:00 2001 From: sunil unnava Date: Mon, 15 Oct 2018 17:02:34 -0400 Subject: add AAF based on a flag Issue-ID: DMAAP-849 Change-Id: I8f72ce6cd23bb1205fc6a1a54bd44bef8db0dfa8 Signed-off-by: sunil unnava --- src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java b/src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java index 652bfc2..64480e6 100644 --- a/src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java +++ b/src/main/java/com/att/nsa/dmaap/util/DMaaPAuthFilter.java @@ -29,6 +29,7 @@ import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; +import com.att.dmf.mr.utils.Utils; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFManager; import org.springframework.stereotype.Component; @@ -69,10 +70,11 @@ public class DMaaPAuthFilter extends CadiFilter { log.info("inside servlet filter Cambria Auth Headers checking before doing other Authentication"); HttpServletRequest request = (HttpServletRequest) req; boolean forceAAF = Boolean.valueOf(System.getProperty("forceAAF")); + //if (forceAAF || null != request.getHeader("Authorization") ){ - if (forceAAF || null != request.getHeader("Authorization") || + if (Utils.isCadiEnabled()&&(forceAAF || null != request.getHeader("Authorization") || (null != request.getHeader("AppName") && request.getHeader("AppName").equalsIgnoreCase("invenio") && - null != request.getHeader("cookie"))){ + null != request.getHeader("cookie")))){ super.doFilter(req, res, chain); } else { -- cgit 1.2.3-korg