Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.inject.Inject;
import io.airlift.concurrent.ThreadPoolExecutorMBean;
import io.airlift.http.client.HttpClient;
import io.airlift.http.client.HttpClientConfig;
import io.airlift.node.NodeInfo;
import io.airlift.units.DataSize;
import io.airlift.units.Duration;
Expand Down Expand Up @@ -63,6 +64,7 @@ public DirectExchangeClientFactory(
FeaturesConfig featuresConfig,
DirectExchangeClientConfig config,
@ForExchange HttpClient httpClient,
@ForExchange HttpClientConfig httpClientConfig,
@ForExchange ScheduledExecutorService scheduler,
ExchangeManagerRegistry exchangeManagerRegistry)
{
Expand All @@ -72,6 +74,7 @@ public DirectExchangeClientFactory(
config.getMaxBufferSize(),
config.getDeduplicationBufferSize(),
config.getMaxResponseSize(),
httpClientConfig.getMaxContentLength(),
config.getConcurrentRequestMultiplier(),
config.getMaxErrorDuration(),
config.isAcknowledgePages(),
Expand All @@ -87,6 +90,7 @@ public DirectExchangeClientFactory(
DataSize maxBufferedBytes,
DataSize deduplicationBufferSize,
DataSize maxResponseSize,
DataSize maxClientResponseSize,
int concurrentRequestMultiplier,
Duration maxErrorDuration,
boolean acknowledgePages,
Expand All @@ -107,7 +111,7 @@ public DirectExchangeClientFactory(
// Use only 0.75 of the maxResponseSize to leave room for additional bytes from the encoding
// TODO figure out a better way to compute the size of data that will be transferred over the network
requireNonNull(maxResponseSize, "maxResponseSize is null");
long maxResponseSizeBytes = (long) (Math.min(httpClient.getMaxContentLength(), maxResponseSize.toBytes()) * 0.75);
long maxResponseSizeBytes = (long) (Math.min(maxClientResponseSize.toBytes(), maxResponseSize.toBytes()) * 0.75);
this.maxResponseSize = DataSize.ofBytes(maxResponseSizeBytes);

this.scheduler = requireNonNull(scheduler, "scheduler is null");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import static io.airlift.configuration.ConfigBinder.configBinder;
import static io.airlift.configuration.ConfigurationAwareModule.combine;
import static io.airlift.http.server.HttpServer.ClientCertificate.REQUESTED;
import static io.airlift.http.server.HttpServerConfig.ProcessForwardedMode.ACCEPT;
import static io.airlift.jaxrs.JaxrsBinder.jaxrsBinder;
import static io.trino.server.security.ResourceSecurityBinder.resourceSecurityBinder;
import static java.util.Locale.ENGLISH;
Expand Down Expand Up @@ -139,7 +140,7 @@ private void insecureHttpAuthenticationDefaults()
HttpServerConfig httpServerConfig = buildConfigObject(HttpServerConfig.class);
SecurityConfig securityConfig = buildConfigObject(SecurityConfig.class);
// if secure https authentication is enabled, disable insecure authentication over http
if ((httpServerConfig.isHttpsEnabled() || httpServerConfig.isProcessForwarded()) &&
if ((httpServerConfig.isHttpsEnabled() || httpServerConfig.getProcessForwarded() == ACCEPT) &&
!securityConfig.getAuthenticationTypes().equals(ImmutableList.of("insecure"))) {
install(binder -> configBinder(binder).bindConfigDefaults(SecurityConfig.class, config -> config.setInsecureAuthenticationOverHttpAllowed(false)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableList;
import io.airlift.http.client.HttpClient;
import io.airlift.http.client.HttpClientConfig;
import io.airlift.http.client.testing.TestingHttpClient;
import io.airlift.node.NodeInfo;
import io.airlift.tracing.Tracing;
Expand Down Expand Up @@ -95,6 +96,7 @@ public void setUp()
new FeaturesConfig(),
new DirectExchangeClientConfig(),
httpClient,
new HttpClientConfig(),
executor,
new ExchangeManagerRegistry(OpenTelemetry.noop(), Tracing.noopTracer()));
orderingCompiler = new OrderingCompiler(new TypeOperators());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<!-- keep dependency properties sorted -->
<dep.accumulo-hadoop.version>2.7.7-1</dep.accumulo-hadoop.version>
<dep.accumulo.version>3.0.0</dep.accumulo.version>
<dep.airlift.version>252</dep.airlift.version>
<dep.airlift.version>254</dep.airlift.version>
<dep.alluxio.version>2.9.6</dep.alluxio.version>
<dep.antlr.version>4.13.1</dep.antlr.version>
<dep.avro.version>1.11.3</dep.avro.version>
Expand Down
2 changes: 1 addition & 1 deletion testing/trino-testing/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>12.0.11</version>
<version>12.0.12</version>
</dependency>

<dependency>
Expand Down