diff options
author | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-09-17 15:11:26 -0400 |
---|---|---|
committer | Kajur, Harish (vk250x) <vk250x@att.com> | 2018-09-17 15:11:33 -0400 |
commit | 5ebb13f7f16a07f342d8a818d6d2c43d75213da5 (patch) | |
tree | 39a73cc25144ebef21ff5cb69b64b13d8b65aadf | |
parent | 0b23c4bb1a3378ce834e40e8b78b0ac9053b605b (diff) |
Disable authorization for /util/echo
Issue-ID: AAI-1612
Change-Id: I2d34d2a3eb7f80fe852ad799cc195132cad99ac0
Signed-off-by: Kajur, Harish (vk250x) <vk250x@att.com>
3 files changed, 14 insertions, 3 deletions
diff --git a/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafAuthorizationFilter.java b/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafAuthorizationFilter.java index 4191b06..a64d3e5 100644 --- a/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafAuthorizationFilter.java +++ b/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafAuthorizationFilter.java @@ -59,6 +59,11 @@ public class AafAuthorizationFilter extends OrderedRequestContextFilter { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException { + + if(request.getRequestURI().matches("^.*/util/echo$")){ + filterChain.doFilter(request, response); + } + boolean containsWordGremlin = request.getReader().lines().collect(Collectors.joining(System.lineSeparator())).contains("\"gremlin\""); //if the request contains the word "gremlin" it's an advanced query String queryType = containsWordGremlin ? ADVANCED : BASIC; diff --git a/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafFilter.java b/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafFilter.java index ff86119..6295c8e 100644 --- a/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafFilter.java +++ b/aai-traversal/src/main/java/org/onap/aai/config/aaf/AafFilter.java @@ -55,9 +55,11 @@ public class AafFilter extends OrderedRequestContextFilter { @Override protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException, ServletException { - cadiFilter.doFilter(request, response, filterChain); - if(response.getStatus() >=400 && response.getStatus() < 500){ - errorResponse(request, response); + if(!request.getRequestURI().matches("^.*/util/echo$")) { + cadiFilter.doFilter(request, response, filterChain); + if (response.getStatus() >= 400 && response.getStatus() < 500) { + errorResponse(request, response); + } } } diff --git a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java index 1f8a6ec..a6c5ed9 100644 --- a/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java +++ b/aai-traversal/src/main/java/org/onap/aai/interceptors/pre/OneWaySslAuthorization.java @@ -50,6 +50,10 @@ public class OneWaySslAuthorization extends AAIContainerFilter implements Contai public void filter(ContainerRequestContext containerRequestContext) throws IOException { + if(containerRequestContext.getUriInfo().getRequestUri().getPath().matches("^.*/util/echo$")){ + return; + } + String basicAuth = containerRequestContext.getHeaderString("Authorization"); List<MediaType> acceptHeaderValues = containerRequestContext.getAcceptableMediaTypes(); |