You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2022/01/11 09:47:54 UTC

[GitHub] [james-project] chibenwa commented on a change in pull request #837: JAMES-3691 Prevent JMAP WebPush server side request forgery

chibenwa commented on a change in pull request #837:
URL: https://github.com/apache/james-project/pull/837#discussion_r781971584



##########
File path: server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/pushsubscription/WebPushClient.scala
##########
@@ -19,29 +19,41 @@
 
 package org.apache.james.jmap.pushsubscription
 
+import java.net.InetAddress
+import java.nio.charset.StandardCharsets
+import java.time.Duration
+import java.time.temporal.ChronoUnit
+
 import io.netty.buffer.Unpooled
 import io.netty.handler.codec.http.HttpResponseStatus
+import javax.inject.Inject
 import org.apache.james.jmap.api.model.PushSubscriptionServerURL
 import org.apache.james.jmap.pushsubscription.DefaultWebPushClient.{PUSH_SERVER_ERROR_RESPONSE_MAX_LENGTH, buildHttpClient}
 import org.apache.james.jmap.pushsubscription.WebPushClientHeader.{CONTENT_ENCODING, DEFAULT_TIMEOUT, MESSAGE_URGENCY, TIME_TO_LIVE, TOPIC}
 import org.reactivestreams.Publisher
 import reactor.core.publisher.Mono
 import reactor.core.scala.publisher.SMono
+import reactor.core.scheduler.Schedulers
 import reactor.netty.ByteBufMono
 import reactor.netty.http.client.{HttpClient, HttpClientResponse}
 import reactor.netty.resources.ConnectionProvider
 
-import java.nio.charset.StandardCharsets
-import java.time.Duration
-import java.time.temporal.ChronoUnit
-import javax.inject.Inject
+import scala.util.{Failure, Success, Try}
 
 trait WebPushClient {
   def push(pushServerUrl: PushSubscriptionServerURL, request: PushRequest): Publisher[Unit]
 }
 
+object PushClientConfiguration {
+  val DEFAULT: PushClientConfiguration = PushClientConfiguration(
+      maxTimeoutSeconds = Some(10),
+      maxConnections = Some(10),
+      preventServerSideRequestForgery = false)

Review comment:
       Yes that is why in tests we need to set this to false.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org