You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by fa...@apache.org on 2025/09/09 08:41:30 UTC
(pekko-http) branch main updated: remove some deprecated code (#728)
This is an automated email from the ASF dual-hosted git repository.
fanningpj pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-http.git
The following commit(s) were added to refs/heads/main by this push:
new 5ef95eb7a remove some deprecated code (#728)
5ef95eb7a is described below
commit 5ef95eb7a5d1aad662927d5b9d0d386be37d95ad
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Tue Sep 9 09:41:24 2025 +0100
remove some deprecated code (#728)
* begin removing deprecations
Update HttpChallenge.java
Update CorsSettings.scala
encoder
Update CookieDirectivesExamplesTest.java
Update SizeLimitSpec.scala
compile issues
Update Encoder.scala
mima
Update Encoder.scala
Update Encoder.scala
more changes
issues
Update SizeLimitSpec.scala
rename file
more
more
Update HeaderDirectivesSpec.scala
Update remove-deprecated-methods.excludes
more
move mima
unused imports
Update ServerSettingsImpl.scala
Update ServerSettings.scala
* start to remove use of PekkoSSLConfig
update
Update ConnectionContext.scala
Update remove-deprecated-methods.excludes
try SNI matcher
Update ClientServerSpec.scala
try to fix test
* remove bindAndHandleAsync
* Update remove-deprecated-methods.excludes
* remove use of deprecated TLS methods
* Update HttpAPIsTest.java
* Update remove-deprecated-methods.excludes
* HttpChallenge
---
.../routing-dsl/directives/alphabetically.md | 3 +-
.../extractUpgradeToWebSocket.md | 22 ---
.../directives/websocket-directives/index.md | 1 -
docs/src/main/paradox/server-side/low-level-api.md | 4 +-
.../http/javadsl/CustomStatusCodesExampleTest.java | 2 +-
.../directives/CookieDirectivesExamplesTest.java | 1 +
.../WebSocketDirectivesExamplesTest.java | 6 -
.../apache/pekko/http/javadsl/TimeoutAccess.java | 2 +-
.../apache/pekko/http/javadsl/model/FormData.java | 13 +-
.../http/javadsl/model/headers/HttpChallenge.java | 16 --
.../http/javadsl/model/headers/HttpCookie.java | 30 ----
.../remove-deprecated-methods.excludes | 89 +++++++++++
.../pekko/http/impl/engine/http2/Http2.scala | 19 +--
.../impl/engine/server/HttpServerBluePrint.scala | 2 +-
.../http/impl/settings/ServerSettingsImpl.scala | 19 +--
.../pekko/http/javadsl/ConnectionContext.scala | 79 +---------
.../scala/org/apache/pekko/http/javadsl/Http.scala | 120 +--------------
.../http/javadsl/settings/ServerSettings.scala | 12 +-
.../pekko/http/scaladsl/ConnectionContext.scala | 84 +----------
.../org/apache/pekko/http/scaladsl/Http.scala | 163 ++-------------------
.../pekko/http/scaladsl/model/FormData.scala | 6 -
.../pekko/http/scaladsl/model/HttpEntity.scala | 14 --
.../pekko/http/scaladsl/model/HttpMessage.scala | 26 ----
.../http/scaladsl/model/headers/HttpCookie.scala | 62 +-------
.../http/scaladsl/settings/ServerSettings.scala | 23 ---
.../pekko/http/javadsl/ConnectHttpSpec.scala | 4 +-
.../pekko/http/javadsl/ConnectionContextSpec.scala | 43 ------
.../pekko/http/scaladsl/ClientServerSpec.scala | 37 +++--
.../remove-deprecated-methods.excludes | 20 +++
.../http/cors/javadsl/settings/CorsSettings.scala | 7 -
.../http/cors/scaladsl/settings/CorsSettings.scala | 9 +-
.../apache/pekko/http/javadsl/HttpAPIsTest.java | 4 +-
.../pekko/http/scaladsl/server/SizeLimitSpec.scala | 16 +-
.../server/directives/HeaderDirectivesSpec.scala | 22 ---
.../remove-deprecated-methods.excludes | 44 ++++++
.../http/impl/settings/RoutingSettingsImpl.scala | 5 -
.../server/directives/WebSocketDirectives.scala | 16 +-
.../http/javadsl/settings/RoutingSettings.scala | 10 --
.../sse/EventStreamUnmarshalling.scala | 7 -
.../pekko/http/scaladsl/coding/Deflate.scala | 2 +-
.../http/scaladsl/coding/DeflateCompressor.scala | 3 +-
.../pekko/http/scaladsl/coding/Encoder.scala | 10 +-
.../apache/pekko/http/scaladsl/coding/Gzip.scala | 2 +-
.../pekko/http/scaladsl/coding/NoCoding.scala | 5 +-
.../server/directives/HeaderDirectives.scala | 22 ---
.../server/directives/WebSocketDirectives.scala | 15 +-
.../http/scaladsl/settings/RoutingSettings.scala | 14 --
.../sse/EventStreamUnmarshalling.scala | 22 ---
48 files changed, 243 insertions(+), 914 deletions(-)
diff --git a/docs/src/main/paradox/routing-dsl/directives/alphabetically.md b/docs/src/main/paradox/routing-dsl/directives/alphabetically.md
index 4ee3e146f..21cf3f5ff 100644
--- a/docs/src/main/paradox/routing-dsl/directives/alphabetically.md
+++ b/docs/src/main/paradox/routing-dsl/directives/alphabetically.md
@@ -49,8 +49,7 @@
|@scala[@ref[extractRequestEntity](basic-directives/extractRequestEntity.md)] | @scala[Extracts the @apidoc[RequestEntity] from the @apidoc[RequestContext]] |
|@ref[extractScheme](scheme-directives/extractScheme.md) | Extracts the URI scheme from the request |
|@ref[extractSettings](basic-directives/extractSettings.md) | Extracts the @apidoc[RoutingSettings] from the @apidoc[RequestContext] |
-|@ref[extractUnmatchedPath](basic-directives/extractUnmatchedPath.md) | Extracts the yet unmatched path from the @apidoc[RequestContext] |
-|@ref[extractUpgradeToWebSocket](websocket-directives/extractUpgradeToWebSocket.md) | Extract the @apidoc[UpgradeToWebSocket] header if existent and otherwise rejects with an @apidoc[ExpectedWebSocketRequestRejection$] |
+|@ref[extractUnmatchedPath](basic-directives/extractUnmatchedPath.md) | Extracts the yet unmatched path from the @apidoc[RequestContext] | |
|@ref[extractUri](basic-directives/extractUri.md) | Extracts the complete request URI |
|@ref[failWith](route-directives/failWith.md) | Bubbles the given error up the response chain where it is dealt with by the closest @ref[handleExceptions](execution-directives/handleExceptions.md) directive and its @apidoc[ExceptionHandler] |
|@ref[fileUpload](file-upload-directives/fileUpload.md) | Provides a stream of an uploaded file from a multipart request |
diff --git a/docs/src/main/paradox/routing-dsl/directives/websocket-directives/extractUpgradeToWebSocket.md b/docs/src/main/paradox/routing-dsl/directives/websocket-directives/extractUpgradeToWebSocket.md
deleted file mode 100644
index f2e5c0da4..000000000
--- a/docs/src/main/paradox/routing-dsl/directives/websocket-directives/extractUpgradeToWebSocket.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# extractUpgradeToWebSocket
-
-@@@ div { .group-scala }
-
-## Signature
-
-@@signature [WebSocketDirectives.scala](/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/WebSocketDirectives.scala) { #extractUpgradeToWebSocket }
-
-@@@
-
-## Description
-
-This directive is deprecated, see @ref[extractWebSocketUpgrade](extractWebSocketUpgrade.md) instead.
-
-If you are looking for a building block for @ref[Custom Directives](../custom-directives.md) to provide the websocket upgrade information to the inner route,
-we recommend using the @apidoc[WebSocketUpgrade] @ref[attribute](../../../common/http-model.md#attributes) instead:
-
-Scala
-: @@snip [WebSocketDirectivesExamplesSpec.scala](/docs/src/test/scala/docs/http/scaladsl/server/directives/WebSocketDirectivesExamplesSpec.scala) { #extractWebSocketUpgrade }
-
-Java
-: @@snip [WebSocketDirectivesExamplesTest.java](/docs/src/test/java/docs/http/javadsl/server/directives/WebSocketDirectivesExamplesTest.java) { #extractWebSocketUpgrade }
diff --git a/docs/src/main/paradox/routing-dsl/directives/websocket-directives/index.md b/docs/src/main/paradox/routing-dsl/directives/websocket-directives/index.md
index 005cffc3b..7f57da275 100644
--- a/docs/src/main/paradox/routing-dsl/directives/websocket-directives/index.md
+++ b/docs/src/main/paradox/routing-dsl/directives/websocket-directives/index.md
@@ -5,7 +5,6 @@
@@@ index
* [extractOfferedWsProtocols](extractOfferedWsProtocols.md)
-* [extractUpgradeToWebSocket](extractUpgradeToWebSocket.md)
* [extractWebSocketUpgrade](extractWebSocketUpgrade.md)
* [handleWebSocketMessages](handleWebSocketMessages.md)
* [handleWebSocketMessagesForOptionalProtocol](handleWebSocketMessagesForOptionalProtocol.md)
diff --git a/docs/src/main/paradox/server-side/low-level-api.md b/docs/src/main/paradox/server-side/low-level-api.md
index fc2ab5fa9..3d0fb611f 100644
--- a/docs/src/main/paradox/server-side/low-level-api.md
+++ b/docs/src/main/paradox/server-side/low-level-api.md
@@ -158,9 +158,7 @@ HTTP pipelining is generally discouraged (and [disabled by most browsers](https:
is nevertheless fully supported in Apache Pekko HTTP. The limit is applied on two levels. First, there's the
`pekko.http.server.pipelining-limit` config setting which prevents that more than the given number of outstanding requests
is ever given to the user-supplied handler-flow. On the other hand, the handler flow itself can apply any kind of throttling
-itself. If you use the `Http.bindAndHandleAsync`
-entry-point, you can specify the `parallelism` argument (which defaults to `1`, which means that pipelining is disabled) to control the
-number of concurrent requests per connection. If you use `Http.bindAndHandle` or `Http.bind`, the user-supplied handler
+itself. If you use `Http.bindAndHandle` or `Http.bind`, the user-supplied handler
flow has full control over how many request it accepts simultaneously by applying backpressure. In this case, you can
e.g. use Apache Pekko Stream's `mapAsync` combinator with a given parallelism to limit the number of concurrently handled requests.
Effectively, the more constraining one of these two measures, config setting and manual flow shaping, will determine
diff --git a/docs/src/test/java/docs/http/javadsl/CustomStatusCodesExampleTest.java b/docs/src/test/java/docs/http/javadsl/CustomStatusCodesExampleTest.java
index 8f89d38e2..65d883faf 100644
--- a/docs/src/test/java/docs/http/javadsl/CustomStatusCodesExampleTest.java
+++ b/docs/src/test/java/docs/http/javadsl/CustomStatusCodesExampleTest.java
@@ -89,7 +89,7 @@ public class CustomStatusCodesExampleTest extends JUnitRouteTest {
Http.get(system)
.singleRequest(
HttpRequest.GET("http://" + host + ":" + port + "/"),
- ConnectionContext.https(SSLContext.getDefault()),
+ ConnectionContext.httpsClient(SSLContext.getDefault()),
clientSettings,
system.log())
.toCompletableFuture()
diff --git a/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java b/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java
index 5b08bb156..a9c9c1910 100644
--- a/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java
+++ b/docs/src/test/java/docs/http/javadsl/server/directives/CookieDirectivesExamplesTest.java
@@ -109,6 +109,7 @@ public class CookieDirectivesExamplesTest extends JUnitRouteTest {
Optional.empty(),
false,
false,
+ Optional.empty(),
Optional.empty()));
testRoute(route)
diff --git a/docs/src/test/java/docs/http/javadsl/server/directives/WebSocketDirectivesExamplesTest.java b/docs/src/test/java/docs/http/javadsl/server/directives/WebSocketDirectivesExamplesTest.java
index 4ee92b21a..013ff3b36 100644
--- a/docs/src/test/java/docs/http/javadsl/server/directives/WebSocketDirectivesExamplesTest.java
+++ b/docs/src/test/java/docs/http/javadsl/server/directives/WebSocketDirectivesExamplesTest.java
@@ -45,12 +45,6 @@ import static org.apache.pekko.http.javadsl.server.Directives.handleWebSocketMes
import static org.apache.pekko.http.javadsl.server.Directives.handleWebSocketMessagesForProtocol;
// #handleWebSocketMessagesForProtocol
-// #extractUpgradeToWebSocket
-import org.apache.pekko.http.javadsl.model.AttributeKeys;
-import static org.apache.pekko.http.javadsl.server.Directives.complete;
-import static org.apache.pekko.http.javadsl.server.Directives.extractUpgradeToWebSocket;
-
-// #extractUpgradeToWebSocket
// #extractOfferedWsProtocols
import static org.apache.pekko.http.javadsl.server.Directives.extractOfferedWsProtocols;
import static org.apache.pekko.http.javadsl.server.Directives.handleWebSocketMessagesForOptionalProtocol;
diff --git a/http-core/src/main/java/org/apache/pekko/http/javadsl/TimeoutAccess.java b/http-core/src/main/java/org/apache/pekko/http/javadsl/TimeoutAccess.java
index 1c3da3036..68af7795b 100644
--- a/http-core/src/main/java/org/apache/pekko/http/javadsl/TimeoutAccess.java
+++ b/http-core/src/main/java/org/apache/pekko/http/javadsl/TimeoutAccess.java
@@ -16,7 +16,7 @@ package org.apache.pekko.http.javadsl;
import org.apache.pekko.annotation.DoNotInherit;
import org.apache.pekko.http.javadsl.model.HttpRequest;
import org.apache.pekko.http.javadsl.model.HttpResponse;
-import org.apache.pekko.japi.Function;
+import org.apache.pekko.japi.function.Function;
import scala.concurrent.duration.Duration;
/**
diff --git a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/FormData.java b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/FormData.java
index ec9c22adf..ece39099a 100644
--- a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/FormData.java
+++ b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/FormData.java
@@ -28,19 +28,8 @@ public final class FormData {
/** Converts this FormData to a RequestEntity using UTF8 encoding. */
public RequestEntity toEntity() {
- return toEntity(HttpCharsets.UTF_8);
- }
-
- /**
- * Converts this FormData to a RequestEntity using the given encoding.
- *
- * @deprecated FormData always uses charset UTF-8 without appending the charset to 'Content-Type:
- * application/x-www-form-urlencoded', use toEntity() instead.
- */
- @Deprecated // since Akka HTTP 10.1.8
- public RequestEntity toEntity(HttpCharset charset) {
return HttpEntities.create(
- ContentTypes.APPLICATION_X_WWW_FORM_URLENCODED, fields.render(charset));
+ ContentTypes.APPLICATION_X_WWW_FORM_URLENCODED, fields.render(HttpCharsets.UTF_8));
}
/** Returns empty FormData. */
diff --git a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpChallenge.java b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpChallenge.java
index 1b43fddad..b9a8428ba 100644
--- a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpChallenge.java
+++ b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpChallenge.java
@@ -14,7 +14,6 @@
package org.apache.pekko.http.javadsl.model.headers;
import org.apache.pekko.http.impl.util.Util;
-import org.apache.pekko.japi.Option;
import org.apache.pekko.util.OptionConverters;
import java.util.HashMap;
@@ -36,27 +35,12 @@ public abstract class HttpChallenge {
return create(scheme, Optional.of(realm), params);
}
- /** @deprecated Use {@link #create(String, Optional)} instead. */
- @Deprecated // since 1.3.0
- public static HttpChallenge create(String scheme, Option<String> realm) {
- return org.apache.pekko.http.scaladsl.model.headers.HttpChallenge.apply(
- scheme, realm.asScala(), Util.emptyMap);
- }
-
/** @since 1.3.0 */
public static HttpChallenge create(String scheme, Optional<String> realm) {
return org.apache.pekko.http.scaladsl.model.headers.HttpChallenge.apply(
scheme, OptionConverters.toScala(realm), Util.emptyMap);
}
- /** @deprecated Use {@link #create(String, Optional, Map<String, String>)} instead. */
- @Deprecated // since 1.3.0
- public static HttpChallenge create(
- String scheme, Option<String> realm, Map<String, String> params) {
- return org.apache.pekko.http.scaladsl.model.headers.HttpChallenge.apply(
- scheme, realm.asScala(), Util.convertMapToScala(params));
- }
-
/** @since 1.3.0 */
public static HttpChallenge create(
String scheme, Optional<String> realm, Map<String, String> params) {
diff --git a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpCookie.java b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpCookie.java
index 26b6220d9..5b28c16af 100644
--- a/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpCookie.java
+++ b/http-core/src/main/java/org/apache/pekko/http/javadsl/model/headers/HttpCookie.java
@@ -74,36 +74,6 @@ public abstract class HttpCookie {
Util.<org.apache.pekko.http.scaladsl.model.headers.SameSite>scalaNone());
}
- /**
- * @deprecated Since Akka HTTP 10.2.0. Use {@link #create(String, String, Optional, OptionalLong,
- * Optional, Optional, boolean, boolean, Optional, Optional)} instead.
- */
- @Deprecated
- @SuppressWarnings("unchecked")
- public static HttpCookie create(
- String name,
- String value,
- Optional<DateTime> expires,
- OptionalLong maxAge,
- Optional<String> domain,
- Optional<String> path,
- boolean secure,
- boolean httpOnly,
- Optional<String> extension) {
- return new org.apache.pekko.http.scaladsl.model.headers.HttpCookie(
- name,
- value,
- Util.<DateTime, org.apache.pekko.http.scaladsl.model.DateTime>convertOptionalToScala(
- expires),
- Util.convertOptionalToScala(maxAge),
- OptionConverters.toScala(domain),
- OptionConverters.toScala(path),
- secure,
- httpOnly,
- OptionConverters.toScala(extension),
- Util.<org.apache.pekko.http.scaladsl.model.headers.SameSite>scalaNone());
- }
-
@SuppressWarnings("unchecked")
public static HttpCookie create(
String name,
diff --git a/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
new file mode 100644
index 000000000..87ac36e09
--- /dev/null
+++ b/http-core/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
@@ -0,0 +1,89 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Remove deprecated methods
+ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.impl.engine.server.HttpServerBluePrint#TimeoutAccessImpl.update")
+ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.impl.engine.server.HttpServerBluePrint#TimeoutAccessImpl.updateHandler")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.ConnectionContext.https")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.ConnectionContext.sslConfig")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.Http.bindAndHandleAsync")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.Http.bindAndHandleSync")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.Http.createServerHttpsContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.Http.createClientHttpsContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.Http.createDefaultClientHttpsContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.HttpConnectionContext.sslConfig")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.HttpsConnectionContext.getEnabledCipherSuites")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.HttpsConnectionContext.getEnabledProtocols")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.HttpsConnectionContext.getClientAuth")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.HttpsConnectionContext.getSslContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.HttpsConnectionContext.getSslParameters")
+ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.TimeoutAccess.updateHandler")
+ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.TimeoutAccess.update")
+ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.javadsl.TimeoutAccess.updateHandler")
+ProblemFilters.exclude[ReversedMissingMethodProblem]("org.apache.pekko.http.javadsl.TimeoutAccess.update")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.model.FormData.toEntity")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.model.headers.HttpCookie.create")
+ProblemFilters.exclude[IncompatibleMethTypeProblem]("org.apache.pekko.http.javadsl.model.headers.HttpChallenge.create")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.ServerSettings.getWebsocketRandomFactory")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.ServerSettings.withWebsocketRandomFactory")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.ConnectionContext.https")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.ConnectionContext.https$*")
+ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.http.scaladsl.ConnectionContext.https$*")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.http.scaladsl.DefaultSSLContextCreation")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.http.scaladsl.DeprecatedSslContextParameters")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.http.scaladsl.DeprecatedSslContextParameters$")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.sslContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.enabledCipherSuites")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.enabledProtocols")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.clientAuth")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.sslContextData")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.sslParameters")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.getSslContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.getEnabledCipherSuites")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.getEnabledProtocols")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.getClientAuth")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.getSslParameters")
+ProblemFilters.exclude[MissingTypesProblem]("org.apache.pekko.http.scaladsl.HttpExt")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.bindAndHandleSync")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.bindAndHandleSync$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.bindAndHandleAsync")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.bindAndHandleAsync$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.createDefaultClientHttpsContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.createServerHttpsContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.createClientHttpsContext")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.sslConfig")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpExt.validateAndWarnAboutLooseSettings")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.<init>$*")
+ProblemFilters.exclude[IncompatibleSignatureProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.<init>$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.sslConfig")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext.this")
+ProblemFilters.exclude[MissingClassProblem]("org.apache.pekko.http.scaladsl.HttpsConnectionContext$")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.FormData.toEntity")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpEntity.limitableByteSource")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpEntity.limitableChunkSource")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpRequest.copy")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpRequest.copy$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpResponse.copy")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.HttpResponse.copy$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.headers.HttpCookie.fromPair")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.headers.HttpCookie.fromPair$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.headers.HttpCookie.<init>$*")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.headers.HttpCookie.unapply")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.model.headers.HttpCookie.this")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ServerSettings.websocketRandomFactory")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ServerSettings.getWebsocketRandomFactory")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.ServerSettings.withWebsocketRandomFactory")
diff --git a/http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/Http2.scala b/http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/Http2.scala
index c30618635..5a81eedfb 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/Http2.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/impl/engine/http2/Http2.scala
@@ -44,7 +44,6 @@ import pekko.http.scaladsl.settings.ServerSettings
import pekko.stream.Attributes
import pekko.stream.TLSClosing
import pekko.stream.TLSProtocol.{ SslTlsInbound, SslTlsOutbound }
-import pekko.stream.impl.io.TlsUtils
import pekko.stream.scaladsl.{ Flow, Keep, Sink, Source, TLS, TLSPlacebo, Tcp }
import pekko.stream.{ IgnoreComplete, Materializer }
import pekko.util.ByteString
@@ -219,15 +218,8 @@ private[http] final class Http2Ext(implicit val system: ActorSystem)
def getChosenProtocol(): String = chosenProtocol.getOrElse(Http2AlpnSupport.HTTP11) // default to http/1, e.g. when ALPN jar is missing
var eng: Option[SSLEngine] = None
- @nowarn("msg=deprecated") // TODO find an alternative way to do this
def createEngine(): SSLEngine = {
- val engine = httpsContext.sslContextData match {
- case Left(ssl) =>
- val e = ssl.sslContext.createSSLEngine()
- TlsUtils.applySessionParameters(e, ssl.firstSession)
- e
- case Right(e) => e(None)
- }
+ val engine = httpsContext.engineCreator(None)
eng = Some(engine)
engine.setUseClientMode(false)
Http2AlpnSupport.enableForServer(engine, setChosenProtocol)
@@ -244,14 +236,7 @@ private[http] final class Http2Ext(implicit val system: ActorSystem)
: Flow[HttpRequest, HttpResponse, Future[OutgoingConnection]] = {
@nowarn("msg=deprecated") // TODO find an alternative way to do this
def createEngine(): SSLEngine = {
- val engine = connectionContext.sslContextData match {
- // TODO FIXME configure hostname verification for this case
- case Left(ssl) =>
- val e = ssl.sslContext.createSSLEngine(host, port)
- TlsUtils.applySessionParameters(e, ssl.firstSession)
- e
- case Right(e) => e(Some((host, port)))
- }
+ val engine = connectionContext.engineCreator(Some((host, port)))
engine.setUseClientMode(true)
Http2AlpnSupport.clientSetApplicationProtocols(engine, Array("h2"))
engine
diff --git a/http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala b/http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala
index fae7f094f..c745fc86e 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/impl/engine/server/HttpServerBluePrint.scala
@@ -23,7 +23,7 @@ import pekko.NotUsed
import pekko.actor.Cancellable
import pekko.annotation.InternalApi
import pekko.dispatch.ExecutionContexts
-import pekko.japi.Function
+import pekko.japi.function.Function
import pekko.event.LoggingAdapter
import pekko.http.ParsingErrorHandler
import pekko.util.ByteString
diff --git a/http-core/src/main/scala/org/apache/pekko/http/impl/settings/ServerSettingsImpl.scala b/http-core/src/main/scala/org/apache/pekko/http/impl/settings/ServerSettingsImpl.scala
index dfc40a914..ab05102f0 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/impl/settings/ServerSettingsImpl.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/impl/settings/ServerSettingsImpl.scala
@@ -13,27 +13,24 @@
package org.apache.pekko.http.impl.settings
-import java.util.Random
-
-import org.apache.pekko
-import pekko.http.scaladsl.settings.{ SettingsCompanion => _, _ }
-import com.typesafe.config.Config
-
import scala.language.implicitConversions
import scala.collection.immutable
import scala.concurrent.duration._
-import pekko.http.javadsl.{ settings => js }
+import scala.util.Try
+
+import com.typesafe.config.Config
+import org.apache.pekko
import pekko.ConfigurationException
import pekko.actor.{ ActorSystem, ExtendedActorSystem }
import pekko.annotation.InternalApi
import pekko.http.ParsingErrorHandler
-import pekko.io.Inet.SocketOption
import pekko.http.impl.util._
+import pekko.http.javadsl.{ settings => js }
import pekko.http.scaladsl.model.{ HttpHeader, HttpResponse, StatusCodes }
import pekko.http.scaladsl.model.headers.{ Host, Server }
+import pekko.http.scaladsl.settings.{ SettingsCompanion => _, _ }
import pekko.http.scaladsl.settings.ServerSettings.LogUnencryptedNetworkBytes
-
-import scala.util.Try
+import pekko.io.Inet.SocketOption
/** INTERNAL API */
@InternalApi
@@ -70,8 +67,6 @@ private[pekko] final case class ServerSettingsImpl(
Try { parserSettings.maxContentLength }.isSuccess,
"The provided ParserSettings is a generic object that does not contain the server-specific settings.")
- override def websocketRandomFactory: () => Random = websocketSettings.randomFactory
-
override def productPrefix = "ServerSettings"
private[http] def parsingErrorHandlerInstance(system: ActorSystem): ParsingErrorHandler =
diff --git a/http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala b/http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala
index 1ff5f086c..a3db9958f 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/javadsl/ConnectionContext.scala
@@ -13,18 +13,11 @@
package org.apache.pekko.http.javadsl
-import java.util.{ Collection => JCollection, Optional }
-
-import scala.annotation.nowarn
+import javax.net.ssl.{ SSLContext, SSLEngine }
import org.apache.pekko
import pekko.annotation.{ ApiMayChange, DoNotInherit }
-import pekko.http.impl.util.Util
import pekko.http.scaladsl
-import pekko.stream.TLSClientAuth
-import pekko.util.OptionConverters._
-import com.typesafe.sslconfig.pekko.PekkoSSLConfig
-import javax.net.ssl.{ SSLContext, SSLEngine, SSLParameters }
object ConnectionContext {
// #https-server-context-creation
@@ -60,51 +53,6 @@ object ConnectionContext {
def httpsClient(createEngine: pekko.japi.function.Function2[String, Integer, SSLEngine]): HttpsConnectionContext =
scaladsl.ConnectionContext.httpsClient((host, port) => createEngine(host, port))
- // ConnectionContext
- /** Used to serve HTTPS traffic. */
- @Deprecated @deprecated("use httpsServer, httpsClient or the method that takes a custom factory",
- since = "Akka HTTP 10.2.0")
- def https(sslContext: SSLContext): HttpsConnectionContext = // ...
- // #https-context-creation
- scaladsl.ConnectionContext.https(sslContext)
-
- /** Used to serve HTTPS traffic. */
- @nowarn("msg=deprecated")
- @Deprecated @deprecated("use httpsServer, httpsClient or the method that takes a custom factory",
- since = "Akka HTTP 10.2.0")
- def https(
- sslContext: SSLContext,
- sslConfig: Optional[PekkoSSLConfig],
- enabledCipherSuites: Optional[JCollection[String]],
- enabledProtocols: Optional[JCollection[String]],
- clientAuth: Optional[TLSClientAuth],
- sslParameters: Optional[SSLParameters]) = // ...
- // #https-context-creation
- scaladsl.ConnectionContext.https(
- sslContext,
- sslConfig.toScala,
- enabledCipherSuites.toScala.map(Util.convertIterable[String, String](_)),
- enabledProtocols.toScala.map(Util.convertIterable[String, String](_)),
- clientAuth.toScala,
- sslParameters.toScala)
-
- /** Used to serve HTTPS traffic. */
- @Deprecated @deprecated("use httpsServer, httpsClient or the method that takes a custom factory",
- since = "Akka HTTP 10.2.0")
- def https(
- sslContext: SSLContext,
- enabledCipherSuites: Optional[JCollection[String]],
- enabledProtocols: Optional[JCollection[String]],
- clientAuth: Optional[TLSClientAuth],
- sslParameters: Optional[SSLParameters]) =
- scaladsl.ConnectionContext.https(
- sslContext,
- None,
- enabledCipherSuites.toScala.map(Util.convertIterable[String, String](_)),
- enabledProtocols.toScala.map(Util.convertIterable[String, String](_)),
- clientAuth.toScala,
- sslParameters.toScala)
-
/** Used to serve HTTP traffic. */
def noEncryption(): HttpConnectionContext =
scaladsl.ConnectionContext.noEncryption()
@@ -113,39 +61,14 @@ object ConnectionContext {
@DoNotInherit
abstract class ConnectionContext {
def isSecure: Boolean
- @Deprecated
- @deprecated("Not always available", since = "Akka HTTP 10.2.0")
- def sslConfig: Option[PekkoSSLConfig]
}
@DoNotInherit
abstract class HttpConnectionContext extends pekko.http.javadsl.ConnectionContext {
override final def isSecure = false
- @nowarn("msg=deprecated")
- override def sslConfig: Option[PekkoSSLConfig] = None
}
@DoNotInherit
abstract class HttpsConnectionContext extends pekko.http.javadsl.ConnectionContext {
override final def isSecure = true
-
- /** Java API */
- @Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- def getEnabledCipherSuites: Optional[JCollection[String]]
-
- /** Java API */
- @Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- def getEnabledProtocols: Optional[JCollection[String]]
-
- /** Java API */
- @Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- def getClientAuth: Optional[TLSClientAuth]
-
- /** Java API */
- @Deprecated @deprecated("here for binary compatibility, not always available", since = "Akka HTTP 10.2.0")
- def getSslContext: SSLContext
-
- /** Java API */
- @Deprecated @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- def getSslParameters: Optional[SSLParameters]
}
diff --git a/http-core/src/main/scala/org/apache/pekko/http/javadsl/Http.scala b/http-core/src/main/scala/org/apache/pekko/http/javadsl/Http.scala
index 1f50e0178..ffe8d5907 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/javadsl/Http.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/javadsl/Http.scala
@@ -19,7 +19,7 @@ import java.util.concurrent.CompletionStage
import scala.concurrent.Future
import scala.util.Try
-import com.typesafe.sslconfig.pekko.PekkoSSLConfig
+
import org.apache.pekko
import pekko.{ stream, NotUsed }
import pekko.actor.{ ActorSystem, ClassicActorSystemProvider, ExtendedActorSystem, ExtensionId, ExtensionIdProvider }
@@ -52,8 +52,6 @@ class Http(system: ExtendedActorSystem) extends pekko.actor.Extension {
import language.implicitConversions
private implicit def completionStageCovariant[T, U >: T](in: CompletionStage[T]): CompletionStage[U] =
in.asInstanceOf[CompletionStage[U]]
- private implicit def javaModelIsScalaModel[J <: AnyRef, S <: J](in: Future[J])(
- implicit ev: JavaMapping.Inherited[J, S]): Future[S] = ev.downcast(in)
private lazy val delegate = pekko.http.scaladsl.Http(system)
@@ -240,110 +238,6 @@ class Http(system: ExtendedActorSystem) extends pekko.actor.Extension {
.map(new ServerBinding(_))(ec).asJava
}
- /**
- * Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
- * function for processing all incoming connections.
- *
- * The number of concurrently accepted connections can be configured by overriding
- * the `pekko.http.server.max-connections` setting. Please see the documentation in the reference.conf for more
- * information about what kind of guarantees to expect.
- *
- * The server will be bound using HTTPS if the [[ConnectHttp]] object is configured with an [[HttpsConnectionContext]],
- * or the [[defaultServerHttpContext]] has been configured to be an [[HttpsConnectionContext]].
- *
- * @deprecated since Akka HTTP 10.2.0: Use Http.get(system).newServerAt(interface, port).bindSync(handler) instead
- */
- @Deprecated
- @deprecated("Use newServerAt instead", since = "Akka HTTP 10.2.0")
- def bindAndHandleSync(
- handler: pekko.japi.Function[HttpRequest, HttpResponse],
- connect: ConnectHttp,
- materializer: Materializer): CompletionStage[ServerBinding] = {
- val connectionContext = connect.effectiveConnectionContext(defaultServerHttpContext).asScala
- delegate.bindAndHandleSync(handler.apply(_).asScala, connect.host, connect.port, connectionContext)(materializer)
- .map(new ServerBinding(_))(ec).asJava
- }
-
- /**
- * Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
- * function for processing all incoming connections.
- *
- * The number of concurrently accepted connections can be configured by overriding
- * the `pekko.http.server.max-connections` setting. Please see the documentation in the reference.conf for more
- * information about what kind of guarantees to expect.
- *
- * The server will be bound using HTTPS if the [[ConnectHttp]] object is configured with an [[HttpsConnectionContext]],
- * or the [[defaultServerHttpContext]] has been configured to be an [[HttpsConnectionContext]].
- *
- * @deprecated since Akka HTTP 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bindSync(handler) instead
- */
- @Deprecated
- @deprecated("Use newServerAt instead", since = "Akka HTTP 10.2.0")
- def bindAndHandleSync(
- handler: pekko.japi.Function[HttpRequest, HttpResponse],
- connect: ConnectHttp,
- settings: ServerSettings,
- log: LoggingAdapter,
- materializer: Materializer): CompletionStage[ServerBinding] = {
- val connectionContext = connect.effectiveConnectionContext(defaultServerHttpContext).asScala
- delegate.bindAndHandleSync(
- handler.apply(_).asScala,
- connect.host, connect.port, connectionContext, settings.asScala, log)(materializer)
- .map(new ServerBinding(_))(ec).asJava
- }
-
- /**
- * Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
- * function for processing all incoming connections.
- *
- * The number of concurrently accepted connections can be configured by overriding
- * the `pekko.http.server.max-connections` setting. Please see the documentation in the reference.conf for more
- * information about what kind of guarantees to expect.
- *
- * The server will be bound using HTTPS if the [[ConnectHttp]] object is configured with an [[HttpsConnectionContext]],
- * or the [[defaultServerHttpContext]] has been configured to be an [[HttpsConnectionContext]].
- *
- * @deprecated since Akka HTTP 10.2.0: Use Http.get(system).newServerAt(interface, port).bind(handler) instead
- */
- @Deprecated
- @deprecated("Use newServerAt instead", since = "Akka HTTP 10.2.0")
- def bindAndHandleAsync(
- handler: pekko.japi.Function[HttpRequest, CompletionStage[HttpResponse]],
- connect: ConnectHttp,
- materializer: Materializer): CompletionStage[ServerBinding] = {
- val connectionContext = connect.effectiveConnectionContext(defaultServerHttpContext).asScala
- delegate.bindAndHandleAsync(handler.apply(_).asScala, connect.host, connect.port, connectionContext)(materializer)
- .map(new ServerBinding(_))(ec).asJava
- }
-
- /**
- * Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
- * function for processing all incoming connections.
- *
- * The number of concurrently accepted connections can be configured by overriding
- * the `pekko.http.server.max-connections` setting. Please see the documentation in the reference.conf for more
- * information about what kind of guarantees to expect.
- *
- * The server will be bound using HTTPS if the [[ConnectHttp]] object is configured with an [[HttpsConnectionContext]],
- * or the [[defaultServerHttpContext]] has been configured to be an [[HttpsConnectionContext]].
- *
- * @deprecated since Akka HTTP 10.2.0: Use Http.get(system).newServerAt(interface, port).withSettings(settings).logTo(log).bind(handler) instead
- */
- @Deprecated
- @deprecated("Use newServerAt instead", since = "Akka HTTP 10.2.0")
- def bindAndHandleAsync(
- handler: pekko.japi.Function[HttpRequest, CompletionStage[HttpResponse]],
- connect: ConnectHttp,
- settings: ServerSettings,
- parallelism: Int, log: LoggingAdapter,
- materializer: Materializer): CompletionStage[ServerBinding] = {
- val connectionContext = connect.effectiveConnectionContext(defaultServerHttpContext).asScala
- delegate.bindAndHandleAsync(
- handler.apply(_).asScala,
- connect.host, connect.port, connectionContext, settings.asScala, parallelism, log)(materializer)
- .map(new ServerBinding(_))(ec).asJava
- }
-
/**
* Constructs a client layer stage using the configured default [[pekko.http.javadsl.settings.ClientConnectionSettings]].
*/
@@ -828,18 +722,6 @@ class Http(system: ExtendedActorSystem) extends pekko.actor.Extension {
def setDefaultClientHttpsContext(context: HttpsConnectionContext): Unit =
delegate.setDefaultClientHttpsContext(context.asScala)
- @deprecated("use ConnectionContext.httpsServer", since = "Akka HTTP 10.2.0")
- def createServerHttpsContext(sslConfig: PekkoSSLConfig): HttpsConnectionContext =
- delegate.createServerHttpsContext(sslConfig)
-
- @deprecated("use ConnectionContext.httpsClient", since = "Akka HTTP 10.2.0")
- def createClientHttpsContext(sslConfig: PekkoSSLConfig): HttpsConnectionContext =
- delegate.createClientHttpsContext(sslConfig)
-
- @deprecated("use ConnectionContext.httpsClient", since = "Akka HTTP 10.2.0")
- def createDefaultClientHttpsContext(): HttpsConnectionContext =
- delegate.createDefaultClientHttpsContext()
-
private def adaptTupleFlow[T, Mat](
scalaFlow: stream.scaladsl.Flow[(scaladsl.model.HttpRequest, T), (Try[scaladsl.model.HttpResponse], T), Mat])
: Flow[Pair[HttpRequest, T], Pair[Try[HttpResponse], T], Mat] = {
diff --git a/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala b/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
index d5bbdf98b..8c8be7c46 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/javadsl/settings/ServerSettings.scala
@@ -13,8 +13,7 @@
package org.apache.pekko.http.javadsl.settings
-import java.util.function.Supplier
-import java.util.{ Optional, Random }
+import java.util.Optional
import org.apache.pekko
import pekko.actor.ActorSystem
@@ -54,9 +53,6 @@ import scala.concurrent.duration.{ Duration, FiniteDuration }
def getBacklog: Int
def getSocketOptions: java.lang.Iterable[SocketOption]
def getDefaultHostHeader: Host
- @Deprecated @deprecated("Kept for binary compatibility; Use websocketSettings.getRandomFactory instead",
- since = "Akka HTTP 10.2.0")
- def getWebsocketRandomFactory: java.util.function.Supplier[Random]
def getWebsocketSettings: WebSocketSettings
def getParserSettings: ParserSettings
def getLogUnencryptedNetworkBytes: Optional[Int]
@@ -87,12 +83,6 @@ import scala.concurrent.duration.{ Duration, FiniteDuration }
self.copy(socketOptions = newValue.asScala.toList)
def withDefaultHostHeader(newValue: Host): ServerSettings = self.copy(defaultHostHeader = newValue.asScala)
def withParserSettings(newValue: ParserSettings): ServerSettings = self.copy(parserSettings = newValue.asScala)
- @Deprecated @deprecated("Kept for binary compatibility; Use websocketSettings.withRandomFactoryFactory instead",
- since = "Akka HTTP 10.2.0")
- def withWebsocketRandomFactory(newValue: java.util.function.Supplier[Random]): ServerSettings =
- self.copy(websocketSettings = websocketSettings.withRandomFactoryFactory(new Supplier[Random] {
- override def get(): Random = newValue.get()
- }))
def withWebsocketSettings(newValue: WebSocketSettings): ServerSettings =
self.copy(websocketSettings = newValue.asScala)
def withLogUnencryptedNetworkBytes(newValue: Optional[Int]): ServerSettings =
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ConnectionContext.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ConnectionContext.scala
index 68ef7af7d..be9b98d98 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ConnectionContext.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/ConnectionContext.scala
@@ -13,19 +13,10 @@
package org.apache.pekko.http.scaladsl
-import java.util.{ Collection => JCollection, Optional }
+import javax.net.ssl._
import org.apache.pekko
import pekko.annotation.{ ApiMayChange, InternalApi }
-import pekko.stream.TLSClientAuth
-import pekko.stream.TLSProtocol._
-import pekko.util.OptionConverters._
-import scala.annotation.nowarn
-import com.typesafe.sslconfig.pekko.PekkoSSLConfig
-import javax.net.ssl._
-
-import scala.collection.JavaConverters._
-import scala.collection.immutable
trait ConnectionContext extends pekko.http.javadsl.ConnectionContext {
@deprecated("Internal method, left for binary compatibility", since = "Akka HTTP 10.2.0")
@@ -50,11 +41,11 @@ object ConnectionContext {
*/
@ApiMayChange
def httpsServer(createSSLEngine: () => SSLEngine): HttpsConnectionContext =
- new HttpsConnectionContext(Right({
+ new HttpsConnectionContext({
case None => createSSLEngine()
case Some(_) =>
throw new IllegalArgumentException("host and port supplied for connection based on server connection context")
- }: Option[(String, Int)] => SSLEngine))
+ }: Option[(String, Int)] => SSLEngine)
// #https-client-context-creation
/**
@@ -83,88 +74,25 @@ object ConnectionContext {
*/
@ApiMayChange
def httpsClient(createSSLEngine: (String, Int) => SSLEngine): HttpsConnectionContext = // ...
- new HttpsConnectionContext(Right({
+ new HttpsConnectionContext({
case None =>
throw new IllegalArgumentException("host and port missing for connection based on client connection context")
case Some((host, port)) => createSSLEngine(host, port)
- }: Option[(String, Int)] => SSLEngine))
-
- @deprecated("use httpsClient, httpsServer, or the lower-level SSLEngine-based constructor", "Akka HTTP 10.2.0")
- def https(
- sslContext: SSLContext,
- sslConfig: Option[PekkoSSLConfig] = None,
- enabledCipherSuites: Option[immutable.Seq[String]] = None,
- enabledProtocols: Option[immutable.Seq[String]] = None,
- clientAuth: Option[TLSClientAuth] = None,
- sslParameters: Option[SSLParameters] = None) =
- new HttpsConnectionContext(Left(DeprecatedSslContextParameters(sslContext, sslConfig, enabledCipherSuites,
- enabledProtocols, clientAuth, sslParameters)))
+ }: Option[(String, Int)] => SSLEngine)
def noEncryption() = HttpConnectionContext
}
-@deprecated("here to be able to keep supporting the old API", since = "Akka HTTP 10.2.0")
-private[http] case class DeprecatedSslContextParameters(
- sslContext: SSLContext,
- sslConfig: Option[PekkoSSLConfig],
- enabledCipherSuites: Option[immutable.Seq[String]],
- enabledProtocols: Option[immutable.Seq[String]],
- clientAuth: Option[TLSClientAuth],
- sslParameters: Option[SSLParameters]) {
- def firstSession: NegotiateNewSession =
- NegotiateNewSession(enabledCipherSuites, enabledProtocols, clientAuth, sslParameters)
-}
-
/**
* Context with all information needed to set up a HTTPS connection
*
* This constructor is INTERNAL API, use ConnectionContext.https instead
*/
@InternalApi
-@nowarn("msg=since Akka HTTP 10.2.0")
final class HttpsConnectionContext private[http] (
- private[http] val sslContextData: Either[DeprecatedSslContextParameters, Option[(String, Int)] => SSLEngine])
+ private[http] val engineCreator: Option[(String, Int)] => SSLEngine)
extends pekko.http.javadsl.HttpsConnectionContext with ConnectionContext {
protected[http] override final def defaultPort: Int = 443
-
- @deprecated("prefer ConnectionContext.httpsClient or ConnectionContext.httpsServer", "Akka HTTP 10.2.0")
- def this(
- sslContext: SSLContext,
- sslConfig: Option[PekkoSSLConfig] = None,
- enabledCipherSuites: Option[immutable.Seq[String]] = None,
- enabledProtocols: Option[immutable.Seq[String]] = None,
- clientAuth: Option[TLSClientAuth] = None,
- sslParameters: Option[SSLParameters] = None) = this(Left(DeprecatedSslContextParameters(sslContext, sslConfig,
- enabledCipherSuites, enabledProtocols, clientAuth, sslParameters)))
-
- @deprecated("not always available", "Akka HTTP 10.2.0") def sslContext: SSLContext =
- sslContextData.left.get.sslContext
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0") def sslConfig: Option[PekkoSSLConfig] =
- sslContextData.left.get.sslConfig
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0") def enabledCipherSuites
- : Option[immutable.Seq[String]] = sslContextData.left.get.enabledCipherSuites
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0") def enabledProtocols
- : Option[immutable.Seq[String]] =
- sslContextData.left.get.enabledProtocols
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0") def clientAuth: Option[TLSClientAuth] =
- sslContextData.left.get.clientAuth
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0") def sslParameters: Option[SSLParameters] =
- sslContextData.left.get.sslParameters
-
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- private[http] def firstSession = NegotiateNewSession(enabledCipherSuites, enabledProtocols, clientAuth, sslParameters)
-
- @deprecated("not always available", "Akka HTTP 10.2.0")
- override def getSslContext = sslContext
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- override def getEnabledCipherSuites: Optional[JCollection[String]] =
- enabledCipherSuites.map(_.asJavaCollection).toJava
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- override def getEnabledProtocols: Optional[JCollection[String]] = enabledProtocols.map(_.asJavaCollection).toJava
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- override def getClientAuth: Optional[TLSClientAuth] = clientAuth.toJava
- @deprecated("here for binary compatibility", since = "Akka HTTP 10.2.0")
- override def getSslParameters: Optional[SSLParameters] = sslParameters.toJava
}
sealed class HttpConnectionContext extends pekko.http.javadsl.HttpConnectionContext with ConnectionContext {
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/Http.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/Http.scala
index 753f6780a..853f7a1da 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/Http.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/Http.scala
@@ -16,11 +16,13 @@ package org.apache.pekko.http.scaladsl
import java.net.InetSocketAddress
import java.util.concurrent.CompletionStage
import javax.net.ssl._
+
+import com.typesafe.config.Config
import org.apache.pekko
import pekko.actor._
import pekko.annotation.{ DoNotInherit, InternalApi, InternalStableApi }
import pekko.dispatch.ExecutionContexts
-import pekko.event.{ LogSource, Logging, LoggingAdapter }
+import pekko.event.LoggingAdapter
import pekko.http.impl.engine.HttpConnectionIdleTimeoutBidi
import pekko.http.impl.engine.client._
import pekko.http.impl.engine.http2.Http2
@@ -47,27 +49,19 @@ import pekko.util.FutureConverters._
import pekko.util.ManifestInfo
import scala.annotation.nowarn
-import com.typesafe.config.Config
-import com.typesafe.sslconfig.pekko._
-import com.typesafe.sslconfig.pekko.util.PekkoLoggerFactory
-import com.typesafe.sslconfig.ssl.ConfigSSLContextBuilder
-
import scala.concurrent._
+import scala.concurrent.duration._
import scala.util.{ Success, Try }
import scala.util.control.NonFatal
-import scala.concurrent.duration.{ Duration, FiniteDuration }
-import scala.concurrent.duration._
/**
* Pekko extension for HTTP which serves as the main entry point into pekko-http.
*
* Use as `Http().bindAndHandle` etc. with an implicit [[ActorSystem]] in scope.
*/
-@nowarn("msg=DefaultSSLContextCreation in package scaladsl is deprecated")
@DoNotInherit
class HttpExt @InternalStableApi /* constructor signature is hardcoded in Telemetry */ private[http] (
- private val config: Config)(implicit val system: ExtendedActorSystem) extends pekko.actor.Extension
- with DefaultSSLContextCreation {
+ private val config: Config)(implicit val system: ExtendedActorSystem) extends pekko.actor.Extension {
pekko.http.Version.check(system.settings.config)
pekko.PekkoVersion.require("pekko-http", pekko.http.Version.supportedPekkoVersion)
@@ -307,53 +301,14 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
log: LoggingAdapter)(implicit fm: Materializer): Future[ServerBinding] =
bindAndHandle(handler, interface, port, connectionContext, settings, log)(fm)
- /**
- * Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
- * [[pekko.stream.scaladsl.Flow]] for processing all incoming connections.
- *
- * The number of concurrently accepted connections can be configured by overriding
- * the `pekko.http.server.max-connections` setting. Please see the documentation in the reference.conf for more
- * information about what kind of guarantees to expect.
- *
- * To configure additional settings for a server started using this method,
- * use the `pekko.http.server` config section or pass in a [[pekko.http.scaladsl.settings.ServerSettings]] explicitly.
- */
- @deprecated("Use Http().newServerAt(...)...bindSync() to create server bindings.", since = "Akka HTTP 10.2.0")
- def bindAndHandleSync(
- handler: HttpRequest => HttpResponse,
- interface: String, port: Int = DefaultPortForProtocol,
- connectionContext: ConnectionContext = defaultServerHttpContext,
- settings: ServerSettings = ServerSettings(system),
- log: LoggingAdapter = system.log)(implicit fm: Materializer = systemMaterializer): Future[ServerBinding] =
- bindAndHandleAsync(req => FastFuture.successful(handler(req)), interface, port, connectionContext, settings,
- parallelism = 0, log)(fm)
-
- /**
- * Convenience method which starts a new HTTP server at the given endpoint and uses the given `handler`
- * [[pekko.stream.scaladsl.Flow]] for processing all incoming connections.
- *
- * The number of concurrently accepted connections can be configured by overriding
- * the `pekko.http.server.max-connections` setting. Please see the documentation in the reference.conf for more
- * information about what kind of guarantees to expect.
- *
- * To configure additional settings for a server started using this method,
- * use the `pekko.http.server` config section or pass in a [[pekko.http.scaladsl.settings.ServerSettings]] explicitly.
- *
- * Parameter `parallelism` specifies how many requests are attempted to be handled concurrently per connection. In HTTP/1
- * this makes only sense if HTTP pipelining is enabled (which is not recommended). The default value of `0` means that
- * the value is taken from the `pekko.http.server.pipelining-limit` setting from the configuration. In HTTP/2,
- * the default value is taken from `pekko.http.server.http2.max-concurrent-streams`.
- *
- * Any other value for `parallelism` overrides the setting.
- */
- @deprecated("Use Http().newServerAt(...)...bind() to create server bindings.", since = "Akka HTTP 10.2.0")
- def bindAndHandleAsync(
+ private def bindAndHandleAsync(
handler: HttpRequest => Future[HttpResponse],
- interface: String, port: Int = DefaultPortForProtocol,
- connectionContext: ConnectionContext = defaultServerHttpContext,
- settings: ServerSettings = ServerSettings(system),
- parallelism: Int = 0,
- log: LoggingAdapter = system.log)(implicit fm: Materializer = systemMaterializer): Future[ServerBinding] = {
+ interface: String,
+ port: Int,
+ connectionContext: ConnectionContext,
+ settings: ServerSettings,
+ parallelism: Int,
+ log: LoggingAdapter)(implicit fm: Materializer): Future[ServerBinding] = {
if (settings.previewServerSettings.enableHttp2) {
log.debug("Binding server using HTTP/2")
@@ -373,7 +328,6 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
}
// forwarder to allow internal code to call deprecated method without warning
- @nowarn("msg=deprecated")
private[http] def bindAndHandleAsyncImpl(
handler: HttpRequest => Future[HttpResponse],
interface: String, port: Int,
@@ -845,13 +799,7 @@ class HttpExt @InternalStableApi /* constructor signature is hardcoded in Teleme
private def sslTlsStage(connectionContext: ConnectionContext, role: TLSRole, hostInfo: Option[(String, Int)]) =
connectionContext match {
case hctx: HttpsConnectionContext =>
- hctx.sslContextData match {
- case Left(ssl) =>
- TLS(ssl.sslContext, ssl.sslConfig, ssl.firstSession, role, hostInfo = hostInfo,
- closing = TLSClosing.eagerClose)
- case Right(engineCreator) =>
- TLS(() => engineCreator(hostInfo), TLSClosing.eagerClose)
- }
+ TLS(() => hctx.engineCreator(hostInfo), TLSClosing.eagerClose)
case other =>
TLSPlacebo() // if it's not HTTPS, we don't enable SSL/TLS
}
@@ -1152,88 +1100,3 @@ object Http extends ExtensionId[HttpExt] with ExtensionIdProvider {
}
})
}
-
-/**
- * TLS configuration for an HTTPS server binding or client connection.
- * For the sslContext please refer to the com.typeasfe.ssl-config library.
- * The remaining four parameters configure the initial session that will
- * be negotiated, see [[pekko.stream.TLSProtocol.NegotiateNewSession]] for details.
- */
-@deprecated("use ConnectionContext.httpsServer and httpsClient directly", since = "Akka HTTP 10.2.0")
-trait DefaultSSLContextCreation {
-
- protected def system: ActorSystem
- def sslConfig = PekkoSSLConfig(system)
-
- // --- log warnings ---
- private[this] def log = system.log
-
- @deprecated("PekkoSSLConfig usage is deprecated", since = "Akka HTTP 10.2.0")
- def validateAndWarnAboutLooseSettings() = ()
- // --- end of log warnings ---
-
- @deprecated("use ConnectionContext.httpServer instead", since = "Akka HTTP 10.2.0")
- def createDefaultClientHttpsContext(): HttpsConnectionContext =
- createClientHttpsContext(PekkoSSLConfig(system))
-
- @deprecated("use ConnectionContext.httpServer instead", since = "Akka HTTP 10.2.0")
- def createServerHttpsContext(sslConfig: PekkoSSLConfig): HttpsConnectionContext = {
- log.warning("Automatic server-side configuration is not supported yet, will attempt to use client-side settings. " +
- "Instead it is recommended to construct the Servers HttpsConnectionContext manually (via SSLContext).")
- createClientHttpsContext(sslConfig)
- }
-
- @deprecated("use ConnectionContext.httpClient(sslContext) instead", since = "Akka HTTP 10.2.0")
- def createClientHttpsContext(sslConfig: PekkoSSLConfig): HttpsConnectionContext = {
- val config = sslConfig.config
-
- val log = Logging(system, getClass)(LogSource.fromClass)
- val mkLogger = new PekkoLoggerFactory(system)
-
- // initial ssl context!
- val sslContext = if (sslConfig.config.default) {
- log.debug("buildSSLContext: ssl-config.default is true, using default SSLContext")
- sslConfig.validateDefaultTrustManager(config)
- SSLContext.getDefault
- } else {
- // break out the static methods as much as we can...
- val keyManagerFactory = sslConfig.buildKeyManagerFactory(config)
- val trustManagerFactory = sslConfig.buildTrustManagerFactory(config)
- new ConfigSSLContextBuilder(mkLogger, config, keyManagerFactory, trustManagerFactory).build()
- }
-
- // protocols!
- val defaultParams = sslContext.getDefaultSSLParameters
- val defaultProtocols = defaultParams.getProtocols
- val protocols = sslConfig.configureProtocols(defaultProtocols, config)
- defaultParams.setProtocols(protocols)
-
- // ciphers!
- val defaultCiphers = defaultParams.getCipherSuites
- val cipherSuites = sslConfig.configureCipherSuites(defaultCiphers, config)
- defaultParams.setCipherSuites(cipherSuites)
-
- // auth!
- import com.typesafe.sslconfig.ssl.{ ClientAuth => SslClientAuth }
- val clientAuth = config.sslParametersConfig.clientAuth match {
- case SslClientAuth.Default => None
- case SslClientAuth.Want => Some(TLSClientAuth.Want)
- case SslClientAuth.Need => Some(TLSClientAuth.Need)
- case SslClientAuth.None => Some(TLSClientAuth.None)
- }
-
- // hostname!
- if (!sslConfig.config.loose.disableHostnameVerification) {
- defaultParams.setEndpointIdentificationAlgorithm("https")
- }
-
- new HttpsConnectionContext(
- sslContext,
- Some(sslConfig),
- Some(cipherSuites.toList),
- Some(defaultProtocols.toList),
- clientAuth,
- Some(defaultParams))
- }
-
-}
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/FormData.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/FormData.scala
index 14b68236a..e79564631 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/FormData.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/FormData.scala
@@ -25,12 +25,6 @@ final case class FormData(fields: Uri.Query) {
def toEntity: pekko.http.scaladsl.model.RequestEntity =
toEntityWithCharset(`application/x-www-form-urlencoded`.charset)
- @deprecated(
- "FormData always uses charset UTF-8 without appending the charset to 'Content-Type: application/x-www-form-urlencoded', use toEntity instead.",
- "Akka HTTP 10.1.7")
- def toEntity(charset: HttpCharset): pekko.http.scaladsl.model.RequestEntity =
- toEntityWithCharset(charset)
-
private def toEntityWithCharset(charset: HttpCharset): pekko.http.scaladsl.model.RequestEntity = {
val render: StringRendering =
UriRendering.renderQuery(new StringRendering, this.fields, charset.nioCharset, CharacterClasses.unreserved)
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala
index c3f65c042..f1deb0671 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpEntity.scala
@@ -628,20 +628,6 @@ object HttpEntity {
}
object LastChunk extends LastChunk("", Nil)
- /**
- * Deprecated: no-op, not explicitly needed any more.
- */
- @deprecated("Not needed explicitly any more. ", "Akka HTTP 10.1.5")
- def limitableByteSource[Mat](source: Source[ByteString, Mat]): Source[ByteString, Mat] =
- source
-
- /**
- * Deprecated: no-op, not explicitly needed any more.
- */
- @deprecated("Not needed explicitly any more. ", "Akka HTTP 10.1.5")
- def limitableChunkSource[Mat](source: Source[ChunkStreamPart, Mat]): Source[ChunkStreamPart, Mat] =
- source
-
private final case class SizeLimit(maxBytes: Long, contentLength: Option[Long] = None) extends Attributes.Attribute {
def isDisabled = maxBytes < 0
}
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMessage.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMessage.scala
index 996196526..43b307b3e 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMessage.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/HttpMessage.scala
@@ -348,11 +348,6 @@ final class HttpRequest(
override def isRequest = true
override def isResponse = false
- @deprecated("use the constructor that includes an attributes parameter instead", "Akka HTTP 10.2.0")
- private[model] def this(method: HttpMethod, uri: Uri, headers: immutable.Seq[HttpHeader], entity: RequestEntity,
- protocol: HttpProtocol) =
- this(method, uri, headers, Map.empty, entity, protocol)
-
/**
* Resolve this request's URI according to the logic defined at
* http://tools.ietf.org/html/rfc7230#section-5.5
@@ -413,14 +408,6 @@ final class HttpRequest(
/* Manual Case Class things, to easen bin-compat */
- @deprecated("Use the `withXYZ` methods instead. Kept for binary compatibility", "Akka HTTP 10.2.0")
- def copy(
- method: HttpMethod = method,
- uri: Uri = uri,
- headers: immutable.Seq[HttpHeader] = headers,
- entity: RequestEntity = entity,
- protocol: HttpProtocol = protocol) = copyImpl(method, uri, headers, entity = entity, protocol = protocol)
-
private def copyImpl(
method: HttpMethod = method,
uri: Uri = uri,
@@ -560,11 +547,6 @@ final class HttpResponse(
override def isRequest = false
override def isResponse = true
- @deprecated("use the constructor that includes an attributes parameter instead", "Akka HTTP 10.2.0")
- private[model] def this(status: StatusCode, headers: immutable.Seq[HttpHeader], entity: ResponseEntity,
- protocol: HttpProtocol) =
- this(status, headers, Map.empty, entity, protocol)
-
override def withHeaders(headers: immutable.Seq[HttpHeader]): HttpResponse =
if (headers eq this.headers) this else copyImpl(headers = headers)
@@ -592,14 +574,6 @@ final class HttpResponse(
def transformEntityDataBytes[T](transformer: Graph[FlowShape[ByteString, ByteString], T]): HttpResponse =
copyImpl(entity = entity.transformDataBytes(Flow.fromGraph(transformer)))
- /* Manual Case Class things, to ease bin-compat */
- @deprecated("Use the `withXYZ` methods instead", "Akka HTTP 10.2.0")
- def copy(
- status: StatusCode = status,
- headers: immutable.Seq[HttpHeader] = headers,
- entity: ResponseEntity = entity,
- protocol: HttpProtocol = protocol) = copyImpl(status, headers, entity = entity, protocol = protocol)
-
private def copyImpl(
status: StatusCode = status,
headers: immutable.Seq[HttpHeader] = headers,
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/HttpCookie.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/HttpCookie.scala
index 8558ce3d1..539a937c5 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/HttpCookie.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/headers/HttpCookie.scala
@@ -13,16 +13,16 @@
package org.apache.pekko.http.scaladsl.model.headers
-import org.apache.pekko
-import pekko.http.impl.model.parser.CharacterClasses
-import org.parboiled2.CharPredicate
import java.util.{ Optional, OptionalLong }
-import pekko.http.scaladsl.model.DateTime
+import org.apache.pekko
+import pekko.http.impl.model.parser.CharacterClasses
import pekko.http.impl.util._
-import pekko.http.javadsl.{ model => jm }
import pekko.http.impl.util.JavaMapping.Implicits._
+import pekko.http.javadsl.{ model => jm }
+import pekko.http.scaladsl.model.DateTime
import pekko.util.OptionConverters._
+import org.parboiled2.CharPredicate
/**
* for a full definition of the http cookie header fields, see
@@ -80,32 +80,6 @@ final class HttpCookie private[http] (
val sameSite: Option[SameSite]) extends jm.headers.HttpCookie with ToStringRenderable with Product with Serializable
with Equals {
- @deprecated("Please use HttpCookie(name, value).withXxx()", "Akka HTTP 10.2.0")
- def this(
- name: String,
- value: String,
- expires: Option[DateTime] = None,
- maxAge: Option[Long] = None,
- domain: Option[String] = None,
- path: Option[String] = None,
- secure: Boolean = false,
- httpOnly: Boolean = false,
- extension: Option[String] = None) =
- this(name, value, expires, maxAge, domain, path, secure, httpOnly, extension, None)
-
- @deprecated("for binary compatibility", since = "Akka HTTP 10.2.0")
- private[headers] def copy(
- name: String,
- value: String,
- expires: Option[DateTime],
- maxAge: Option[Long],
- domain: Option[String],
- path: Option[String],
- secure: Boolean,
- httpOnly: Boolean,
- extension: Option[String]): HttpCookie = copy(name = name, value = value, expires = expires, maxAge = maxAge,
- domain = domain, path = path, secure = secure, httpOnly = httpOnly, extension = extension, sameSite = sameSite)
-
private[headers] def copy(
name: String = this.name,
value: String = this.value,
@@ -242,32 +216,6 @@ object HttpCookie {
extension: Option[String] = None) =
new HttpCookie(name, value, expires, maxAge, domain, path, secure, httpOnly, extension, None)
- @deprecated(
- "Pattern matching on HttpCookie is deprecated because of the big number of fields and potential future compatibility hazards. Please use other means to check the fields.",
- since = "Akka HTTP 10.2.0")
- def unapply(cookie: HttpCookie) = Option((
- cookie.name,
- cookie.value,
- cookie.expires,
- cookie.maxAge,
- cookie.domain,
- cookie.path,
- cookie.secure,
- cookie.httpOnly,
- cookie.extension))
-
- @deprecated("Use HttpCookiePair.toCookie and withXxx methods instead", "Akka HTTP 10.2.0")
- def fromPair(
- pair: HttpCookiePair,
- expires: Option[DateTime] = None,
- maxAge: Option[Long] = None,
- domain: Option[String] = None,
- path: Option[String] = None,
- secure: Boolean = false,
- httpOnly: Boolean = false,
- extension: Option[String] = None): HttpCookie =
- new HttpCookie(pair.name, pair.value, expires, maxAge, domain, path, secure, httpOnly, extension, None)
-
import pekko.http.impl.model.parser.CharacterClasses._
private[http] def nameChars = tchar
diff --git a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
index 8361d4b8a..0b533ec64 100644
--- a/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
+++ b/http-core/src/main/scala/org/apache/pekko/http/scaladsl/settings/ServerSettings.scala
@@ -13,9 +13,6 @@
package org.apache.pekko.http.scaladsl.settings
-import java.util.Random
-import java.util.function.Supplier
-
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.annotation.{ DoNotInherit, InternalApi }
@@ -56,9 +53,6 @@ abstract class ServerSettings private[pekko] () extends pekko.http.javadsl.setti
def backlog: Int
def socketOptions: immutable.Seq[SocketOption]
def defaultHostHeader: Host
- @Deprecated @deprecated("Kept for binary compatibility; Use websocketSettings.randomFactory instead",
- since = "Akka HTTP 10.1.1")
- def websocketRandomFactory: () => Random
def websocketSettings: WebSocketSettings
def parserSettings: ParserSettings
def logUnencryptedNetworkBytes: Option[Int]
@@ -87,11 +81,6 @@ abstract class ServerSettings private[pekko] () extends pekko.http.javadsl.setti
override def getRemoteAddressHeader = this.remoteAddressHeader
override def getRemoteAddressAttribute: Boolean = this.remoteAddressAttribute
override def getLogUnencryptedNetworkBytes = this.logUnencryptedNetworkBytes.toJava
- @Deprecated @deprecated("Kept for binary compatibility; Use websocketSettings.getRandomFactory instead",
- since = "Akka HTTP 10.2.0")
- override def getWebsocketRandomFactory = new Supplier[Random] {
- override def get(): Random = self.websocketRandomFactory()
- }
override def getDefaultHttpPort: Int = this.defaultHttpPort
override def getDefaultHttpsPort: Int = this.defaultHttpsPort
override def getTerminationDeadlineExceededResponse: pekko.http.javadsl.model.HttpResponse =
@@ -116,12 +105,6 @@ abstract class ServerSettings private[pekko] () extends pekko.http.javadsl.setti
override def withBacklog(newValue: Int): ServerSettings = self.copy(backlog = newValue)
override def withSocketOptions(newValue: java.lang.Iterable[SocketOption]): ServerSettings =
self.copy(socketOptions = newValue.asScala.toList)
- @Deprecated @deprecated("Kept for binary compatibility; Use websocketSettings.withRandomFactoryFactory instead",
- since = "Akka HTTP 10.2.0")
- override def withWebsocketRandomFactory(newValue: java.util.function.Supplier[Random]): ServerSettings =
- self.copy(websocketSettings = this.websocketSettings.withRandomFactoryFactory(new Supplier[Random] {
- override def get(): Random = newValue.get()
- }))
override def getWebsocketSettings: WebSocketSettings = self.websocketSettings
override def withDefaultHttpPort(newValue: Int): ServerSettings = self.copy(defaultHttpPort = newValue)
override def withDefaultHttpsPort(newValue: Int): ServerSettings = self.copy(defaultHttpsPort = newValue)
@@ -139,12 +122,6 @@ abstract class ServerSettings private[pekko] () extends pekko.http.javadsl.setti
self.copy(logUnencryptedNetworkBytes = newValue)
def withDefaultHostHeader(newValue: Host): ServerSettings = self.copy(defaultHostHeader = newValue)
def withParserSettings(newValue: ParserSettings): ServerSettings = self.copy(parserSettings = newValue)
- @Deprecated @deprecated("Kept for binary compatibility; Use websocketSettings.withRandomFactoryFactory instead",
- since = "Akka HTTP 10.2.0")
- def withWebsocketRandomFactory(newValue: () => Random): ServerSettings =
- self.copy(websocketSettings = this.websocketSettings.withRandomFactoryFactory(new Supplier[Random] {
- override def get(): Random = newValue()
- }))
def withWebsocketSettings(newValue: WebSocketSettings): ServerSettings = self.copy(websocketSettings = newValue)
def withSocketOptions(newValue: immutable.Seq[SocketOption]): ServerSettings = self.copy(socketOptions = newValue)
def withHttp2Settings(newValue: Http2ServerSettings): ServerSettings = copy(http2Settings = newValue)
diff --git a/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectHttpSpec.scala b/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectHttpSpec.scala
index ff7cfb5dd..407473d71 100644
--- a/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectHttpSpec.scala
+++ b/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectHttpSpec.scala
@@ -13,6 +13,8 @@
package org.apache.pekko.http.javadsl
+import javax.net.ssl.SSLContext
+
import org.apache.pekko.http.javadsl.model._
import org.scalatest.BeforeAndAfterAll
import org.scalatest.matchers.should.Matchers
@@ -21,7 +23,7 @@ import org.scalatest.wordspec.AnyWordSpec
class ConnectHttpSpec extends AnyWordSpec with Matchers with BeforeAndAfterAll {
val httpContext = ConnectionContext.noEncryption()
- val httpsContext = ConnectionContext.https(null)
+ val httpsContext = ConnectionContext.httpsClient(SSLContext.getDefault)
val successResponse = HttpResponse.create().withStatus(200)
diff --git a/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectionContextSpec.scala b/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectionContextSpec.scala
deleted file mode 100644
index a409f3349..000000000
--- a/http-core/src/test/scala/org/apache/pekko/http/javadsl/ConnectionContextSpec.scala
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * license agreements; and to You under the Apache License, version 2.0:
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * This file is part of the Apache Pekko project, which was derived from Akka.
- */
-
-/*
- * Copyright (C) 2009-2022 Lightbend Inc. <https://www.lightbend.com>
- */
-
-package org.apache.pekko.http.javadsl
-
-import java.util.{ Collections, Optional }
-import javax.net.ssl.SSLContext
-
-import org.apache.pekko.stream.TLSClientAuth
-import org.scalatest.matchers.should.Matchers
-import org.scalatest.wordspec.AnyWordSpec
-
-class ConnectionContextSpec extends AnyWordSpec with Matchers {
-
- "ConnectionContext.https" should {
-
- "pass through all parameters" in {
- val sslContext = SSLContext.getDefault
- val ciphers: Optional[java.util.Collection[String]] = Optional.of(Collections.singletonList("A"))
- val protocols: Optional[java.util.Collection[String]] = Optional.of(Collections.singletonList("B"))
- val clientAuth = Optional.of(TLSClientAuth.need)
- val parameters = Optional.of(sslContext.getDefaultSSLParameters)
-
- val httpsContext =
- org.apache.pekko.http.javadsl.ConnectionContext.https(sslContext, ciphers, protocols, clientAuth, parameters)
- httpsContext.getSslContext should ===(sslContext)
- httpsContext.getEnabledCipherSuites.get.toArray.toList shouldBe (ciphers.get.toArray.toList)
- httpsContext.getEnabledProtocols.get.toArray.toList shouldBe (protocols.get.toArray.toList)
- httpsContext.getClientAuth should ===(clientAuth)
- httpsContext.getSslParameters should ===(parameters)
- }
- }
-}
diff --git a/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala b/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
index 66fccacf5..b4a4cff6c 100644
--- a/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
+++ b/http-core/src/test/scala/org/apache/pekko/http/scaladsl/ClientServerSpec.scala
@@ -18,13 +18,13 @@ import java.net.{ BindException, Socket }
import java.security.{ KeyStore, SecureRandom }
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicLong
-import scala.annotation.tailrec
+import javax.net.ssl.{ SNIMatcher, SNIServerName, SSLContext, SSLEngine, TrustManagerFactory }
+
+import scala.annotation.{ nowarn, tailrec }
import scala.concurrent.duration._
import scala.concurrent.{ Await, Future, Promise }
import scala.util.{ Success, Try }
-import com.typesafe.sslconfig.pekko.PekkoSSLConfig
-import com.typesafe.sslconfig.ssl.SSLConfigSettings
-import com.typesafe.sslconfig.ssl.SSLLooseConfig
+
import org.apache.pekko
import pekko.actor.ActorSystem
import pekko.event.Logging
@@ -46,10 +46,8 @@ import pekko.stream.testkit._
import pekko.stream._
import pekko.testkit._
import pekko.util.ByteString
-import scala.annotation.nowarn
import com.typesafe.config.{ Config, ConfigFactory }
-import javax.net.ssl.{ SSLContext, TrustManagerFactory }
import org.scalatest.concurrent.ScalaFutures
import org.scalatest.concurrent.Eventually.eventually
@@ -745,9 +743,6 @@ Host: example.com
Http().newServerAt("localhost", 0).enableHttps(serverConnectionContext).bindFlow(handlerFlow)
.futureValue
- // Disable hostname verification as ExampleHttpContexts.exampleClientContext sets hostname as pekko.example.org
- val sslConfigSettings = SSLConfigSettings().withLoose(SSLLooseConfig().withDisableHostnameVerification(true))
- val sslConfig = PekkoSSLConfig.apply().withSettings(sslConfigSettings)
val sslContext = {
val certStore = KeyStore.getInstance(KeyStore.getDefaultType)
certStore.load(null, null)
@@ -762,9 +757,27 @@ Host: example.com
context
}
- // This approach is deprecated, but we still want to check it works
- @nowarn("msg=deprecated")
- val clientConnectionContext = ConnectionContext.https(sslContext, Some(sslConfig))
+ // Disable hostname verification as ExampleHttpContexts.exampleClientContext sets hostname as pekko.example.org
+ val createInsecureSslEngine: (String, Int) => SSLEngine = (host, port) => {
+ val engine = sslContext.createSSLEngine(host, port)
+ engine.setUseClientMode(true)
+
+ // WARNING: this creates an SSL Engine without enabling endpoint identification/verification procedures
+ // Disabling host name verification is a very bad idea, please don't unless you have a very good reason to.
+ // When in doubt, use the `ConnectionContext.httpsClient` that takes an `SSLContext` instead, or enable with:
+ engine.setSSLParameters {
+ val params = engine.getSSLParameters
+ val sniMatcher = new SNIMatcher(0) {
+ override def matches(serverName: SNIServerName): Boolean = true
+ }
+ params.setSNIMatchers(java.util.Collections.singletonList(sniMatcher))
+ params
+ }
+
+ engine
+ }
+
+ val clientConnectionContext = ConnectionContext.httpsClient(createInsecureSslEngine)
val request = HttpRequest(uri = s"https:/${serverBinding.localAddress}")
Http()
diff --git a/http-cors/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/http-cors/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
new file mode 100644
index 000000000..37394df7d
--- /dev/null
+++ b/http-cors/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
@@ -0,0 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Remove deprecated methods
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.cors.javadsl.settings.CorsSettings.defaultSettings")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.cors.scaladsl.settings.CorsSettings.defaultSettings")
diff --git a/http-cors/src/main/scala/org/apache/pekko/http/cors/javadsl/settings/CorsSettings.scala b/http-cors/src/main/scala/org/apache/pekko/http/cors/javadsl/settings/CorsSettings.scala
index 53e39e41f..472ebbf23 100644
--- a/http-cors/src/main/scala/org/apache/pekko/http/cors/javadsl/settings/CorsSettings.scala
+++ b/http-cors/src/main/scala/org/apache/pekko/http/cors/javadsl/settings/CorsSettings.scala
@@ -67,11 +67,4 @@ object CorsSettings {
* Creates an instance of CorsSettings using the configuration provided by the given ActorSystem.
*/
def create(system: ActorSystem): CorsSettings = scaladsl.settings.CorsSettings(system)
-
- /**
- * Settings from the default loaded configuration. Note that application code may want to use the `apply()` methods
- * instead to have more control over the source of the configuration.
- */
- @deprecated("Use other CorsSettings constructors", "1.0.0")
- def defaultSettings: CorsSettings = scaladsl.settings.CorsSettings.defaultSettings
}
diff --git a/http-cors/src/main/scala/org/apache/pekko/http/cors/scaladsl/settings/CorsSettings.scala b/http-cors/src/main/scala/org/apache/pekko/http/cors/scaladsl/settings/CorsSettings.scala
index d06e34f2a..ea4276e5f 100644
--- a/http-cors/src/main/scala/org/apache/pekko/http/cors/scaladsl/settings/CorsSettings.scala
+++ b/http-cors/src/main/scala/org/apache/pekko/http/cors/scaladsl/settings/CorsSettings.scala
@@ -31,7 +31,7 @@ import pekko.http.scaladsl.model.headers.HttpOrigin
import pekko.http.scaladsl.model.{ HttpHeader, HttpMethod, HttpMethods }
import pekko.util.OptionConverters._
import com.typesafe.config.ConfigException.{ Missing, WrongType }
-import com.typesafe.config.{ Config, ConfigFactory }
+import com.typesafe.config.Config
import scala.collection.JavaConverters._
import scala.collection.immutable.Seq
@@ -185,13 +185,6 @@ object CorsSettings extends SettingsCompanionImpl[CorsSettings]("pekko.http.cors
*/
implicit def default(implicit system: ActorSystem): CorsSettings = apply(system)
- /**
- * Settings from the default loaded configuration. Note that application code may want to use the `apply()` methods
- * instead to have more control over the source of the configuration.
- */
- @deprecated("Use other CorsSettings constructors", "1.0.0")
- def defaultSettings: CorsSettings = apply(ConfigFactory.load(getClass.getClassLoader))
-
def fromSubConfig(root: Config, config: Config): CorsSettings = {
def parseStringList(path: String): List[String] =
Try(config.getStringList(path).asScala.toList).recover { case _: WrongType =>
diff --git a/http-tests/src/test/java/org/apache/pekko/http/javadsl/HttpAPIsTest.java b/http-tests/src/test/java/org/apache/pekko/http/javadsl/HttpAPIsTest.java
index 3382afa52..b83eaff4f 100644
--- a/http-tests/src/test/java/org/apache/pekko/http/javadsl/HttpAPIsTest.java
+++ b/http-tests/src/test/java/org/apache/pekko/http/javadsl/HttpAPIsTest.java
@@ -42,9 +42,9 @@ public class HttpAPIsTest extends JUnitRouteTest {
public void compileOnly() throws Exception {
final Http http = Http.get(system());
- final ConnectionContext connectionContext = ConnectionContext.https(SSLContext.getDefault());
final HttpConnectionContext httpContext = ConnectionContext.noEncryption();
- final HttpsConnectionContext httpsContext = ConnectionContext.https(SSLContext.getDefault());
+ final HttpsConnectionContext httpsContext =
+ ConnectionContext.httpsClient(SSLContext.getDefault());
String host = "";
int port = 9090;
diff --git a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/SizeLimitSpec.scala b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/SizeLimitSpec.scala
index bc19f6c3c..6cfe7b2d5 100644
--- a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/SizeLimitSpec.scala
+++ b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/SizeLimitSpec.scala
@@ -26,17 +26,17 @@ import pekko.http.scaladsl.server.Directives._
import pekko.stream.scaladsl.{ Flow, Source }
import pekko.testkit.TestKit
import pekko.util.ByteString
-import scala.annotation.nowarn
import com.typesafe.config.{ Config, ConfigFactory }
+import org.scalatest.BeforeAndAfterAll
import org.scalatest.concurrent.ScalaFutures
+import org.scalatest.matchers.should.Matchers
import org.scalatest.time.{ Millis, Seconds, Span }
-import org.scalatest.BeforeAndAfterAll
+import org.scalatest.wordspec.AnyWordSpec
import scala.collection.immutable
-import org.scalatest.matchers.should.Matchers
-import org.scalatest.wordspec.AnyWordSpec
+import scala.concurrent.Await
+import scala.concurrent.duration.DurationInt
-@nowarn("msg=synchronous compression with `encode` is not supported in the future any more")
class SizeLimitSpec extends AnyWordSpec with Matchers with RequestBuilding with BeforeAndAfterAll with ScalaFutures {
import pekko.http.ccompat.ImplicitUtils._
@@ -103,7 +103,7 @@ class SizeLimitSpec extends AnyWordSpec with Matchers with RequestBuilding with
"reject a small request that decodes into a large entity" in {
val data = ByteString.fromString("0" * (decodeMaxSize + 1))
- val zippedData = Coders.Gzip.encode(data)
+ val zippedData = Await.result(Coders.Gzip.encodeAsync(data), 10.seconds)
val request = HttpRequest(
HttpMethods.POST,
s"http:/${binding.localAddress}/noDirective",
@@ -187,7 +187,7 @@ class SizeLimitSpec extends AnyWordSpec with Matchers with RequestBuilding with
"accept a small request that decodes into a large entity" in {
val data = ByteString.fromString("0" * (decodeMaxSize + 1))
- val zippedData = Coders.Gzip.encode(data)
+ val zippedData = Await.result(Coders.Gzip.encodeAsync(data), 10.seconds)
val request = HttpRequest(
HttpMethods.POST,
s"http:/${binding.localAddress}/noDirective",
@@ -206,7 +206,7 @@ class SizeLimitSpec extends AnyWordSpec with Matchers with RequestBuilding with
"accept a large request that decodes into a large entity" in {
val data = new Array[Byte](decodeMaxSize)
random.nextBytes(data)
- val zippedData = Coders.Gzip.encode(ByteString(data))
+ val zippedData = Await.result(Coders.Gzip.encodeAsync(ByteString(data)), 3.seconds)
val request = HttpRequest(
HttpMethods.POST,
s"http:/${binding.localAddress}/noDirective",
diff --git a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectivesSpec.scala b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectivesSpec.scala
index de24333dd..612cd6ef8 100644
--- a/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectivesSpec.scala
+++ b/http-tests/src/test/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectivesSpec.scala
@@ -99,17 +99,6 @@ class HeaderDirectivesSpec extends RoutingSpec with Inside {
}
}
- "extract a header with Symbol name" in {
- lazy val symbolRoute =
- headerValueByName(Symbol("Referer")) { referer =>
- complete(s"The symbol referer was $referer")
- }
-
- Get("abc") ~> RawHeader("Referer", "http://example.com/symbol") ~> symbolRoute ~> check {
- responseAs[String] shouldEqual "The symbol referer was http://example.com/symbol"
- }
- }
-
"reject a request if no header of the given type is present" in {
Get("abc") ~> route ~> check {
inside(rejection) {
@@ -131,17 +120,6 @@ class HeaderDirectivesSpec extends RoutingSpec with Inside {
}
}
- "extract a header with Symbol name" in {
- lazy val symbolRoute =
- optionalHeaderValueByName(Symbol("Referer")) { referer =>
- complete(s"The symbol referer was $referer")
- }
-
- Get("abc") ~> RawHeader("Referer", "http://example.com/symbol") ~> symbolRoute ~> check {
- responseAs[String] shouldEqual "The symbol referer was Some(http://example.com/symbol)"
- }
- }
-
"extract None if no header of the given name is present" in {
Get("abc") ~> route ~> check {
responseAs[String] shouldEqual "The referer was None"
diff --git a/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes b/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
new file mode 100644
index 000000000..f01d5021a
--- /dev/null
+++ b/http/src/main/mima-filters/2.0.x.backwards.excludes/remove-deprecated-methods.excludes
@@ -0,0 +1,44 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Remove deprecated methods
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.Directives.extractUpgradeToWebSocket")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.server.directives.WebSocketDirectives.extractUpgradeToWebSocket")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.RoutingSettings.getFileIODispatcher")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.settings.RoutingSettings.withFileIODispatcher")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.javadsl.unmarshalling.sse.EventStreamUnmarshalling.fromEventStream")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.coding.Deflate.newEncodeTransformer")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.coding.Encoder.newEncodeTransformer")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.coding.Gzip.newEncodeTransformer")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.coding.NoCoding.newCompressor")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.coding.NoCoding.newEncodeTransformer")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.Directives.headerValueByName")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.Directives.optionalHeaderValueByName")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.directives.HeaderDirectives.headerValueByName")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.directives.HeaderDirectives.optionalHeaderValueByName")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.HttpApp.headerValueByName")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.HttpApp.optionalHeaderValueByName")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.Directives.extractUpgradeToWebSocket")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.directives.WebSocketDirectives.extractUpgradeToWebSocket")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.server.HttpApp.extractUpgradeToWebSocket")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.RoutingSettings.fileIODispatcher")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.RoutingSettings.getFileIODispatcher")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.settings.RoutingSettings.withFileIODispatcher")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.maxLineSize")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.maxEventSize")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.fromEventStream")
+ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.$init$")
diff --git a/http/src/main/scala/org/apache/pekko/http/impl/settings/RoutingSettingsImpl.scala b/http/src/main/scala/org/apache/pekko/http/impl/settings/RoutingSettingsImpl.scala
index 5997c4795..5ea270bdb 100644
--- a/http/src/main/scala/org/apache/pekko/http/impl/settings/RoutingSettingsImpl.scala
+++ b/http/src/main/scala/org/apache/pekko/http/impl/settings/RoutingSettingsImpl.scala
@@ -29,11 +29,6 @@ private[http] final case class RoutingSettingsImpl(
decodeMaxBytesPerChunk: Int,
decodeMaxSize: Long) extends pekko.http.scaladsl.settings.RoutingSettings {
- @deprecated(
- "binary compatibility method. Use `pekko.stream.materializer.blocking-io-dispatcher` to configure the dispatcher",
- since = "Akka HTTP 10.1.6")
- override def fileIODispatcher: String = ""
-
override def productPrefix = "RoutingSettings"
}
diff --git a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/WebSocketDirectives.scala b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/WebSocketDirectives.scala
index 5a665a362..fa3a746e1 100644
--- a/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/WebSocketDirectives.scala
+++ b/http/src/main/scala/org/apache/pekko/http/javadsl/server/directives/WebSocketDirectives.scala
@@ -22,7 +22,6 @@ import org.apache.pekko
import pekko.NotUsed
import pekko.http.scaladsl.model.{ ws => s }
import pekko.http.javadsl.model.ws.Message
-import pekko.http.javadsl.model.ws.UpgradeToWebSocket
import pekko.http.javadsl.model.ws.WebSocketUpgrade
import pekko.http.scaladsl.server.{ Directives => D }
import pekko.stream.javadsl.Flow
@@ -32,20 +31,7 @@ abstract class WebSocketDirectives extends SecurityDirectives {
import pekko.http.impl.util.JavaMapping.Implicits._
/**
- * Extract the [[UpgradeToWebSocket]] header if existent. Rejects with an [[ExpectedWebSocketRequestRejection]], otherwise.
- *
- * @deprecated use `webSocketUpgrade` instead since Akka HTTP 10.2.0
- */
- @Deprecated
- @deprecated("use `extractWebSocketUpgrade` instead", since = "Akka HTTP 10.2.0")
- def extractUpgradeToWebSocket(inner: JFunction[UpgradeToWebSocket, Route]): Route = RouteAdapter {
- D.extractUpgradeToWebSocket { header =>
- inner.apply(header).delegate
- }
- }
-
- /**
- * Extract the UpgradeToWebSocket attribute if this is a WebSocket request.
+ * Extract the WebSocketUpgrade attribute if this is a WebSocket request.
* Rejects with an [[ExpectedWebSocketRequestRejection]], otherwise.
*/
def extractWebSocketUpgrade(inner: JFunction[WebSocketUpgrade, Route]): Route = RouteAdapter {
diff --git a/http/src/main/scala/org/apache/pekko/http/javadsl/settings/RoutingSettings.scala b/http/src/main/scala/org/apache/pekko/http/javadsl/settings/RoutingSettings.scala
index 50da75257..d4802e6be 100644
--- a/http/src/main/scala/org/apache/pekko/http/javadsl/settings/RoutingSettings.scala
+++ b/http/src/main/scala/org/apache/pekko/http/javadsl/settings/RoutingSettings.scala
@@ -30,11 +30,6 @@ abstract class RoutingSettings private[pekko] () { self: RoutingSettingsImpl =>
def getRangeCountLimit: Int
def getRangeCoalescingThreshold: Long
def getDecodeMaxBytesPerChunk: Int
- @deprecated(
- "binary compatibility method. Use `pekko.stream.materializer.blocking-io-dispatcher` to configure the dispatcher",
- since = "Akka HTTP 10.1.6")
- @Deprecated
- def getFileIODispatcher: String
def withVerboseErrorMessages(verboseErrorMessages: Boolean): RoutingSettings =
self.copy(verboseErrorMessages = verboseErrorMessages)
@@ -48,11 +43,6 @@ abstract class RoutingSettings private[pekko] () { self: RoutingSettingsImpl =>
def withDecodeMaxBytesPerChunk(decodeMaxBytesPerChunk: Int): RoutingSettings =
self.copy(decodeMaxBytesPerChunk = decodeMaxBytesPerChunk)
def withDecodeMaxSize(decodeMaxSize: Long): RoutingSettings = self.copy(decodeMaxSize = decodeMaxSize)
- @deprecated(
- "binary compatibility method. Use `pekko.stream.materializer.blocking-io-dispatcher` to configure the dispatcher",
- since = "Akka HTTP 10.1.6")
- @Deprecated
- def withFileIODispatcher(fileIODispatcher: String): RoutingSettings = self
}
object RoutingSettings extends SettingsCompanion[RoutingSettings] {
diff --git a/http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/sse/EventStreamUnmarshalling.scala b/http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/sse/EventStreamUnmarshalling.scala
index 97d56000e..a487e49aa 100644
--- a/http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/sse/EventStreamUnmarshalling.scala
+++ b/http/src/main/scala/org/apache/pekko/http/javadsl/unmarshalling/sse/EventStreamUnmarshalling.scala
@@ -47,13 +47,6 @@ object EventStreamUnmarshalling {
def fromEventsStream(settings: ServerSentEventSettings): Unmarshaller[HttpEntity, Source[ServerSentEvent, NotUsed]] =
asHttpEntityUnmarshaller(pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.fromEventsStream(settings))
- // for binary-compatibility, since Akka HTTP 10.1.7
- @deprecated(
- "Binary compatibility method. Invocations should have an implicit ActorSystem in scope to provide access to configuration",
- "Akka HTTP 10.1.8")
- val fromEventStream: Unmarshaller[HttpEntity, Source[ServerSentEvent, NotUsed]] =
- asHttpEntityUnmarshaller(pekko.http.scaladsl.unmarshalling.sse.EventStreamUnmarshalling.fromEventStream)
-
private def asHttpEntityUnmarshaller(value: FromEntityUnmarshaller[scaladsl.Source[sse.ServerSentEvent, NotUsed]])
: Unmarshaller[HttpEntity, Source[ServerSentEvent, NotUsed]] = {
value
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Deflate.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Deflate.scala
index 8dbb2a4d0..07f781581 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Deflate.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Deflate.scala
@@ -27,7 +27,7 @@ class Deflate private[http] (compressionLevel: Int, val messageFilter: HttpMessa
}
val encoding = HttpEncodings.deflate
- def newCompressor = new DeflateCompressor(compressionLevel)
+ private[http] def newCompressor = new DeflateCompressor(compressionLevel)
def newDecompressorStage(maxBytesPerChunk: Int) = () => new DeflateDecompressor(maxBytesPerChunk)
@deprecated("Use Coders.Deflate(compressionLevel = ...) instead", since = "Akka HTTP 10.2.0")
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/DeflateCompressor.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/DeflateCompressor.scala
index d1abe53f8..de02f8eb0 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/DeflateCompressor.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/DeflateCompressor.scala
@@ -26,8 +26,7 @@ import scala.annotation.tailrec
/** Internal API */
@InternalApi
-@deprecated("DeflateCompressor is internal API and will be moved or removed in the future", since = "Akka HTTP 10.2.0")
-class DeflateCompressor private[coding] (compressionLevel: Int) extends Compressor {
+private[coding] class DeflateCompressor private[coding] (compressionLevel: Int) extends Compressor {
require(compressionLevel >= 0 && compressionLevel <= 9, "Compression level needs to be between 0 and 9")
import DeflateCompressor._
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Encoder.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Encoder.scala
index b81deec68..a08e4b500 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Encoder.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Encoder.scala
@@ -26,8 +26,6 @@ import pekko.stream.stage.GraphStage
import pekko.util.ByteString
import headers._
-import scala.annotation.nowarn
-
trait Encoder {
def encoding: HttpEncoding
@@ -56,15 +54,9 @@ trait Encoder {
Source.single(input).via(singleUseEncoderFlow()).runWith(Sink.fold(ByteString.empty)(_ ++ _))
@InternalApi
- @deprecated("newCompressor is internal API", since = "Akka HTTP 10.2.0")
- def newCompressor: Compressor
-
- @InternalApi
- @deprecated("newEncodeTransformer is internal API", since = "Akka HTTP 10.2.0")
- def newEncodeTransformer(): GraphStage[FlowShape[ByteString, ByteString]] = singleUseEncoderFlow()
+ private[http] def newCompressor: Compressor
private def singleUseEncoderFlow(): GraphStage[FlowShape[ByteString, ByteString]] = {
- @nowarn("msg=deprecated")
val compressor = newCompressor
def encodeChunk(bytes: ByteString): ByteString = compressor.compressAndFlush(bytes)
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Gzip.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Gzip.scala
index 7046d2646..559692866 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Gzip.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/Gzip.scala
@@ -27,7 +27,7 @@ class Gzip private[http] (compressionLevel: Int, val messageFilter: HttpMessage
}
val encoding = HttpEncodings.gzip
- def newCompressor = new GzipCompressor(compressionLevel)
+ private[http] def newCompressor = new GzipCompressor(compressionLevel)
def newDecompressorStage(maxBytesPerChunk: Int) = () => new GzipDecompressor(maxBytesPerChunk)
@deprecated("Use Coders.Gzip(compressionLevel = ...) instead", since = "Akka HTTP 10.2.0")
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/NoCoding.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/NoCoding.scala
index 6295a8d29..8f77b0958 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/NoCoding.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/coding/NoCoding.scala
@@ -36,7 +36,7 @@ object NoCoding extends Coder with StreamDecoder {
val messageFilter: HttpMessage => Boolean = _ => false
- def newCompressor = NoCodingCompressor
+ private[http] def newCompressor = NoCodingCompressor
def newDecompressorStage(maxBytesPerChunk: Int): () => GraphStage[FlowShape[ByteString, ByteString]] =
() => StreamUtils.limitByteChunksStage(maxBytesPerChunk)
@@ -44,8 +44,7 @@ object NoCoding extends Coder with StreamDecoder {
/** Internal API */
@InternalApi
-@deprecated("NoCodingCompressor is internal API and will be moved or removed in the future", since = "Akka HTTP 10.2.0")
-object NoCodingCompressor extends Compressor {
+private[coding] object NoCodingCompressor extends Compressor {
def compress(input: ByteString): ByteString = input
def flush() = ByteString.empty
def finish() = ByteString.empty
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala
index 54c4d9fa1..370f75504 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/HeaderDirectives.scala
@@ -74,17 +74,6 @@ trait HeaderDirectives {
*/
def headerValuePF[T](pf: PartialFunction[HttpHeader, T]): Directive1[T] = headerValue(pf.lift)
- /**
- * Extracts the value of the first HTTP request header with the given name.
- * If no header with a matching name is found the request is rejected with a [[pekko.http.scaladsl.server.MissingHeaderRejection]].
- *
- * @group header
- */
- @deprecated(
- "Use string argument version or `headerValueByType`, e.g. instead of `headerValueByName('Referer)` use `headerValueByType(Referer)`",
- since = "Akka HTTP 10.2.0")
- def headerValueByName(headerName: Symbol): Directive1[String] = headerValueByName(headerName.name)
-
/**
* Extracts the value of the HTTP request header with the given name.
* If no header with a matching name is found the request is rejected with a [[pekko.http.scaladsl.server.MissingHeaderRejection]].
@@ -130,17 +119,6 @@ trait HeaderDirectives {
def optionalHeaderValuePF[T](pf: PartialFunction[HttpHeader, T]): Directive1[Option[T]] =
optionalHeaderValue(pf.lift)
- /**
- * Extracts the value of the optional HTTP request header with the given name.
- *
- * @group header
- */
- @deprecated(
- "Use string argument version or `headerValueByType`, e.g. instead of `optionalHeaderValueByName('Referer)` use `optionalHeaderValueByType(Referer)`",
- since = "Akka HTTP 10.2.0")
- def optionalHeaderValueByName(headerName: Symbol): Directive1[Option[String]] =
- optionalHeaderValueByName(headerName.name)
-
/**
* Extracts the value of the optional HTTP request header with the given name.
*
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/WebSocketDirectives.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/WebSocketDirectives.scala
index 41cd98aa3..48628d327 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/WebSocketDirectives.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/server/directives/WebSocketDirectives.scala
@@ -18,7 +18,7 @@ import scala.collection.immutable
import org.apache.pekko
import pekko.http.scaladsl.model.AttributeKeys.webSocketUpgrade
-import pekko.http.scaladsl.model.ws.{ Message, UpgradeToWebSocket, WebSocketUpgrade }
+import pekko.http.scaladsl.model.ws.{ Message, WebSocketUpgrade }
import pekko.stream.scaladsl.Flow
/**
@@ -28,21 +28,8 @@ import pekko.stream.scaladsl.Flow
trait WebSocketDirectives {
import AttributeDirectives._
import BasicDirectives._
- import HeaderDirectives._
import RouteDirectives._
- /**
- * Extract the [[UpgradeToWebSocket]] header if existent. Rejects with an [[ExpectedWebSocketRequestRejection]], otherwise.
- *
- * @group websocket
- */
- @deprecated("use `extractWebSocketUpgrade` instead", since = "Akka HTTP 10.2.0")
- def extractUpgradeToWebSocket: Directive1[UpgradeToWebSocket] =
- optionalHeaderValueByType(classOf[UpgradeToWebSocket]).flatMap {
- case Some(upgrade) => provide(upgrade)
- case None => reject(ExpectedWebSocketRequestRejection)
- }
-
/**
* Extract the WebSocketUpgrade attribute if this is a WebSocket request.
* Rejects with an [[ExpectedWebSocketRequestRejection]], otherwise.
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/settings/RoutingSettings.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/settings/RoutingSettings.scala
index ed787eb11..2cb1a7c62 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/settings/RoutingSettings.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/settings/RoutingSettings.scala
@@ -31,10 +31,6 @@ abstract class RoutingSettings private[pekko] () extends pekko.http.javadsl.sett
def rangeCoalescingThreshold: Long
def decodeMaxBytesPerChunk: Int
def decodeMaxSize: Long
- @deprecated(
- "binary compatibility method. Use `pekko.stream.materializer.blocking-io-dispatcher` to configure the dispatcher",
- since = "Akka HTTP 10.1.6")
- def fileIODispatcher: String
/* Java APIs */
def getVerboseErrorMessages: Boolean = this.verboseErrorMessages
@@ -44,11 +40,6 @@ abstract class RoutingSettings private[pekko] () extends pekko.http.javadsl.sett
def getRangeCoalescingThreshold: Long = this.rangeCoalescingThreshold
def getDecodeMaxBytesPerChunk: Int = this.decodeMaxBytesPerChunk
def getDecodeMaxSize: Long = this.decodeMaxSize
- @deprecated(
- "binary compatibility method. Use `pekko.stream.materializer.blocking-io-dispatcher` to configure the dispatcher",
- since = "Akka HTTP 10.1.6")
- @Deprecated
- def getFileIODispatcher: String = this.fileIODispatcher
override def withVerboseErrorMessages(verboseErrorMessages: Boolean): RoutingSettings =
self.copy(verboseErrorMessages = verboseErrorMessages)
@@ -62,11 +53,6 @@ abstract class RoutingSettings private[pekko] () extends pekko.http.javadsl.sett
override def withDecodeMaxBytesPerChunk(decodeMaxBytesPerChunk: Int): RoutingSettings =
self.copy(decodeMaxBytesPerChunk = decodeMaxBytesPerChunk)
override def withDecodeMaxSize(decodeMaxSize: Long): RoutingSettings = self.copy(decodeMaxSize = decodeMaxSize)
- @deprecated(
- "binary compatibility method. Use `pekko.stream.materializer.blocking-io-dispatcher` to configure the dispatcher",
- since = "Akka HTTP 10.1.6")
- @Deprecated
- override def withFileIODispatcher(fileIODispatcher: String): RoutingSettings = self
}
object RoutingSettings extends SettingsCompanion[RoutingSettings] {
diff --git a/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala b/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
index dbc420b88..251729ffd 100644
--- a/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
+++ b/http/src/main/scala/org/apache/pekko/http/scaladsl/unmarshalling/sse/EventStreamUnmarshalling.scala
@@ -49,28 +49,6 @@ object EventStreamUnmarshalling extends EventStreamUnmarshalling
@ApiMayChange
trait EventStreamUnmarshalling {
- /**
- * The maximum size for parsing lines of a server-sent event; 4KiB by default.
- */
- @deprecated(
- "Set this property in configuration as `pekko.http.sse.max-line-size` before calling fromEventsStream(implicit ActorSystem)",
- "Akka HTTP 10.1.8")
- protected def maxLineSize: Int = 4096
-
- /**
- * The maximum size for parsing server-sent events; 8KiB by default.
- */
- @deprecated(
- "Set this property in configuration as `pekko.http.sse.max-event-size` before calling fromEventsStream(implicit ActorSystem)",
- "Akka HTTP 10.1.8")
- protected def maxEventSize: Int = 8192
-
- @deprecated(
- "Binary compatibility method. Invocations should have an implicit ActorSystem in scope to provide access to configuration",
- "Akka HTTP 10.1.8")
- final val fromEventStream: FromEntityUnmarshaller[Source[ServerSentEvent, NotUsed]] =
- fromEventsStream(maxEventSize, maxLineSize, emitEmptyEvents = false)
-
/**
* Lets an `HttpEntity` with a `text/event-stream` media type be unmarshalled to a source of `ServerSentEvent`s.
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org