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 2020/10/17 00:38:04 UTC

[GitHub] [james-project] antonok-edm opened a new pull request #254: Move JMAP session resource to /.well-known/jmap

antonok-edm opened a new pull request #254:
URL: https://github.com/apache/james-project/pull/254


   Section 2.2 of RFC 8620 is as follows:
   
   > ## 2.2. Service Autodiscovery
   >
   > There are two standardised autodiscovery methods in use for Internet protocols:
   >
   > - **DNS SRV** (see [@!RFC2782], [@!RFC6186], and [@!RFC6764])
   > - **.well-known/servicename** (see [@!RFC8615])
   >
   > A JMAP-supporting host for the domain `example.com` SHOULD publish a SRV record `_jmap._tcp.example.com` that gives a *hostname* and *port* (usually port `443`). The JMAP Session resource is then `https://${hostname}[:${port}]/.well-known/jmap` (following any redirects).
   >
   > If the client has a username in the form of an email address, it MAY use the domain portion of this to attempt autodiscovery of the JMAP server.
   
   James' implementation exposes the JMAP Session Resource at `/jmap/session`. Clients which expect it at `/.well-known/jmap` are unable to find it.
   
   The spec language ("SHOULD") is a strong recommendation and not a requirement, so it's acceptable if there's a good reason to disregard it - but I'm not personally aware of one, and in any case the choice ought to be documented somewhere. I tried to set up a James server for testing a JMAP client implementation and couldn't figure out why it wasn't working until I dug into the source code.


----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa edited a comment on pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa edited a comment on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711491851


   Looks great!
   
   I added a little test for this as well https://github.com/linagora/james-project/pull/3919/commits/ba25c8e6679eecaa70948a4d0e26b493a747d9a6


----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on a change in pull request #254: Move JMAP session resource to /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #254:
URL: https://github.com/apache/james-project/pull/254#discussion_r506950523



