chibenwa commented on a change in pull request #781:
URL: https://github.com/apache/james-project/pull/781#discussion_r763672801
##########
File path:
server/apps/distributed-app/docs/modules/ROOT/pages/configure/jmap.adoc
##########
@@ -57,12 +57,14 @@ This enables a higher resilience, but the projection needs
to be correctly popul
| authentication.strategy.draft
-| Optional List[String], defaults to null. Specify which authentication
strategies system admin want to use for JMAP draft server.
-If non is specified, JMAP draft server will fallback to default strategies.
+| Optional List[String] with delimiter `,` . Specify which authentication
strategies system admin want to use for JMAP draft server.
+If non is specified, JMAP draft server will fallback to default strategies:
+`AccessTokenAuthenticationStrategy`, `JWTAuthenticationStrategy`,
`QueryParameterAccessTokenAuthenticationStrategy`.
| authentication.strategy.rfc8621
-| Optional List[String], defaults to null. Specify which authentication
strategies system admin want to use for JMAP RFC-8621 server.
-If non is specified, JMAP RFC-8621 server will fallback to default strategies.
+| Optional List[String] with delimiter `,` . Specify which authentication
strategies system admin want to use for JMAP RFC-8621 server.
+If non is specified, JMAP RFC-8621 server will fallback to default strategies:
+`JWTAuthenticationStrategy`, `BasicAuthenticationStrategy`
Review comment:
Full FQDNs please
##########
File path: server/apps/cassandra-app/sample-configuration/jmap.properties
##########
@@ -21,4 +21,10 @@ tls.secret=james72laBalle
# Should simple Email/query be resolved against a Cassandra projection, or
should we resolve them against ElasticSearch?
# This enables a higher resilience, but the projection needs to be correctly
populated. False by default.
-# view.email.query.enabled=true
\ No newline at end of file
+# view.email.query.enabled=true
+
+# If you want to specified authentication strategies for Jmap draft version
+#
authentication.strategy.draft=org.apache.james.AuthStratA,org.apache.james.AuthStratB
Review comment:
Can we instead put the FQDNs of the auth strategies used by default?
##########
File path: src/site/xdoc/server/config-jmap.xml
##########
@@ -85,14 +85,16 @@
</dd>
<dt><strong>authentication.strategy.draft</strong></dt>
- <dd>Optional List[String]. Defaults to null.</dd>
+ <dd>Optional List[String] with delimiter ",". Defaults to
empty.</dd>
<dd>Specify which authentication strategies system admin
want to use for JMAP draft server.
- If non is specified, JMAP draft server will fallback to
default strategies.</dd>
+ If non is specified, JMAP draft server will fallback to
default strategies:
+ AccessTokenAuthenticationStrategy,
JWTAuthenticationStrategy, QueryParameterAccessTokenAuthenticationStrategy.</dd>
<dt><strong>authentication.strategy.rfc8621</strong></dt>
- <dd>Optional List[String]. Defaults to null.</dd>
+ <dd>Optional List[String] with delimiter ",". Defaults to
empty.</dd>
Review comment:
idem
##########
File path: src/site/xdoc/server/config-jmap.xml
##########
@@ -85,14 +85,16 @@
</dd>
<dt><strong>authentication.strategy.draft</strong></dt>
- <dd>Optional List[String]. Defaults to null.</dd>
+ <dd>Optional List[String] with delimiter ",". Defaults to
empty.</dd>
Review comment:
```suggestion
<dd>List[String] with delimiter ",". Defaults to
FQDN1,FQDN2,FQDN3.</dd>
```
##########
File path:
server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/draft/DraftMethodsModule.java
##########
@@ -123,21 +120,17 @@ Authenticator provideAuthenticator(MetricFactory
metricFactory,
@Singleton
@Named("draftJmapAuthenticationStrategies")
public Set<AuthenticationStrategy>
provideAuthenticationStrategies(GuiceGenericLoader loader,
-
JMAPConfiguration configuration,
-
AccessTokenAuthenticationStrategy accessTokenAuthenticationStrategy,
-
JWTAuthenticationStrategy jwtAuthenticationStrategy,
-
QueryParameterAccessTokenAuthenticationStrategy
queryParameterAuthenticationStrategy) {
- Set<AuthenticationStrategy> specifiedStrategies =
configuration.getAuthenticationStrategies()
+
JMAPDraftConfiguration configuration) {
+ List<String> defaultStrategies = ImmutableList.of(
+ "org.apache.james.jmap.http.AccessTokenAuthenticationStrategy",
+ "org.apache.james.jmap.jwt.JWTAuthenticationStrategy",
+
"org.apache.james.jmap.http.QueryParameterAccessTokenAuthenticationStrategy");
Review comment:
Don't hard code these FQDNs get them from the class names
##########
File path:
server/container/guice/protocols/jmap/src/main/java/org/apache/james/jmap/rfc8621/RFC8621MethodsModule.java
##########
@@ -189,21 +190,17 @@ Authenticator provideAuthenticator(MetricFactory
metricFactory,
@Singleton
@Named("jmapRFC8621AuthenticationStrategies")
public Set<AuthenticationStrategy>
provideAuthenticationStrategies(GuiceGenericLoader loader,
-
JmapRfc8621Configuration configuration,
-
JWTAuthenticationStrategy jwtAuthenticationStrategy,
-
BasicAuthenticationStrategy basicAuthenticationStrategy) {
- Set<AuthenticationStrategy> specifiedStrategies =
configuration.getAuthenticationStrategiesAsJava()
+
JmapRfc8621Configuration configuration) {
+ List<String> defaultStrategies = ImmutableList.of(
+ "org.apache.james.jmap.jwt.JWTAuthenticationStrategy",
+ "org.apache.james.jmap.http.BasicAuthenticationStrategy");
Review comment:
Idem
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]