You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2019/07/09 12:42:56 UTC
[james-project] branch master updated (9e040a4 -> b60d873)
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git.
from 9e040a4 JAMES-2806 apply prefix configuration for the builder
new b742f35 JAMES-2823 fix the 3 tests that fail because of the lack of CassandraSchemaVersion table
new 230cc6b Merge branch 'pr-2509'
new 739f1a4 JAMES-2819 upgrade pdfbox to fix a security issue
new 86b2a8b Merge branch 'pr-2504'
new 48d2142 JAMES-2822 Document usersrepository.xml options
new cee777c Merge branch 'pr-2508'
new df569a4 JAMES-2820 Reduce Mono.defer usages in UnionBlobStore
new b60d873 Merge branch 'pr-2506'
The 8 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
pom.xml | 2 +-
.../apache/james/blob/union/UnionBlobStore.java | 32 +++++++++--------
.../CassandraMailRepositoryCountDAOTest.java | 5 ++-
.../view/cassandra/BrowseStartDAOTest.java | 5 ++-
.../view/cassandra/EnqueuedMailsDaoTest.java | 5 ++-
src/site/xdoc/server/config-users.xml | 41 ++++++++++++++--------
6 files changed, 57 insertions(+), 33 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 02/08: JAMES-2820 Reduce Mono.defer usages in
UnionBlobStore
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit df569a41672707a403e6ecfef6f566283690d955
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Mon Jul 8 11:30:43 2019 +0200
JAMES-2820 Reduce Mono.defer usages in UnionBlobStore
Mono.defer ensure that nothing is running before a subscription is done,
it's already a supplier. Using another one will do nothing more.
---
.../apache/james/blob/union/UnionBlobStore.java | 32 ++++++++++++----------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java b/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java
index 74481de..9c765e5 100644
--- a/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java
+++ b/server/blob/blob-union/src/main/java/org/apache/james/blob/union/UnionBlobStore.java
@@ -23,8 +23,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.PushbackInputStream;
import java.util.Optional;
+import java.util.function.BiFunction;
import java.util.function.Function;
-import java.util.function.Supplier;
import org.apache.james.blob.api.BlobId;
import org.apache.james.blob.api.BlobStore;
@@ -85,9 +85,9 @@ public class UnionBlobStore implements BlobStore {
@Override
public Mono<BlobId> save(BucketName bucketName, byte[] data) {
try {
- return saveToCurrentFallbackIfFails(
- Mono.defer(() -> currentBlobStore.save(bucketName, data)),
- () -> Mono.defer(() -> legacyBlobStore.save(bucketName, data)));
+ return saveToCurrentFallbackIfFails(bucketName, data,
+ currentBlobStore::save,
+ legacyBlobStore::save);
} catch (Exception e) {
LOGGER.error("exception directly happens while saving bytes data, fall back to legacy blob store", e);
return legacyBlobStore.save(bucketName, data);
@@ -97,9 +97,9 @@ public class UnionBlobStore implements BlobStore {
@Override
public Mono<BlobId> save(BucketName bucketName, String data) {
try {
- return saveToCurrentFallbackIfFails(
- Mono.defer(() -> currentBlobStore.save(bucketName, data)),
- () -> Mono.defer(() -> legacyBlobStore.save(bucketName, data)));
+ return saveToCurrentFallbackIfFails(bucketName, data,
+ currentBlobStore::save,
+ legacyBlobStore::save);
} catch (Exception e) {
LOGGER.error("exception directly happens while saving String data, fall back to legacy blob store", e);
return legacyBlobStore.save(bucketName, data);
@@ -120,9 +120,9 @@ public class UnionBlobStore implements BlobStore {
@Override
public Mono<BlobId> save(BucketName bucketName, InputStream data) {
try {
- return saveToCurrentFallbackIfFails(
- Mono.defer(() -> currentBlobStore.save(bucketName, data)),
- () -> Mono.defer(() -> legacyBlobStore.save(bucketName, data)));
+ return saveToCurrentFallbackIfFails(bucketName, data,
+ currentBlobStore::save,
+ legacyBlobStore::save);
} catch (Exception e) {
LOGGER.error("exception directly happens while saving InputStream data, fall back to legacy blob store", e);
return legacyBlobStore.save(bucketName, data);
@@ -180,13 +180,15 @@ public class UnionBlobStore implements BlobStore {
.switchIfEmpty(legacyBlobStore.readBytes(bucketName, blobId));
}
- private Mono<BlobId> saveToCurrentFallbackIfFails(
- Mono<BlobId> currentSavingOperation,
- Supplier<Mono<BlobId>> fallbackSavingOperationSupplier) {
+ private <T> Mono<BlobId> saveToCurrentFallbackIfFails(
+ BucketName bucketName,
+ T data,
+ BiFunction<BucketName, T, Mono<BlobId>> currentSavingOperation,
+ BiFunction<BucketName, T, Mono<BlobId>> fallbackSavingOperationSupplier) {
- return currentSavingOperation
+ return Mono.defer(() -> currentSavingOperation.apply(bucketName, data))
.onErrorResume(this::logAndReturnEmpty)
- .switchIfEmpty(fallbackSavingOperationSupplier.get());
+ .switchIfEmpty(Mono.defer(() -> fallbackSavingOperationSupplier.apply(bucketName, data)));
}
private <T> Mono<T> logAndReturnEmpty(Throwable throwable) {
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 01/08: JAMES-2819 upgrade pdfbox to fix a security
issue
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 739f1a4286dbb7a20ba738c7fb72f87c1d11fe9b
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Mon Jul 8 09:30:17 2019 +0200
JAMES-2819 upgrade pdfbox to fix a security issue
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 52b56ab..ddd7826 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2452,7 +2452,7 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
- <version>2.0.12</version>
+ <version>2.0.16</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 07/08: Merge branch 'pr-2508'
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit cee777c0998ecaafffa037caecf45b2b8ccfa366
Merge: 86b2a8b 48d2142
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Tue Jul 9 14:41:52 2019 +0200
Merge branch 'pr-2508'
src/site/xdoc/server/config-users.xml | 41 +++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 14 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 04/08: Merge branch 'pr-2509'
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 230cc6b2448cc056056d54ebdbe5e8e263d78a1b
Merge: 9e040a4 b742f35
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Tue Jul 9 14:40:15 2019 +0200
Merge branch 'pr-2509'
.../cassandra/CassandraMailRepositoryCountDAOTest.java | 5 ++++-
.../james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java | 5 ++++-
.../james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 08/08: Merge branch 'pr-2506'
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit b60d8734df81530c332a3adc17c485402abe014c
Merge: cee777c df569a4
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Tue Jul 9 14:42:22 2019 +0200
Merge branch 'pr-2506'
.../apache/james/blob/union/UnionBlobStore.java | 32 ++++++++++++----------
1 file changed, 17 insertions(+), 15 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 05/08: Merge branch 'pr-2504'
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 86b2a8bb53bdd819beb969d89e2d69c9704981f1
Merge: 230cc6b 739f1a4
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Tue Jul 9 14:41:11 2019 +0200
Merge branch 'pr-2504'
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 03/08: JAMES-2823 fix the 3 tests that fail because
of the lack of CassandraSchemaVersion table
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit b742f357f19063c9c8c9e6cc18cde9fc3e404f40
Author: Matthieu Baechler <ma...@apache.org>
AuthorDate: Mon Jul 8 15:41:28 2019 +0200
JAMES-2823 fix the 3 tests that fail because of the lack of CassandraSchemaVersion table
---
.../cassandra/CassandraMailRepositoryCountDAOTest.java | 5 ++++-
.../james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java | 5 ++++-
.../james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java | 5 ++++-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java b/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java
index 471efd4..2cc685c 100644
--- a/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java
+++ b/server/mailrepository/mailrepository-cassandra/src/test/java/org/apache/james/mailrepository/cassandra/CassandraMailRepositoryCountDAOTest.java
@@ -24,6 +24,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import org.apache.james.backends.cassandra.CassandraCluster;
import org.apache.james.backends.cassandra.CassandraClusterExtension;
import org.apache.james.backends.cassandra.CassandraRestartExtension;
+import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule;
import org.apache.james.mailrepository.api.MailRepositoryUrl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -36,7 +38,8 @@ class CassandraMailRepositoryCountDAOTest {
static final MailRepositoryUrl URL2 = MailRepositoryUrl.from("proto://url2");
@RegisterExtension
- static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailRepositoryModule.MODULE);
+ static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+ CassandraModule.aggregateModules(CassandraSchemaVersionModule.MODULE,CassandraMailRepositoryModule.MODULE));
CassandraMailRepositoryCountDAO testee;
diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java
index c427d44..0042f12 100644
--- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java
+++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/BrowseStartDAOTest.java
@@ -25,6 +25,8 @@ import java.time.Instant;
import org.apache.james.backends.cassandra.CassandraCluster;
import org.apache.james.backends.cassandra.CassandraClusterExtension;
+import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule;
import org.apache.james.queue.rabbitmq.MailQueueName;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -40,7 +42,8 @@ class BrowseStartDAOTest {
private static final Instant NOW_PLUS_TEN_SECONDS = NOW.plusSeconds(10);
@RegisterExtension
- static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailQueueViewModule.MODULE);
+ static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+ CassandraModule.aggregateModules(CassandraSchemaVersionModule.MODULE,CassandraMailQueueViewModule.MODULE));
private BrowseStartDAO testee;
diff --git a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java
index 94145c5..ee352d4 100644
--- a/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java
+++ b/server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/view/cassandra/EnqueuedMailsDaoTest.java
@@ -27,6 +27,8 @@ import java.util.List;
import org.apache.james.backends.cassandra.CassandraCluster;
import org.apache.james.backends.cassandra.CassandraClusterExtension;
+import org.apache.james.backends.cassandra.components.CassandraModule;
+import org.apache.james.backends.cassandra.versions.CassandraSchemaVersionModule;
import org.apache.james.blob.api.BlobId;
import org.apache.james.blob.api.HashBlobId;
import org.apache.james.blob.mail.MimeMessagePartsId;
@@ -60,7 +62,8 @@ class EnqueuedMailsDaoTest {
.build();
@RegisterExtension
- static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(CassandraMailQueueViewModule.MODULE);
+ static CassandraClusterExtension cassandraCluster = new CassandraClusterExtension(
+ CassandraModule.aggregateModules(CassandraSchemaVersionModule.MODULE, CassandraMailQueueViewModule.MODULE));
private EnqueuedMailsDAO testee;
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org
[james-project] 06/08: JAMES-2822 Document usersrepository.xml
options
Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
matthieu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 48d214215c7584a031af95f811cf6d4302b741c3
Author: Gautier DI FOLCO <gd...@linagora.com>
AuthorDate: Mon Jul 8 13:30:10 2019 +0200
JAMES-2822 Document usersrepository.xml options
---
src/site/xdoc/server/config-users.xml | 41 +++++++++++++++++++++++------------
1 file changed, 27 insertions(+), 14 deletions(-)
diff --git a/src/site/xdoc/server/config-users.xml b/src/site/xdoc/server/config-users.xml
index 198ad80..3056ba4 100644
--- a/src/site/xdoc/server/config-users.xml
+++ b/src/site/xdoc/server/config-users.xml
@@ -15,7 +15,7 @@
"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.
+ under the License.
-->
<document>
@@ -26,19 +26,32 @@
<body>
<section name="Users Repositories">
-
+
<subsection name="Introduction">
-
+
<p>User repositories are required to store James user information and authentication data</p>
-
+
<p>Consult <a href="https://github.com/apache/james-project/tree/master/server/app/src/main/resources/usersrepository.xml">usersrepository.xml</a> in GIT to get some examples and hints.</p>
-
+
+ </subsection>
+
+ <subsection name="General configuration">
+
+ <p>All Users Repositories provide at least these two options</p>
+
+ <dl>
+ <dt><strong>enableVirtualHosting</strong></dt>
+ <dd>true or false. Add domain support for users (default: false, except for Cassandra Users Repository)</dd>
+ <dt><strong>administratorId</strong></dt>
+ <dd>user's name. Allow an user to access to the <a href="https://tools.ietf.org/html/rfc4616#section-2">impersonation command</a>, acting on the behalf of any user.</dd>
+ </dl>
+
</subsection>
-
+
<subsection name="JPA Users Repository">
-
+
<p>JPA (database via OpenJPA) based user repository. This is the default implementation.</p>
-
+
<p>The usersrepository tag as 2 attributes: name="LocalUsers" and class="org.apache.james.user.file.UsersFileRepository">
The class tag should be specified for Spring, but is not taken into acount by Guice.</p>
@@ -54,12 +67,12 @@
</subsection>
<subsection name="File Users Repository">
-
+
<p>The File UsersRepository implementations below are DEPRECATED and will get removed in the next release</p>
<p>It just listed here for backward-compatibility</p>
<p>File-based user repositories Use these configurations to store user info in the filesystem.</p>
-
+
<p>The usersrepository tag as 2 attributes:name="LocalUsers" class="org.apache.james.user.file.UsersFileRepository"></p>
<dl>
@@ -78,20 +91,20 @@
</subsection>
<subsection name="JDBC Users Repository">
-
+
<p>The JDBC UsersRepository implementations below are DEPRECATED and will get removed in the next release.</p>
<p>It just listed here for backward-compatibility.</p>
</subsection>
<subsection name="LDAP Users Repository">
-
+
<p>Read-Only LDAP based UsersRepository</p>
-
+
<p>Example:</p>
<source>
-<repository name="LocalUsers" class="org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository" ldapHost="ldap://myldapserver:389"
+<repository name="LocalUsers" class="org.apache.james.user.ldap.ReadOnlyUsersLDAPRepository" ldapHost="ldap://myldapserver:389"
principal="uid=ldapUser,ou=system" credentials="password" userBase="ou=People,o=myorg.com,ou=system" userIdAttribute="uid"/></source>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org