diff --git a/core/trino-main/src/main/java/io/trino/server/ServerMainModule.java b/core/trino-main/src/main/java/io/trino/server/ServerMainModule.java index 6b4a5c768f61..ed1afaa01cc8 100644 --- a/core/trino-main/src/main/java/io/trino/server/ServerMainModule.java +++ b/core/trino-main/src/main/java/io/trino/server/ServerMainModule.java @@ -22,7 +22,6 @@ import com.google.inject.multibindings.ProvidesIntoSet; import io.airlift.concurrent.BoundedExecutor; import io.airlift.configuration.AbstractConfigurationAwareModule; -import io.airlift.http.server.HttpServerConfig; import io.airlift.slice.Slice; import io.airlift.stats.GcMonitor; import io.airlift.stats.JmxGcMonitor; @@ -206,11 +205,6 @@ protected void setup(Binder binder) } binder.bind(StartupStatus.class).in(Scopes.SINGLETON); - - configBinder(binder).bindConfigDefaults(HttpServerConfig.class, httpServerConfig -> { - httpServerConfig.setAdminEnabled(false); - }); - binder.bind(PreparedStatementEncoder.class).in(Scopes.SINGLETON); binder.bind(HttpRequestSessionContextFactory.class).in(Scopes.SINGLETON); install(new InternalCommunicationModule()); diff --git a/core/trino-main/src/test/java/io/trino/server/security/TestResourceSecurity.java b/core/trino-main/src/test/java/io/trino/server/security/TestResourceSecurity.java index b998049b84b4..4f7dd10d7bad 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/TestResourceSecurity.java +++ b/core/trino-main/src/test/java/io/trino/server/security/TestResourceSecurity.java @@ -1491,7 +1491,7 @@ private static TestingHttpServer createTestingJwkServer() HttpServerConfig config = new HttpServerConfig().setHttpPort(0); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); - return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet(), ImmutableMap.of()); + return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet()); } private static class JwkServlet diff --git a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOidcDiscovery.java b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOidcDiscovery.java index ffc58b801f0b..a9d425a79e8b 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOidcDiscovery.java +++ b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestOidcDiscovery.java @@ -311,7 +311,7 @@ public MetadataServer(HttpServlet servlet) NodeInfo nodeInfo = new NodeInfo("test"); HttpServerConfig config = new HttpServerConfig().setHttpPort(0); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); - httpServer = new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet, ImmutableMap.of()); + httpServer = new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet); httpServer.start(); } diff --git a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java index 63a6d72b4fcb..1b88a58b8d65 100644 --- a/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java +++ b/core/trino-main/src/test/java/io/trino/server/security/oauth2/TestingHydraIdentityProvider.java @@ -230,7 +230,7 @@ private TestingHttpServer createTestingLoginAndConsentServer() .setNodeInternalAddress(InetAddresses.toAddrString(InetAddress.getLocalHost()))); HttpServerConfig config = new HttpServerConfig().setHttpPort(0); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); - return new TestingHttpServer(httpServerInfo, nodeInfo, config, new AcceptAllLoginsAndConsentsServlet(), ImmutableMap.of()); + return new TestingHttpServer(httpServerInfo, nodeInfo, config, new AcceptAllLoginsAndConsentsServlet()); } private class AcceptAllLoginsAndConsentsServlet diff --git a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java index 77ea6891ffa8..02d0bd82b928 100644 --- a/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java +++ b/core/trino-main/src/test/java/io/trino/server/ui/TestWebUi.java @@ -1248,7 +1248,7 @@ private static TestingHttpServer createTestingJwkServer() HttpServerConfig config = new HttpServerConfig().setHttpPort(0); HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); - return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet(), ImmutableMap.of()); + return new TestingHttpServer(httpServerInfo, nodeInfo, config, new JwkServlet()); } private static class JwkServlet diff --git a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/util/TestingHttpServer.java b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/util/TestingHttpServer.java index 47e07a3c19ee..5d52ee44e8fe 100644 --- a/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/util/TestingHttpServer.java +++ b/lib/trino-plugin-toolkit/src/test/java/io/trino/plugin/base/util/TestingHttpServer.java @@ -13,14 +13,11 @@ */ package io.trino.plugin.base.util; -import com.google.common.collect.ImmutableMap; import com.google.common.io.ByteSource; import com.google.inject.Injector; -import com.google.inject.TypeLiteral; import io.airlift.bootstrap.Bootstrap; import io.airlift.bootstrap.LifeCycleManager; import io.airlift.http.server.HttpServerInfo; -import io.airlift.http.server.TheServlet; import io.airlift.http.server.testing.TestingHttpServerModule; import io.airlift.node.testing.TestingNodeModule; import jakarta.servlet.Servlet; @@ -33,7 +30,6 @@ import java.net.URI; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.Map; public class TestingHttpServer implements Closeable @@ -47,8 +43,7 @@ public TestingHttpServer() new TestingNodeModule(), new TestingHttpServerModule(), binder -> { - binder.bind(new TypeLiteral>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of()); - binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(new TestingHttpServlet()); + binder.bind(Servlet.class).toInstance(new TestingHttpServlet()); }); Injector injector = app diff --git a/plugin/trino-example-http/src/test/java/io/trino/plugin/example/ExampleHttpServer.java b/plugin/trino-example-http/src/test/java/io/trino/plugin/example/ExampleHttpServer.java index 8757a376e59e..c05817ea3edc 100644 --- a/plugin/trino-example-http/src/test/java/io/trino/plugin/example/ExampleHttpServer.java +++ b/plugin/trino-example-http/src/test/java/io/trino/plugin/example/ExampleHttpServer.java @@ -13,15 +13,12 @@ */ package io.trino.plugin.example; -import com.google.common.collect.ImmutableMap; import com.google.common.io.Resources; import com.google.inject.Binder; import com.google.inject.Injector; import com.google.inject.Module; -import com.google.inject.TypeLiteral; import io.airlift.bootstrap.Bootstrap; import io.airlift.bootstrap.LifeCycleManager; -import io.airlift.http.server.TheServlet; import io.airlift.http.server.testing.TestingHttpServer; import io.airlift.http.server.testing.TestingHttpServerModule; import io.airlift.node.testing.TestingNodeModule; @@ -33,7 +30,6 @@ import java.io.IOException; import java.net.URI; import java.net.URL; -import java.util.Map; public class ExampleHttpServer { @@ -71,8 +67,7 @@ private static class ExampleHttpServerModule @Override public void configure(Binder binder) { - binder.bind(new TypeLiteral>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of()); - binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(new ExampleHttpServlet()); + binder.bind(Servlet.class).toInstance(new ExampleHttpServlet()); } } diff --git a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestingThriftHttpMetastoreServer.java b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestingThriftHttpMetastoreServer.java index 5dcc7d2e2373..4688e5285bca 100644 --- a/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestingThriftHttpMetastoreServer.java +++ b/plugin/trino-hive/src/test/java/io/trino/plugin/hive/metastore/thrift/TestingThriftHttpMetastoreServer.java @@ -13,13 +13,10 @@ */ package io.trino.plugin.hive.metastore.thrift; -import com.google.common.collect.ImmutableMap; import com.google.inject.Injector; -import com.google.inject.TypeLiteral; import io.airlift.bootstrap.Bootstrap; import io.airlift.bootstrap.LifeCycleManager; import io.airlift.http.server.HttpServerInfo; -import io.airlift.http.server.TheServlet; import io.airlift.http.server.testing.TestingHttpServerModule; import io.airlift.node.testing.TestingNodeModule; import io.trino.hive.thrift.metastore.Database; @@ -37,7 +34,6 @@ import java.io.Closeable; import java.io.IOException; import java.net.URI; -import java.util.Map; import java.util.Optional; import java.util.function.Consumer; @@ -59,8 +55,7 @@ public TestingThriftHttpMetastoreServer(ThriftMetastore delegate, Consumer { - binder.bind(new TypeLiteral>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of()); - binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(thriftHttpServlet); + binder.bind(Servlet.class).toInstance(thriftHttpServlet); }); Injector injector = app diff --git a/plugin/trino-iceberg/src/test/java/org/apache/iceberg/rest/DelegatingRestSessionCatalog.java b/plugin/trino-iceberg/src/test/java/org/apache/iceberg/rest/DelegatingRestSessionCatalog.java index 97c335ed0ae3..94dd59843253 100644 --- a/plugin/trino-iceberg/src/test/java/org/apache/iceberg/rest/DelegatingRestSessionCatalog.java +++ b/plugin/trino-iceberg/src/test/java/org/apache/iceberg/rest/DelegatingRestSessionCatalog.java @@ -13,7 +13,6 @@ */ package org.apache.iceberg.rest; -import com.google.common.collect.ImmutableMap; import io.airlift.http.server.HttpServerConfig; import io.airlift.http.server.HttpServerInfo; import io.airlift.http.server.testing.TestingHttpServer; @@ -67,7 +66,7 @@ public TestingHttpServer testServer() HttpServerInfo httpServerInfo = new HttpServerInfo(config, nodeInfo); RestCatalogServlet servlet = new RestCatalogServlet(adapter); - return new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet, ImmutableMap.of()); + return new TestingHttpServer(httpServerInfo, nodeInfo, config, servlet); } public static Builder builder() diff --git a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/PrometheusHttpServer.java b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/PrometheusHttpServer.java index 221a9cde652f..60ea6b1456d6 100644 --- a/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/PrometheusHttpServer.java +++ b/plugin/trino-prometheus/src/test/java/io/trino/plugin/prometheus/PrometheusHttpServer.java @@ -13,15 +13,12 @@ */ package io.trino.plugin.prometheus; -import com.google.common.collect.ImmutableMap; import com.google.common.io.Resources; import com.google.inject.Binder; import com.google.inject.Injector; import com.google.inject.Module; -import com.google.inject.TypeLiteral; import io.airlift.bootstrap.Bootstrap; import io.airlift.bootstrap.LifeCycleManager; -import io.airlift.http.server.TheServlet; import io.airlift.http.server.testing.TestingHttpServer; import io.airlift.http.server.testing.TestingHttpServerModule; import io.airlift.node.testing.TestingNodeModule; @@ -33,7 +30,6 @@ import java.io.IOException; import java.net.URI; import java.net.URL; -import java.util.Map; import static io.trino.plugin.prometheus.PrometheusClient.METRICS_ENDPOINT; @@ -73,8 +69,7 @@ private static class PrometheusHttpServerModule @Override public void configure(Binder binder) { - binder.bind(new TypeLiteral>() {}).annotatedWith(TheServlet.class).toInstance(ImmutableMap.of()); - binder.bind(Servlet.class).annotatedWith(TheServlet.class).toInstance(new PrometheusHttpServlet()); + binder.bind(Servlet.class).toInstance(new PrometheusHttpServlet()); } } diff --git a/pom.xml b/pom.xml index 1bc26c506ba8..6e870c6e1606 100644 --- a/pom.xml +++ b/pom.xml @@ -184,7 +184,7 @@ 2.7.7-1 3.0.0 - 267 + 268 2.9.6 4.13.2 1.12.0 diff --git a/service/trino-proxy/src/main/java/io/trino/proxy/ProxyModule.java b/service/trino-proxy/src/main/java/io/trino/proxy/ProxyModule.java index f300098ca3ef..56b8af4b407f 100644 --- a/service/trino-proxy/src/main/java/io/trino/proxy/ProxyModule.java +++ b/service/trino-proxy/src/main/java/io/trino/proxy/ProxyModule.java @@ -16,7 +16,6 @@ import com.google.inject.Binder; import com.google.inject.Module; import com.google.inject.Scopes; -import io.airlift.http.server.HttpServerConfig; import static io.airlift.configuration.ConfigBinder.configBinder; import static io.airlift.http.client.HttpClientBinder.httpClientBinder; @@ -28,10 +27,6 @@ public class ProxyModule @Override public void configure(Binder binder) { - configBinder(binder).bindConfigDefaults(HttpServerConfig.class, httpServerConfig -> { - httpServerConfig.setAdminEnabled(false); - }); - httpClientBinder(binder).bindHttpClient("proxy", ForProxy.class); configBinder(binder).bindConfig(ProxyConfig.class);