diff options
author | Martin Polden <mpolden@mpolden.no> | 2017-11-01 08:30:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-01 08:30:05 +0100 |
commit | dfd1b259cce3d106e8eaf8e4bebd3f6e2020ae2a (patch) | |
tree | 904ba1504af45451b6936fd8ddcda84ac130c8bf /controller-server | |
parent | 61678dc3e6e37b75729894ea4bd85be3ecefd6bc (diff) | |
parent | 045d53c0c18ec9641c26674fb4c5bcf85f2ebd5d (diff) |
Merge pull request #3953 from vespa-engine/bjorncs/cleanup
Remove unused files
Diffstat (limited to 'controller-server')
2 files changed, 0 insertions, 67 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/UnauthenticatedUserPrincipal.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/UnauthenticatedUserPrincipal.java deleted file mode 100644 index a88e881ce9d..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/UnauthenticatedUserPrincipal.java +++ /dev/null @@ -1,44 +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; - -import java.security.Principal; -import java.util.Objects; - -/** - * A principal for an unauthenticated user (typically from a trusted host). - * This principal should only be used in combination with machine authentication! - * - * @author bjorncs - */ -public class UnauthenticatedUserPrincipal implements Principal { - private final String username; - - public UnauthenticatedUserPrincipal(String username) { - this.username = username; - } - - @Override - public String getName() { - return username; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - UnauthenticatedUserPrincipal that = (UnauthenticatedUserPrincipal) o; - return Objects.equals(username, that.username); - } - - @Override - public int hashCode() { - return Objects.hash(username); - } - - @Override - public String toString() { - return "UnauthenticatedUserPrincipal{" + - "username='" + username + '\'' + - '}'; - } -} diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/UserIdRequestFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/UserIdRequestFilter.java deleted file mode 100644 index 46df4d7a603..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/UserIdRequestFilter.java +++ /dev/null @@ -1,23 +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; - -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.api.nonpublic.HeaderFields; -import com.yahoo.yolean.chain.Before; - -/** - * Allows hosts using host-based authentication to set user ID. - * - * @author Tony Vaagenes - */ -@Before("CreateSecurityContextFilter") -public class UserIdRequestFilter implements SecurityRequestFilter { - - @Override - public void filter(DiscFilterRequest request, ResponseHandler handler) { - String userName = request.getHeader(HeaderFields.USER_ID_HEADER_FIELD); - request.setUserPrincipal(new UnauthenticatedUserPrincipal(userName)); - } -} |