From 6ae7e8a1bae83d407b22d8b066dd0bcca730e1bb Mon Sep 17 00:00:00 2001 From: Michael DÜrre Date: Fri, 9 Apr 2021 08:01:19 +0200 Subject: weekly sdnr code sync MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sync internal code progress add istanbul database structure cleanup dataprovider test fix pom files Issue-ID: CCSDK-3260 Signed-off-by: Michael DÜrre Change-Id: Ic1daa6adda173dc8337a51fa930e05c05ee88e2c --- .../wt/oauthprovider/http/AuthHttpServlet.java | 26 +++------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'sdnr/wt/oauth-provider') diff --git a/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/http/AuthHttpServlet.java b/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/http/AuthHttpServlet.java index 9a9f4fc04..cd4239081 100644 --- a/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/http/AuthHttpServlet.java +++ b/sdnr/wt/oauth-provider/provider-jar/src/main/java/org/onap/ccsdk/features/sdnr/wt/oauthprovider/http/AuthHttpServlet.java @@ -37,11 +37,7 @@ import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.shiro.SecurityUtils; -import org.apache.shiro.ShiroException; import org.apache.shiro.codec.Base64; -import org.apache.shiro.session.Session; -import org.apache.shiro.subject.Subject; import org.jolokia.osgi.security.Authenticator; import org.onap.ccsdk.features.sdnr.wt.common.http.BaseHTTPClient; import org.onap.ccsdk.features.sdnr.wt.oauthprovider.data.Config; @@ -70,7 +66,7 @@ public class AuthHttpServlet extends HttpServlet { private static final long serialVersionUID = 1L; private static final String BASEURI = "/oauth"; private static final String LOGINURI = BASEURI + "/login"; - private static final String LOGOUTURI = BASEURI + "/logout"; + //private static final String LOGOUTURI = BASEURI + "/logout"; private static final String PROVIDERSURI = BASEURI + "/providers"; public static final String REDIRECTURI = BASEURI + "/redirect"; private static final String REDIRECTURI_FORMAT = REDIRECTURI + "/%s"; @@ -141,8 +137,6 @@ public class AuthHttpServlet extends HttpServlet { this.sendResponse(resp, HttpServletResponse.SC_OK, getConfigs(this.providerStore.values())); } else if (req.getRequestURI().startsWith(LOGINURI)) { this.handleLoginRedirect(req, resp); - } else if (req.getRequestURI().equals(LOGOUTURI)) { - this.handleLogout(req, resp); } else if (POLICIESURI.equals(req.getRequestURI())) { this.sendResponse(resp, HttpServletResponse.SC_OK, this.getPoliciesForUser(req)); } else if (req.getRequestURI().startsWith(REDIRECTURI)) { @@ -152,10 +146,7 @@ public class AuthHttpServlet extends HttpServlet { } } - private void handleLogout(HttpServletRequest req, HttpServletResponse resp) throws IOException { - this.logout(); - this.sendResponse(resp, HttpServletResponse.SC_OK,""); - } + private void handleLoginRedirect(HttpServletRequest req, HttpServletResponse resp) throws IOException { final String uri = req.getRequestURI(); final Matcher matcher = LOGIN_REDIRECT_PATTERN.matcher(uri); @@ -467,16 +458,5 @@ public class AuthHttpServlet extends HttpServlet { os.write(output); } - private void logout() { - final Subject subject = SecurityUtils.getSubject(); - try { - subject.logout(); - Session session = subject.getSession(false); - if (session != null) { - session.stop(); - } - } catch (ShiroException e) { - LOG.debug("Couldn't log out {}", subject, e); - } - } + } -- cgit 1.2.3-korg