diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-02-21 17:17:10 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-02-21 17:17:45 +0100 |
commit | 33477b7b83c33dab18ded974a8afbcfaaf9918ca (patch) | |
tree | d382a7e83d6b2bc7e6118ff6841135769b9bc936 /controller-server | |
parent | 46d56850fa4a438c509ba8c4e5e6f50ea91d53e5 (diff) |
Remove unused SecurityContext wiring
Diffstat (limited to 'controller-server')
4 files changed, 0 insertions, 104 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/CreateSecurityContextFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/CreateSecurityContextFilter.java deleted file mode 100644 index 5fc15f4baa6..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/CreateSecurityContextFilter.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.restapi.filter.securitycontext; - -import com.yahoo.jdisc.handler.ResponseHandler; -import com.yahoo.jdisc.http.filter.DiscFilterRequest; -import com.yahoo.jdisc.http.filter.SecurityRequestFilter; -import com.yahoo.vespa.hosted.controller.common.ContextAttributes; -import com.yahoo.yolean.chain.After; -import com.yahoo.yolean.chain.Provides; - -import javax.ws.rs.core.SecurityContext; -import java.security.Principal; - -/** - * Exposes the security information from the disc filter request - * by storing a security context in the request context. - * - * @author Tony Vaagenes - */ -@After("BouncerFilter") -@Provides("SecurityContext") -@SuppressWarnings("unused") // Injected -@Deprecated -// TODO Remove once Bouncer filter is gone -public class CreateSecurityContextFilter implements SecurityRequestFilter { - - @Override - public void filter(DiscFilterRequest request, ResponseHandler handler) { - request.setAttribute(ContextAttributes.SECURITY_CONTEXT_ATTRIBUTE, - new SecurityContext() { - @Override - public Principal getUserPrincipal() { - return request.getUserPrincipal(); - } - - @Override - public boolean isUserInRole(String role) { - return request.isUserInRole(role); - } - - @Override - public boolean isSecure() { - return request.isSecure(); - } - - @Override - public String getAuthenticationScheme() { - throw new UnsupportedOperationException(); - } - }); - } - -} diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/PropagateSecurityContextFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/PropagateSecurityContextFilter.java deleted file mode 100644 index 23f94f2fc21..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/PropagateSecurityContextFilter.java +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.restapi.filter.securitycontext; - -import com.yahoo.vespa.hosted.controller.common.ContextAttributes; - -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.PreMatching; -import javax.ws.rs.core.SecurityContext; -import javax.ws.rs.ext.Provider; -import java.io.IOException; - -/** - * Get the security context from the underlying Servlet request, and expose it to - * Jersey resources. - * - * @author Tony Vaagenes - */ -@PreMatching -@Provider -// TODO Remove once Bouncer filter is gone -@Deprecated -public class PropagateSecurityContextFilter implements ContainerRequestFilter { - @Override - public void filter(ContainerRequestContext requestContext) throws IOException { - SecurityContext securityContext = - (SecurityContext) requestContext.getProperty(ContextAttributes.SECURITY_CONTEXT_ATTRIBUTE); - - if (securityContext != null) { - requestContext.setSecurityContext(securityContext); - } - } -} diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/package-info.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/package-info.java deleted file mode 100644 index 0b98599dbb0..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/securitycontext/package-info.java +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -/** - * Jersey requires that the package is exported to be able to instantiate the filter. - * - * @author Tony Vaagenes - */ -@ExportPackage -package com.yahoo.vespa.hosted.controller.restapi.filter.securitycontext; - -import com.yahoo.osgi.annotation.ExportPackage; diff --git a/controller-server/src/main/resources/WEB-INF/web.xml b/controller-server/src/main/resources/WEB-INF/web.xml deleted file mode 100644 index f294a8eb46e..00000000000 --- a/controller-server/src/main/resources/WEB-INF/web.xml +++ /dev/null @@ -1,8 +0,0 @@ -<?xml version="1.0"?> -<!-- Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. --> -<jdisc-config> - <init-param> - <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name> - <param-value>com.yahoo.vespa.hosted.controller.restapi.filter.securitycontext.PropagateSecurityContextFilter</param-value> - </init-param> -</jdisc-config> |