diff options
author | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2024-01-25 14:25:37 +0000 |
---|---|---|
committer | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2024-02-07 14:59:50 +0000 |
commit | beeb5e3846c8457987711491bcb58a6567870591 (patch) | |
tree | 227cdd91b00f3889a1109d457f968472cb7ee596 /policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java | |
parent | 0241c0aa14447c99fccecc61e91b35051d6743be (diff) |
Remove Dmaap references from policy-common
- updated dependencies for jakarta.* compabilities
- other dependency updates for security fixes
Issue-ID: POLICY-4881
Change-Id: I979d944fcd21279f618d1bcbfe12e914ba30077f
Signed-off-by: rameshiyer27 <ramesh.murugan.iyer@est.tech>
Diffstat (limited to 'policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java')
-rw-r--r-- | policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java index b58cde7c..44204cfd 100644 --- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java +++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/http/server/AuthorizationFilter.java @@ -3,7 +3,7 @@ * ONAP * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2023 Nordix Foundation. + * Modifications Copyright (C) 2023-2024 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,17 +40,14 @@ public abstract class AuthorizationFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - if (!(servletRequest instanceof HttpServletRequest)) { + if (!(servletRequest instanceof HttpServletRequest request)) { throw new ServletException("Not an HttpServletRequest instance"); } - if (!(servletResponse instanceof HttpServletResponse)) { + if (!(servletResponse instanceof HttpServletResponse response)) { throw new ServletException("Not an HttpServletResponse instance"); } - HttpServletRequest request = (HttpServletRequest) servletRequest; - HttpServletResponse response = (HttpServletResponse) servletResponse; - String role = getRole(request); boolean authorized = request.isUserInRole(role); |