From ffcf7ae90242949be623eff7f2e01562d311648b Mon Sep 17 00:00:00 2001 From: dan-rubinstein Date: Tue, 10 Dec 2024 14:54:35 -0500 Subject: [PATCH] Cleaning up unused role retrieval function --- .../transform/transforms/TransformConfig.java | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java index 49f7553637045..d84040aaf7a85 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformConfig.java @@ -24,13 +24,11 @@ import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; -import org.elasticsearch.xpack.core.ClientHelper; import org.elasticsearch.xpack.core.common.time.TimeUtils; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator; import org.elasticsearch.xpack.core.common.validation.SourceDestValidator.SourceDestValidation; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue; import org.elasticsearch.xpack.core.deprecation.DeprecationIssue.Level; -import org.elasticsearch.xpack.core.security.authc.support.AuthenticationContextSerializer; import org.elasticsearch.xpack.core.security.xcontent.XContentUtils; import org.elasticsearch.xpack.core.transform.TransformConfigVersion; import org.elasticsearch.xpack.core.transform.TransformDeprecations; @@ -43,7 +41,6 @@ import java.io.IOException; import java.time.Instant; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; @@ -52,7 +49,6 @@ import static org.elasticsearch.xcontent.ConstructingObjectParser.constructorArg; import static org.elasticsearch.xcontent.ConstructingObjectParser.optionalConstructorArg; -import static org.elasticsearch.xpack.core.security.authc.AuthenticationField.AUTHENTICATION_KEY; /** * This class holds the configuration details of a data frame transform @@ -412,20 +408,6 @@ public List checkForDeprecations(NamedXContentRegistry namedXC return deprecations; } - private List getRolesFromHeaders() throws IOException { - if (headers == null) { - return Collections.emptyList(); - } - - var encodedAuthenticationHeader = ClientHelper.filterSecurityHeaders(headers).getOrDefault(AUTHENTICATION_KEY, ""); - if (encodedAuthenticationHeader.isEmpty()) { - return Collections.emptyList(); - } - - var decodedAuthenticationHeader = AuthenticationContextSerializer.decode(encodedAuthenticationHeader); - return Arrays.asList(decodedAuthenticationHeader.getEffectiveSubject().getUser().roles()); - } - @Override public void writeTo(final StreamOutput out) throws IOException { out.writeString(id);