* ============LICENSE_START==========================================
* ONAP Portal SDK
* ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
import javax.servlet.http.HttpServletResponse;
import org.onap.aaf.cadi.filter.CadiFilter;
+import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.onap.portalsdk.core.onboarding.util.AuthUtil;
import org.onap.portalsdk.core.onboarding.util.PortalApiConstants;
import org.onap.portalsdk.core.onboarding.util.PortalApiProperties;
private static String include_url_endpoints ="";
private static String exclude_url_endpoints = "";
public static final String AUTHORIZATION = "Authorization";
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CadiAuthFilter.class);
public void init(FilterConfig filterConfig) throws ServletException {
super.init(filterConfig);
include_url_endpoints = filterConfig.getInitParameter("include_url_endpoints");
exclude_url_endpoints = filterConfig.getInitParameter("exclude_url_endpoints");
+ logger.debug(EELFLoggerDelegate.debugLogger, "inculde_url_endpoints values: "+ include_url_endpoints);
+ logger.debug(EELFLoggerDelegate.debugLogger, "exculde_url_endpoints values: "+ exclude_url_endpoints);
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
Arrays.asList(excludeUrlEndPointString.split(",")));
ArrayList<String> includeUrlEndPointList = new ArrayList<String>(
Arrays.asList(includeUrlEndPointString.split(",")));
- if (excludeFilter(request, excludeUrlEndPointList))
+ if (excludeFilter(request, excludeUrlEndPointList)){
+ logger.debug(EELFLoggerDelegate.debugLogger, "Request excluded from cadifilter");
chain.doFilter(request, response);
- else if (includeFilter(request, includeUrlEndPointList))
+ }else if (includeFilter(request, includeUrlEndPointList)){
+ logger.debug(EELFLoggerDelegate.debugLogger, "Request is entering cadifilter");
super.doFilter(request, response, chain);
- else
+ }else
chain.doFilter(request, response);
}
}
* ============LICENSE_START==========================================
* ONAP Portal SDK
* ===================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2018 AT&T Intellectual Property. All rights reserved.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
str = decodeFunctionCode(instance);
finalInstanceList.add(str);
}
+ logger.debug(EELFLoggerDelegate.debugLogger, "List of AllInstances: "+ finalInstanceList);
return finalInstanceList;
}
if (!isauthorized)
isauthorized = matchPattern(requestUri, str);
}
+ logger.debug(EELFLoggerDelegate.debugLogger, "isAccessAllowed for the request uri: "+requestUri + "is"+ isauthorized);
+ if (isauthorized) {
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ "Request is Authorized");
+ }
return isauthorized;
}
}
\ No newline at end of file