From 21b373c0bc90952c8f7d244785b975109d52e0f5 Mon Sep 17 00:00:00 2001 From: Artem Sidorkin Date: Tue, 17 Apr 2018 20:02:02 +0300 Subject: [PATCH] #9: Enhancing the Eventuate Java Client According GDPR. Fixing decription. --- .../javaclient/commonimpl/EventuateAggregateStoreImpl.java | 2 +- .../javaclient/commonimpl/sync/EventuateAggregateStoreImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/EventuateAggregateStoreImpl.java b/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/EventuateAggregateStoreImpl.java index 2286007..9e62a7c 100644 --- a/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/EventuateAggregateStoreImpl.java +++ b/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/EventuateAggregateStoreImpl.java @@ -124,7 +124,7 @@ public > CompletableFuture> find(Cl .map(event -> AggregateCrudMapping.toEventWithMetadata(event, json -> findOptions .flatMap(FindOptions::getEncryptionKey) - .map(k -> eventDataEncryptor.decrypt(k, json)) + .map(k -> EncryptedEventData.isEventDataStringEncrypted(json) ? eventDataEncryptor.decrypt(k, json) : json) .orElse(json))) .collect(Collectors.toList()); diff --git a/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/sync/EventuateAggregateStoreImpl.java b/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/sync/EventuateAggregateStoreImpl.java index d3bfbb6..1a6efa6 100644 --- a/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/sync/EventuateAggregateStoreImpl.java +++ b/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/sync/EventuateAggregateStoreImpl.java @@ -109,7 +109,7 @@ public > EntityWithMetadata find(Class clasz, Strin .map(event -> AggregateCrudMapping.toEventWithMetadata(event, json -> findOptions .flatMap(FindOptions::getEncryptionKey) - .map(k -> eventDataEncryptor.decrypt(k, json)) + .map(k -> EncryptedEventData.isEventDataStringEncrypted(json) ? eventDataEncryptor.decrypt(k, json) : json) .orElse(json))) .collect(Collectors.toList()); List events = eventsWithIds.stream().map(EventWithMetadata::getEvent).collect(Collectors.toList());