diff options
Diffstat (limited to 'controller-server')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/Auth0RoleFilter.java | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/Auth0RoleFilter.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/Auth0RoleFilter.java deleted file mode 100644 index 25d5b72b7e4..00000000000 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/filter/Auth0RoleFilter.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.yahoo.vespa.hosted.controller.restapi.filter; - -import com.yahoo.jdisc.http.filter.DiscFilterRequest; -import com.yahoo.jdisc.http.filter.security.base.JsonSecurityRequestFilterBase; -import com.yahoo.vespa.hosted.controller.api.role.RoleMembership; -import com.yahoo.vespa.hosted.controller.api.role.RolePrincipal; - -import java.util.Objects; -import java.util.Optional; - -/** - * Enriches the request principal with roles from Athenz. - * - * @author jonmv - */ -public class Auth0RoleFilter extends JsonSecurityRequestFilterBase { - - @Override - protected Optional<ErrorResponse> filter(DiscFilterRequest request) { - return Optional.empty(); - } - - - private static class Auth0RolePrincipal implements RolePrincipal { - - private final String name; - private final RoleMembership roles; - - public Auth0RolePrincipal(String name, RoleMembership roles) { - if (name.isBlank()) throw new IllegalArgumentException("Name may not be blank."); - this.name = name; - this.roles = Objects.requireNonNull(roles); - } - - @Override - public String getName() { - return name; - } - - @Override - public RoleMembership roles() { - return roles; - } - - } - -} |