From 08a868676801f78f41a62b8061deb46c89ac7255 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Tue, 19 Jun 2018 12:35:58 -0500 Subject: Fix HttpClient/Filter Issue-ID: AAF-364 Change-Id: Ic21a769226cf309571d96a0f75b583d4f75c7887 Signed-off-by: Instrumental --- .../src/main/java/org/onap/aaf/auth/env/AuthzTransFilter.java | 3 ++- .../src/main/java/org/onap/aaf/auth/rserv/TransFilter.java | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'auth/auth-core') diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/env/AuthzTransFilter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/env/AuthzTransFilter.java index a25c5f31..cbc0737c 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/env/AuthzTransFilter.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/env/AuthzTransFilter.java @@ -62,9 +62,10 @@ public class AuthzTransFilter extends TransFilter { } @Override - protected AuthzTrans newTrans() { + protected AuthzTrans newTrans(HttpServletRequest req) { AuthzTrans at = env.newTrans(); at.setLur(getLur()); + at.set(req); return at; } diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TransFilter.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TransFilter.java index 1011767a..400c539c 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TransFilter.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TransFilter.java @@ -84,22 +84,22 @@ public abstract class TransFilter 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)) { -- cgit 1.2.3-korg