##########
File path: server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/http/SessionRoutes.scala
##########
@@ -42,7 +42,7 @@ import reactor.core.scheduler.Schedulers
 import reactor.netty.http.server.HttpServerResponse
 
 object SessionRoutes {
-  private val JMAP_SESSION: String = "/jmap/session"
+  private val JMAP_SESSION: String = "/.well-known/jmap"

Review comment:
       Can we use a redirect as suggested hy the specs instead?




----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on pull request #254: Move JMAP session resource to /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711123896


   Thanks a lot, I will take a look.
   
   I will launch tests for this on monday.
   
   There needs to be a docker environment available for some tests to pass - likely an issue to be addressed.
   


----------------------------------------------------------------
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.

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


[GitHub] [james-project] antonok-edm closed pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
antonok-edm closed pull request #254:
URL: https://github.com/apache/james-project/pull/254


   


----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on a change in pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #254:
URL: https://github.com/apache/james-project/pull/254#discussion_r507344184



##########
File path: server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/http/SessionRoutes.scala
##########
@@ -58,12 +59,18 @@ class SessionRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticator:
       .subscribeOn(Schedulers.elastic())
       .asJava()
 
+  private val redirectToSession: JMAPRoute.Action = JMAPRoutes.redirectTo(JMAP_SESSION)
+
   override def routes: Stream[JMAPRoute] =
     Stream.of(
       JMAPRoute.builder()
         .endpoint(new Endpoint(HttpMethod.GET, JMAP_SESSION))
         .action(generateSession)
         .corsHeaders,
+      JMAPRoute.builder()
+        .endpoint(new Endpoint(HttpMethod.GET, WELL_KNOWN_JMAP))
+        .action(redirectToSession)
+        .corsHeaders,
       JMAPRoute.builder()
         .endpoint(new Endpoint(HttpMethod.OPTIONS, AUTHENTICATION))

Review comment:
       Here is a fix ;-)
   
   https://github.com/linagora/james-project/pull/3918




----------------------------------------------------------------
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.

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


[GitHub] [james-project] antonok-edm commented on a change in pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
antonok-edm commented on a change in pull request #254:
URL: https://github.com/apache/james-project/pull/254#discussion_r507315721



##########
File path: server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/http/SessionRoutes.scala
##########
@@ -58,12 +59,18 @@ class SessionRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticator:
       .subscribeOn(Schedulers.elastic())
       .asJava()
 
+  private val redirectToSession: JMAPRoute.Action = JMAPRoutes.redirectTo(JMAP_SESSION)
+
   override def routes: Stream[JMAPRoute] =
     Stream.of(
       JMAPRoute.builder()
         .endpoint(new Endpoint(HttpMethod.GET, JMAP_SESSION))
         .action(generateSession)
         .corsHeaders,
+      JMAPRoute.builder()
+        .endpoint(new Endpoint(HttpMethod.GET, WELL_KNOWN_JMAP))
+        .action(redirectToSession)
+        .corsHeaders,
       JMAPRoute.builder()
         .endpoint(new Endpoint(HttpMethod.OPTIONS, AUTHENTICATION))

Review comment:
       @chibenwa is `AUTHENTICATION` here an error? this should be `JMAP_SESSION` instead?




----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on a change in pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on a change in pull request #254:
URL: https://github.com/apache/james-project/pull/254#discussion_r507326604



##########
File path: server/protocols/jmap-rfc-8621/src/main/scala/org/apache/james/jmap/http/SessionRoutes.scala
##########
@@ -58,12 +59,18 @@ class SessionRoutes @Inject() (@Named(InjectionKeys.RFC_8621) val authenticator:
       .subscribeOn(Schedulers.elastic())
       .asJava()
 
+  private val redirectToSession: JMAPRoute.Action = JMAPRoutes.redirectTo(JMAP_SESSION)
+
   override def routes: Stream[JMAPRoute] =
     Stream.of(
       JMAPRoute.builder()
         .endpoint(new Endpoint(HttpMethod.GET, JMAP_SESSION))
         .action(generateSession)
         .corsHeaders,
+      JMAPRoute.builder()
+        .endpoint(new Endpoint(HttpMethod.GET, WELL_KNOWN_JMAP))
+        .action(redirectToSession)
+        .corsHeaders,
       JMAPRoute.builder()
         .endpoint(new Endpoint(HttpMethod.OPTIONS, AUTHENTICATION))

Review comment:
       Of course it is ....




----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on pull request #254: Move JMAP session resource to /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711023811


   (But I agree with implementing that should with a redirect)


----------------------------------------------------------------
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.

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


[GitHub] [james-project] antonok-edm commented on pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
antonok-edm commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-712561736


   For sure, thanks all for the quick reviews :smile: 


----------------------------------------------------------------
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.

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


[GitHub] [james-project] antonok-edm commented on pull request #254: Move JMAP session resource to /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
antonok-edm commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711087148


   @chibenwa I've implemented it as a redirect now, although I'll probably need some assistance with testing - when I try the build command from the README without the `-s` argument, I get a bunch of failures from the `DockerCassandraSingleton` class not being found.
   
   ```
   > docker run -v $PWD/.m2:/root/.m2 -v $PWD:/origin -t james/project well-known-jmap
   
   ...
   
   [ERROR] Errors:
   [ERROR]   CassandraClusterTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   TestingSessionTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   CassandraTableManagerTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   CassandraTypeProviderTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   CassandraTypesCreatorTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   ClusterFactoryTest » ExceptionInInitializer
   [ERROR]   ResilientClusterProviderTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   SessionWithInitializedTablesFactoryTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   CassandraHealthCheckTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   PaggingTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   [ERROR]   CassandraSchemaVersionDAOTest » NoClassDefFound Could not initialize class org.apache.james.backends.cassandra.DockerCassandraSingleton
   ```


----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711491851


   Looks great!
   
   O added a little test for this as well https://github.com/linagora/james-project/pull/3919/commits/ba25c8e6679eecaa70948a4d0e26b493a747d9a6


----------------------------------------------------------------
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.

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


[GitHub] [james-project] antonok-edm commented on pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
antonok-edm commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711482136


   Ok, updated with CORS on `/.well-known/jmap` as well, and applied on top of the change from https://github.com/linagora/james-project/pull/3918


----------------------------------------------------------------
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.

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


[GitHub] [james-project] Arsnael commented on pull request #254: Redirect to JMAP session resource from /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
Arsnael commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-712557813


   Hi @antonok-edm , your work has been merged. Can you help me close your PR? (I do not have that right sorry)
   
   Thanks again for your contribution to the project :) 


----------------------------------------------------------------
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.

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


[GitHub] [james-project] chibenwa commented on pull request #254: Move JMAP session resource to /.well-known/jmap

Posted by GitBox <gi...@apache.org>.
chibenwa commented on pull request #254:
URL: https://github.com/apache/james-project/pull/254#issuecomment-711124613


   Thinking about it, I think we might need the cors to be handled for .well-known/jmap as well (OPTIONS verb).


----------------------------------------------------------------
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.

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