Update CM to us Local Intermediate Certs
[aaf/authz.git] / auth / auth-core / src / main / java / org / onap / aaf / auth / rserv / TransFilter.java
index 1011767..c286e50 100644 (file)
@@ -37,6 +37,7 @@ import org.onap.aaf.cadi.Access;
 import org.onap.aaf.cadi.CadiException;
 import org.onap.aaf.cadi.CadiWrap;
 import org.onap.aaf.cadi.Connector;
+import org.onap.aaf.cadi.LocatorException;
 import org.onap.aaf.cadi.Lur;
 import org.onap.aaf.cadi.TrustChecker;
 import org.onap.aaf.cadi.config.Config;
@@ -66,7 +67,7 @@ public abstract class TransFilter<TRANS extends TransStore> implements Filter {
 
        private final String[] no_authn;
        
-       public TransFilter(Access access, Connector con, TrustChecker tc, Object ... additionalTafLurs) throws CadiException {
+       public TransFilter(Access access, Connector con, TrustChecker tc, Object ... additionalTafLurs) throws CadiException, LocatorException {
                cadi = new CadiHTTPManip(access, con, tc, additionalTafLurs);
                String no = access.getProperty(Config.CADI_NOAUTHN, null);
                if(no!=null) {
@@ -84,22 +85,22 @@ public abstract class TransFilter<TRANS extends TransStore> implements Filter {
                return cadi.getLur();
        }
 
-       protected abstract TRANS newTrans();
+       protected abstract TRANS newTrans(HttpServletRequest request);
        protected abstract TimeTaken start(TRANS trans, ServletRequest request);
        protected abstract void authenticated(TRANS trans, Principal p);
        protected abstract void tallyHo(TRANS trans);
        
        @Override
        public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
-               TRANS trans = newTrans();
+               HttpServletRequest req = (HttpServletRequest)request;
+               HttpServletResponse res = (HttpServletResponse)response;
+               
+               TRANS trans = newTrans(req);
                
                TimeTaken overall = start(trans,request);
                try {
                        request.setAttribute(TRANS_TAG, trans);
                        
-                       HttpServletRequest req = (HttpServletRequest)request;
-                       HttpServletResponse res = (HttpServletResponse)response;
-                       
                        if(no_authn!=null) {
                                for(String prefix : no_authn) {
                                        if(req.getPathInfo().startsWith(prefix)) {