From a12d4d8a0238fb8f64b0e41ff3986fe73ce7f2f3 Mon Sep 17 00:00:00 2001 From: psp Date: Wed, 26 Aug 2020 16:39:22 +0200 Subject: [PATCH 01/14] Start next iteration with 1.0.3-SNAPSHOT --- datasafe-business/pom.xml | 2 +- datasafe-cli/pom.xml | 2 +- datasafe-directory/datasafe-directory-api/pom.xml | 2 +- datasafe-directory/datasafe-directory-impl/pom.xml | 2 +- datasafe-directory/pom.xml | 2 +- datasafe-encryption/datasafe-encryption-api/pom.xml | 2 +- datasafe-encryption/datasafe-encryption-impl/pom.xml | 2 +- datasafe-encryption/pom.xml | 2 +- datasafe-examples/datasafe-examples-business/pom.xml | 2 +- datasafe-examples/datasafe-examples-customize-dagger/pom.xml | 2 +- datasafe-examples/datasafe-examples-multidfs/pom.xml | 2 +- datasafe-examples/datasafe-examples-versioned-s3/pom.xml | 2 +- datasafe-examples/pom.xml | 2 +- datasafe-inbox/datasafe-inbox-api/pom.xml | 2 +- datasafe-inbox/datasafe-inbox-impl/pom.xml | 2 +- datasafe-inbox/pom.xml | 2 +- .../datasafe-business-tests-random-actions/pom.xml | 2 +- datasafe-long-run-tests/pom.xml | 2 +- datasafe-metainfo/datasafe-metainfo-version-api/pom.xml | 2 +- datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml | 2 +- datasafe-metainfo/pom.xml | 2 +- datasafe-privatestore/datasafe-privatestore-api/pom.xml | 2 +- datasafe-privatestore/datasafe-privatestore-impl/pom.xml | 2 +- datasafe-privatestore/pom.xml | 2 +- datasafe-rest-impl/pom.xml | 4 ++-- datasafe-runtime-delegate/pom.xml | 2 +- datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml | 2 +- datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml | 2 +- .../datasafe-simple-adapter-spring/pom.xml | 2 +- datasafe-simple-adapter/pom.xml | 2 +- datasafe-storage/datasafe-storage-api/pom.xml | 2 +- datasafe-storage/datasafe-storage-impl-db/pom.xml | 2 +- datasafe-storage/datasafe-storage-impl-fs/pom.xml | 2 +- datasafe-storage/datasafe-storage-impl-s3/pom.xml | 2 +- datasafe-storage/pom.xml | 2 +- datasafe-test-storages/pom.xml | 2 +- datasafe-types-api/pom.xml | 2 +- last-module-codecoverage-check/pom.xml | 2 +- pom.xml | 2 +- 39 files changed, 40 insertions(+), 40 deletions(-) diff --git a/datasafe-business/pom.xml b/datasafe-business/pom.xml index acb14c0d9..773286a1f 100644 --- a/datasafe-business/pom.xml +++ b/datasafe-business/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-cli/pom.xml b/datasafe-cli/pom.xml index 3e71a6b5a..4d635ece6 100644 --- a/datasafe-cli/pom.xml +++ b/datasafe-cli/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe - 1.0.2 + 1.0.3-SNAPSHOT datasafe-cli diff --git a/datasafe-directory/datasafe-directory-api/pom.xml b/datasafe-directory/datasafe-directory-api/pom.xml index 4d36056ca..6763e7968 100644 --- a/datasafe-directory/datasafe-directory-api/pom.xml +++ b/datasafe-directory/datasafe-directory-api/pom.xml @@ -3,7 +3,7 @@ de.adorsys datasafe-directory - 1.0.2 + 1.0.3-SNAPSHOT datasafe-directory-api diff --git a/datasafe-directory/datasafe-directory-impl/pom.xml b/datasafe-directory/datasafe-directory-impl/pom.xml index 6de81289d..11acf4957 100644 --- a/datasafe-directory/datasafe-directory-impl/pom.xml +++ b/datasafe-directory/datasafe-directory-impl/pom.xml @@ -3,7 +3,7 @@ de.adorsys datasafe-directory - 1.0.2 + 1.0.3-SNAPSHOT datasafe-directory-impl diff --git a/datasafe-directory/pom.xml b/datasafe-directory/pom.xml index ac8af4f64..688a8094f 100644 --- a/datasafe-directory/pom.xml +++ b/datasafe-directory/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-encryption/datasafe-encryption-api/pom.xml b/datasafe-encryption/datasafe-encryption-api/pom.xml index 433d8b809..f24d2a6f1 100644 --- a/datasafe-encryption/datasafe-encryption-api/pom.xml +++ b/datasafe-encryption/datasafe-encryption-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-encryption - 1.0.2 + 1.0.3-SNAPSHOT datasafe-encryption-api diff --git a/datasafe-encryption/datasafe-encryption-impl/pom.xml b/datasafe-encryption/datasafe-encryption-impl/pom.xml index 9f0d6ad94..803bddc8a 100644 --- a/datasafe-encryption/datasafe-encryption-impl/pom.xml +++ b/datasafe-encryption/datasafe-encryption-impl/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-encryption - 1.0.2 + 1.0.3-SNAPSHOT datasafe-encryption-impl diff --git a/datasafe-encryption/pom.xml b/datasafe-encryption/pom.xml index c3bdbc721..2911707c3 100644 --- a/datasafe-encryption/pom.xml +++ b/datasafe-encryption/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-examples/datasafe-examples-business/pom.xml b/datasafe-examples/datasafe-examples-business/pom.xml index 58d8670ac..75c533f0b 100644 --- a/datasafe-examples/datasafe-examples-business/pom.xml +++ b/datasafe-examples/datasafe-examples-business/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.2 + 1.0.3-SNAPSHOT datasafe-examples-business diff --git a/datasafe-examples/datasafe-examples-customize-dagger/pom.xml b/datasafe-examples/datasafe-examples-customize-dagger/pom.xml index 6521c03b3..9ff9560b0 100644 --- a/datasafe-examples/datasafe-examples-customize-dagger/pom.xml +++ b/datasafe-examples/datasafe-examples-customize-dagger/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.2 + 1.0.3-SNAPSHOT datasafe-examples-customize-dagger diff --git a/datasafe-examples/datasafe-examples-multidfs/pom.xml b/datasafe-examples/datasafe-examples-multidfs/pom.xml index 89f8ef439..14a0c5fbc 100644 --- a/datasafe-examples/datasafe-examples-multidfs/pom.xml +++ b/datasafe-examples/datasafe-examples-multidfs/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.2 + 1.0.3-SNAPSHOT datasafe-examples-multidfs diff --git a/datasafe-examples/datasafe-examples-versioned-s3/pom.xml b/datasafe-examples/datasafe-examples-versioned-s3/pom.xml index 6883e6d8a..8c557bed9 100644 --- a/datasafe-examples/datasafe-examples-versioned-s3/pom.xml +++ b/datasafe-examples/datasafe-examples-versioned-s3/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.2 + 1.0.3-SNAPSHOT datasafe-examples-versioned-s3 diff --git a/datasafe-examples/pom.xml b/datasafe-examples/pom.xml index ba407f23f..39bee01a9 100644 --- a/datasafe-examples/pom.xml +++ b/datasafe-examples/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-inbox/datasafe-inbox-api/pom.xml b/datasafe-inbox/datasafe-inbox-api/pom.xml index b05dfb9c1..28b06561b 100644 --- a/datasafe-inbox/datasafe-inbox-api/pom.xml +++ b/datasafe-inbox/datasafe-inbox-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-inbox - 1.0.2 + 1.0.3-SNAPSHOT datasafe-inbox-api diff --git a/datasafe-inbox/datasafe-inbox-impl/pom.xml b/datasafe-inbox/datasafe-inbox-impl/pom.xml index 47d229a33..f6d5d20e2 100644 --- a/datasafe-inbox/datasafe-inbox-impl/pom.xml +++ b/datasafe-inbox/datasafe-inbox-impl/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-inbox - 1.0.2 + 1.0.3-SNAPSHOT datasafe-inbox-impl diff --git a/datasafe-inbox/pom.xml b/datasafe-inbox/pom.xml index 374a44ece..554634509 100644 --- a/datasafe-inbox/pom.xml +++ b/datasafe-inbox/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml b/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml index 2cfce0f6c..9d196ea14 100644 --- a/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml +++ b/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml @@ -5,7 +5,7 @@ datasafe-long-run-tests de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-long-run-tests/pom.xml b/datasafe-long-run-tests/pom.xml index 3d3cbb97d..fa35d6242 100644 --- a/datasafe-long-run-tests/pom.xml +++ b/datasafe-long-run-tests/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml b/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml index 60569a002..3ede9440b 100644 --- a/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml +++ b/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-metainfo - 1.0.2 + 1.0.3-SNAPSHOT datasafe-metainfo-version-api diff --git a/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml b/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml index ab33ffdcf..2a175a57c 100644 --- a/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml +++ b/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-metainfo - 1.0.2 + 1.0.3-SNAPSHOT datasafe-metainfo-version-impl diff --git a/datasafe-metainfo/pom.xml b/datasafe-metainfo/pom.xml index 1e3275b01..cb8fecb8f 100644 --- a/datasafe-metainfo/pom.xml +++ b/datasafe-metainfo/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-privatestore/datasafe-privatestore-api/pom.xml b/datasafe-privatestore/datasafe-privatestore-api/pom.xml index aad91e461..56e89b5a0 100644 --- a/datasafe-privatestore/datasafe-privatestore-api/pom.xml +++ b/datasafe-privatestore/datasafe-privatestore-api/pom.xml @@ -5,7 +5,7 @@ datasafe-privatestore de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-privatestore/datasafe-privatestore-impl/pom.xml b/datasafe-privatestore/datasafe-privatestore-impl/pom.xml index 48a13725b..970c4b6b8 100644 --- a/datasafe-privatestore/datasafe-privatestore-impl/pom.xml +++ b/datasafe-privatestore/datasafe-privatestore-impl/pom.xml @@ -5,7 +5,7 @@ datasafe-privatestore de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-privatestore/pom.xml b/datasafe-privatestore/pom.xml index 8f5a34949..ebcb4a5f0 100644 --- a/datasafe-privatestore/pom.xml +++ b/datasafe-privatestore/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-rest-impl/pom.xml b/datasafe-rest-impl/pom.xml index 6420f45ac..e8d91c9c1 100644 --- a/datasafe-rest-impl/pom.xml +++ b/datasafe-rest-impl/pom.xml @@ -5,11 +5,11 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT datasafe-rest-impl - 1.0.2 + 1.0.3-SNAPSHOT datasafe-rest-impl Spring Boot DataSafe Application diff --git a/datasafe-runtime-delegate/pom.xml b/datasafe-runtime-delegate/pom.xml index 1c08a6da8..27976233e 100644 --- a/datasafe-runtime-delegate/pom.xml +++ b/datasafe-runtime-delegate/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe - 1.0.2 + 1.0.3-SNAPSHOT datasafe-runtime-delegate diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml index a92fdfa55..9941d7d11 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml @@ -5,7 +5,7 @@ datasafe-simple-adapter de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml index fea2e5d95..51f77a406 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml @@ -5,7 +5,7 @@ datasafe-simple-adapter de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml index c5ee50540..3cb8c6321 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml @@ -5,7 +5,7 @@ datasafe-simple-adapter de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-simple-adapter/pom.xml b/datasafe-simple-adapter/pom.xml index f369e4442..554b6c07d 100644 --- a/datasafe-simple-adapter/pom.xml +++ b/datasafe-simple-adapter/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-storage/datasafe-storage-api/pom.xml b/datasafe-storage/datasafe-storage-api/pom.xml index 6cfcaa797..2622ecfd0 100644 --- a/datasafe-storage/datasafe-storage-api/pom.xml +++ b/datasafe-storage/datasafe-storage-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-storage - 1.0.2 + 1.0.3-SNAPSHOT datasafe-storage-api diff --git a/datasafe-storage/datasafe-storage-impl-db/pom.xml b/datasafe-storage/datasafe-storage-impl-db/pom.xml index 15be46d3b..ec41daabd 100644 --- a/datasafe-storage/datasafe-storage-impl-db/pom.xml +++ b/datasafe-storage/datasafe-storage-impl-db/pom.xml @@ -5,7 +5,7 @@ datasafe-storage de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-storage/datasafe-storage-impl-fs/pom.xml b/datasafe-storage/datasafe-storage-impl-fs/pom.xml index 4a6aa87e5..94374c7da 100644 --- a/datasafe-storage/datasafe-storage-impl-fs/pom.xml +++ b/datasafe-storage/datasafe-storage-impl-fs/pom.xml @@ -5,7 +5,7 @@ datasafe-storage de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-storage/datasafe-storage-impl-s3/pom.xml b/datasafe-storage/datasafe-storage-impl-s3/pom.xml index 60aac2193..4048133ce 100644 --- a/datasafe-storage/datasafe-storage-impl-s3/pom.xml +++ b/datasafe-storage/datasafe-storage-impl-s3/pom.xml @@ -5,7 +5,7 @@ datasafe-storage de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-storage/pom.xml b/datasafe-storage/pom.xml index 2407de696..845bda442 100644 --- a/datasafe-storage/pom.xml +++ b/datasafe-storage/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-test-storages/pom.xml b/datasafe-test-storages/pom.xml index 3b03e5f98..0fd474866 100644 --- a/datasafe-test-storages/pom.xml +++ b/datasafe-test-storages/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/datasafe-types-api/pom.xml b/datasafe-types-api/pom.xml index 75bb351c9..b7ffeb221 100644 --- a/datasafe-types-api/pom.xml +++ b/datasafe-types-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe - 1.0.2 + 1.0.3-SNAPSHOT datasafe-types-api diff --git a/last-module-codecoverage-check/pom.xml b/last-module-codecoverage-check/pom.xml index 48c34712b..55037c179 100644 --- a/last-module-codecoverage-check/pom.xml +++ b/last-module-codecoverage-check/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.2 + 1.0.3-SNAPSHOT 4.0.0 diff --git a/pom.xml b/pom.xml index 40144294f..b8387c553 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ de.adorsys datasafe - 1.0.2 + 1.0.3-SNAPSHOT datasafe Datasafe https://github.com/adorsys/datasafe From 40aeb54efebd35dd5ee58bb1fe4c5caa9d621175 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 3 Sep 2020 01:59:54 +0200 Subject: [PATCH 02/14] OBG 175 set path encryption during creation of simple datasafe service --- ...domActionsOnSimpleDatasafeAdapterTest.java | 3 +- .../impl/SimpleDatasafeServiceImpl.java | 23 +++++++++++--- .../impl/SwitchableDatasafeServices.java | 4 +-- .../impl/config/PathEncryptionConfig.java | 8 +++++ .../SwitchablePathEncryptionImpl.java | 31 +++++-------------- .../simple/adapter/impl/CleanupDbTest.java | 4 ++- .../impl/DFSRelativeToRootProfileTest.java | 4 ++- .../impl/SimpleAdapterFeatureTest.java | 9 +++--- .../impl/SimpleDatasafeAdapterTest.java | 3 +- .../SpringSimpleDatasafeServiceFactory.java | 7 +++-- 10 files changed, 56 insertions(+), 40 deletions(-) create mode 100644 datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java diff --git a/datasafe-long-run-tests/datasafe-business-tests-random-actions/src/test/java/de/adorsys/datasafe/business/impl/e2e/randomactions/RandomActionsOnSimpleDatasafeAdapterTest.java b/datasafe-long-run-tests/datasafe-business-tests-random-actions/src/test/java/de/adorsys/datasafe/business/impl/e2e/randomactions/RandomActionsOnSimpleDatasafeAdapterTest.java index 8855bb729..3cc92af44 100644 --- a/datasafe-long-run-tests/datasafe-business-tests-random-actions/src/test/java/de/adorsys/datasafe/business/impl/e2e/randomactions/RandomActionsOnSimpleDatasafeAdapterTest.java +++ b/datasafe-long-run-tests/datasafe-business-tests-random-actions/src/test/java/de/adorsys/datasafe/business/impl/e2e/randomactions/RandomActionsOnSimpleDatasafeAdapterTest.java @@ -29,6 +29,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.ListRecursiveFlag; import de.adorsys.datasafe.simple.adapter.impl.DFSTestCredentialsFactory; import de.adorsys.datasafe.simple.adapter.impl.SimpleDatasafeServiceImpl; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.types.api.actions.ListRequest; import de.adorsys.datasafe.types.api.actions.ReadRequest; import de.adorsys.datasafe.types.api.actions.RemoveRequest; @@ -89,7 +90,7 @@ void testRandomActionsParallelThreads(StorageDescriptor descriptor, int threadCo private DefaultDatasafeServices datasafeServicesFromSimpleDatasafeAdapter(StorageDescriptor descriptor) { SimpleDatasafeService datasafeService = new SimpleDatasafeServiceImpl( - DFSTestCredentialsFactory.credentials(descriptor), new MutableEncryptionConfig() + DFSTestCredentialsFactory.credentials(descriptor), new MutableEncryptionConfig(), new PathEncryptionConfig(true) ); return new DefaultDatasafeServices() { diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index d19737f58..81f2d07a9 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -14,6 +14,7 @@ import de.adorsys.datasafe.encrypiton.api.types.UserID; import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth; import de.adorsys.datasafe.encrypiton.api.types.encryption.MutableEncryptionConfig; +import de.adorsys.datasafe.encrypiton.impl.pathencryption.PathEncryptionImplRuntimeDelegatable; import de.adorsys.datasafe.simple.adapter.api.SimpleDatasafeService; import de.adorsys.datasafe.simple.adapter.api.exceptions.SimpleAdapterException; import de.adorsys.datasafe.simple.adapter.api.types.AmazonS3DFSCredentials; @@ -26,6 +27,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.api.types.ListRecursiveFlag; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.simple.adapter.impl.pathencryption.SwitchablePathEncryptionImpl; import de.adorsys.datasafe.storage.api.StorageService; import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService; @@ -34,6 +36,7 @@ import de.adorsys.datasafe.types.api.actions.ReadRequest; import de.adorsys.datasafe.types.api.actions.RemoveRequest; import de.adorsys.datasafe.types.api.actions.WriteRequest; +import de.adorsys.datasafe.types.api.context.BaseOverridesRegistry; import de.adorsys.datasafe.types.api.resource.AbsoluteLocationWithCapability; import de.adorsys.datasafe.types.api.resource.BasePrivateResource; import de.adorsys.datasafe.types.api.resource.PrivateResource; @@ -62,11 +65,15 @@ public class SimpleDatasafeServiceImpl implements SimpleDatasafeService { private SystemRootAndStorageService rootAndStorage; private DefaultDatasafeServices customlyBuiltDatasafeServices; + public SimpleDatasafeServiceImpl(PathEncryptionConfig pathEncryptionConfig) { + this(DFSCredentialsFactory.getFromEnvironmnet(), new MutableEncryptionConfig(), pathEncryptionConfig); + } + public SimpleDatasafeServiceImpl() { - this(DFSCredentialsFactory.getFromEnvironmnet(), new MutableEncryptionConfig()); + this(DFSCredentialsFactory.getFromEnvironmnet(), new MutableEncryptionConfig(), new PathEncryptionConfig(true)); } - public SimpleDatasafeServiceImpl(DFSCredentials dfsCredentials, MutableEncryptionConfig config) { + public SimpleDatasafeServiceImpl(DFSCredentials dfsCredentials, MutableEncryptionConfig config, PathEncryptionConfig pathEncryptionConfig) { if (dfsCredentials instanceof FilesystemDFSCredentials) { this.rootAndStorage = useFileSystem((FilesystemDFSCredentials) dfsCredentials); @@ -75,10 +82,18 @@ public SimpleDatasafeServiceImpl(DFSCredentials dfsCredentials, MutableEncryptio this.rootAndStorage = useAmazonS3((AmazonS3DFSCredentials) dfsCredentials); } + BaseOverridesRegistry baseOverridesRegistry = new BaseOverridesRegistry(); + PathEncryptionImplRuntimeDelegatable.overrideWith(baseOverridesRegistry, args -> + new SwitchablePathEncryptionImpl( + pathEncryptionConfig.withPathEncryption, + args.getSymmetricPathEncryptionService(), + args.getPrivateKeyService())); + customlyBuiltDatasafeServices = DaggerSwitchableDatasafeServices.builder() .config(new DefaultDFSConfig(rootAndStorage.getSystemRoot(), universalReadStorePassword)) .encryption(config.toEncryptionConfig()) .storage(getStorageService()) + .overridesRegistry(baseOverridesRegistry) .build(); } @@ -212,7 +227,7 @@ private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials df lsf.add("root bucket : " + amazonS3DFSCredentials.getRootBucket()); lsf.add("url : " + amazonS3DFSCredentials.getUrl()); lsf.add("region : " + amazonS3DFSCredentials.getRegion()); - lsf.add("path encryption : " + SwitchablePathEncryptionImpl.checkIsPathEncryptionToUse()); + lsf.add("path encryption : " + "hallo peter affe"); lsf.add("no https : " + amazonS3DFSCredentials.isNoHttps()); lsf.add("threadpool size : " + amazonS3DFSCredentials.getThreadPoolSize()); int maxConnections = amazonS3DFSCredentials.getMaxConnections(); @@ -293,7 +308,7 @@ private static SystemRootAndStorageService useFileSystem(FilesystemDFSCredential LogStringFrame lsf = new LogStringFrame(); lsf.add("FILESYSTEM"); lsf.add("root bucket : " + filesystemDFSCredentials.getRoot()); - lsf.add("path encryption : " + SwitchablePathEncryptionImpl.checkIsPathEncryptionToUse()); + lsf.add("path encryption : " + "hallo peter affe"); log.info(lsf.toString()); URI systemRoot = FileSystems.getDefault().getPath(filesystemDFSCredentials.getRoot()).toAbsolutePath().toUri(); StorageService storageService = new FileSystemStorageService(FileSystems.getDefault().getPath(filesystemDFSCredentials.getRoot())); diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java index c4a399a68..7c8d420d8 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java @@ -6,6 +6,7 @@ import de.adorsys.datasafe.business.impl.document.DefaultDocumentModule; import de.adorsys.datasafe.business.impl.inbox.actions.DefaultInboxActionsModule; import de.adorsys.datasafe.business.impl.keystore.DefaultKeyStoreModule; +import de.adorsys.datasafe.business.impl.pathencryption.DefaultPathEncryptionModule; import de.adorsys.datasafe.business.impl.privatestore.actions.DefaultPrivateActionsModule; import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices; import de.adorsys.datasafe.business.impl.storage.DefaultStorageModule; @@ -26,7 +27,7 @@ DefaultKeyStoreModule.class, DefaultDocumentModule.class, SwitchableCMSEncryptionModule.class, - SwitchablePathEncryptionModule.class, + DefaultPathEncryptionModule.class, DefaultInboxActionsModule.class, DefaultPrivateActionsModule.class, HardcodedProfileModule.class, @@ -61,7 +62,6 @@ interface Builder { @BindsInstance Builder encryption(@Nullable EncryptionConfig encryptionConfig); - /** * @return Provide NEW instance of Legacy Datasafe services. All dependencies except * annotated with {@code @Singleton} will have scope analogous to Spring {code @Prototype}. diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java new file mode 100644 index 000000000..955a68de7 --- /dev/null +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java @@ -0,0 +1,8 @@ +package de.adorsys.datasafe.simple.adapter.impl.config; + +public class PathEncryptionConfig { + public PathEncryptionConfig(Boolean withPathEncryption) { + this.withPathEncryption = withPathEncryption; + } + public Boolean withPathEncryption; +} diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java index b354d6f0c..63ceec88a 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java @@ -13,21 +13,24 @@ @Slf4j public class SwitchablePathEncryptionImpl extends PathEncryptionImpl { - public static final String NO_BUCKETPATH_ENCRYPTION = "SC-NO-BUCKETPATH-ENCRYPTION"; - - private boolean withPathEncryption = checkIsPathEncryptionToUse(); + private boolean withPathEncryption; @Inject - public SwitchablePathEncryptionImpl(SymmetricPathEncryptionService symmetricPathEncryptionService, - PrivateKeyService privateKeyService) { + public SwitchablePathEncryptionImpl( + Boolean withPathEncryption, + SymmetricPathEncryptionService symmetricPathEncryptionService, + PrivateKeyService privateKeyService) { super(symmetricPathEncryptionService, privateKeyService); + this.withPathEncryption = withPathEncryption; } @Override public Uri encrypt(UserIDAuth forUser, Uri path) { if (withPathEncryption) { + log.info("WITH PATH ENCRYPTION TRUE"); return super.encrypt(forUser, path); } + log.info("WITH PATH ENCRYPTION FALSE"); return path; } @@ -38,22 +41,4 @@ public Function decryptor(UserIDAuth forUser) { } return Function.identity(); } - - public static boolean checkIsPathEncryptionToUse() { - String value = System.getProperty(NO_BUCKETPATH_ENCRYPTION); - if (value != null) { - if (value.equalsIgnoreCase(Boolean.FALSE.toString())) { - log.debug("path encryption is on"); - return true; - } - if (value.equalsIgnoreCase(Boolean.TRUE.toString())) { - log.debug("path encryption is off"); - return false; - } - throw new RuntimeException("value " + value + " for " + NO_BUCKETPATH_ENCRYPTION + " is unknown"); - } - log.debug("path encryption is on"); - return true; - } - } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/CleanupDbTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/CleanupDbTest.java index 5ffcf8762..45cce5494 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/CleanupDbTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/CleanupDbTest.java @@ -7,6 +7,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DSDocument; import de.adorsys.datasafe.simple.adapter.api.types.DocumentContent; import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.teststorage.WithStorageProvider; import de.adorsys.datasafe.types.api.resource.AbsoluteLocation; import de.adorsys.datasafe.types.api.resource.BasePrivateResource; @@ -23,11 +24,12 @@ class CleanupDbTest extends WithStorageProvider { private SimpleDatasafeService simpleDatasafeService; private DFSCredentials dfsCredentials; + private PathEncryptionConfig pathEncryptionConfig = new PathEncryptionConfig(true); private void createSimpleService(WithStorageProvider.StorageDescriptor descriptor) { dfsCredentials = InitFromStorageProvider.dfsFromDescriptor(descriptor); if (dfsCredentials != null) { - simpleDatasafeService = new SimpleDatasafeServiceImpl(dfsCredentials, new MutableEncryptionConfig()); + simpleDatasafeService = new SimpleDatasafeServiceImpl(dfsCredentials, new MutableEncryptionConfig(), pathEncryptionConfig); } else { simpleDatasafeService = new SimpleDatasafeServiceImpl(); } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/DFSRelativeToRootProfileTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/DFSRelativeToRootProfileTest.java index a9d0043c0..4833e6bcd 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/DFSRelativeToRootProfileTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/DFSRelativeToRootProfileTest.java @@ -8,6 +8,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DSDocument; import de.adorsys.datasafe.simple.adapter.api.types.DocumentContent; import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.teststorage.WithStorageProvider; import de.adorsys.datasafe.types.api.resource.AbsoluteLocation; import de.adorsys.datasafe.types.api.resource.BasePrivateResource; @@ -25,13 +26,14 @@ class DFSRelativeToRootProfileTest extends WithStorageProvider { private SimpleDatasafeService simpleDatasafeService; private UserIDAuth userIDAuth; + private PathEncryptionConfig pathEncryptionConfig = new PathEncryptionConfig(true); void createDatasafeAdapter(StorageDescriptor descriptor) { DFSCredentials credentials = InitFromStorageProvider.dfsFromDescriptor(descriptor); simpleDatasafeService = null != credentials ? - new SimpleDatasafeServiceImpl(credentials, new MutableEncryptionConfig()) + new SimpleDatasafeServiceImpl(credentials, new MutableEncryptionConfig(), pathEncryptionConfig) : new SimpleDatasafeServiceImpl(); userIDAuth = new UserIDAuth(new UserID("peter"), ReadKeyPasswordTestFactory.getForString("password")); diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java index 6c3675bd4..bc8d7cddf 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java @@ -1,5 +1,6 @@ package de.adorsys.datasafe.simple.adapter.impl; +import de.adorsys.datasafe.encrypiton.api.pathencryption.PathEncryption; import de.adorsys.datasafe.encrypiton.api.types.UserID; import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth; import de.adorsys.datasafe.simple.adapter.api.types.AmazonS3DFSCredentials; @@ -10,6 +11,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.impl.cmsencryption.SwitchableCmsEncryptionImpl; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.simple.adapter.impl.pathencryption.SwitchablePathEncryptionImpl; import de.adorsys.datasafe.types.api.resource.AbsoluteLocation; import de.adorsys.datasafe.types.api.resource.BasePrivateResource; @@ -48,7 +50,6 @@ class SimpleAdapterFeatureTest extends BaseMockitoTest { @BeforeEach @AfterEach void afterEach() { - System.setProperty(SwitchablePathEncryptionImpl.NO_BUCKETPATH_ENCRYPTION, Boolean.FALSE.toString()); System.setProperty(SwitchableCmsEncryptionImpl.NO_CMSENCRYPTION_AT_ALL, Boolean.FALSE.toString()); } @@ -69,8 +70,7 @@ void testWithEncryption() { @Test @SneakyThrows void testWithoutPathEncryption() { - System.setProperty(SwitchablePathEncryptionImpl.NO_BUCKETPATH_ENCRYPTION, Boolean.TRUE.toString()); - SimpleDatasafeServiceImpl simpleDatasafeService = new SimpleDatasafeServiceImpl(); + SimpleDatasafeServiceImpl simpleDatasafeService = new SimpleDatasafeServiceImpl(new PathEncryptionConfig(false)); simpleDatasafeService.createUser(userIDAuth); simpleDatasafeService.storeDocument(userIDAuth, document); @@ -94,9 +94,8 @@ void testWithoutPathEncryption() { @Test @SneakyThrows void testWithoutEncryption() { - System.setProperty(SwitchablePathEncryptionImpl.NO_BUCKETPATH_ENCRYPTION, Boolean.TRUE.toString()); System.setProperty(SwitchableCmsEncryptionImpl.NO_CMSENCRYPTION_AT_ALL, Boolean.TRUE.toString()); - SimpleDatasafeServiceImpl simpleDatasafeService = new SimpleDatasafeServiceImpl(); + SimpleDatasafeServiceImpl simpleDatasafeService = new SimpleDatasafeServiceImpl(new PathEncryptionConfig(false)); simpleDatasafeService.createUser(userIDAuth); simpleDatasafeService.storeDocument(userIDAuth, document); diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeAdapterTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeAdapterTest.java index 22ccd5069..a7ce59715 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeAdapterTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeAdapterTest.java @@ -14,6 +14,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DocumentDirectoryFQN; import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; import de.adorsys.datasafe.simple.adapter.api.types.ListRecursiveFlag; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService; import de.adorsys.datasafe.teststorage.WithStorageProvider; import de.adorsys.datasafe.types.api.resource.AbsoluteLocation; @@ -62,7 +63,7 @@ private static Stream storages() { void mystart() { if (dfsCredentials != null) { - simpleDatasafeService = new SimpleDatasafeServiceImpl(dfsCredentials, new MutableEncryptionConfig()); + simpleDatasafeService = new SimpleDatasafeServiceImpl(dfsCredentials, new MutableEncryptionConfig(), new PathEncryptionConfig(true)); } else { simpleDatasafeService = new SimpleDatasafeServiceImpl(); } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java index aa250b0b4..8f2ec8a61 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java @@ -7,6 +7,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DFSCredentials; import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.impl.SimpleDatasafeServiceImpl; +import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDatasafeEncryptionProperties; import org.springframework.beans.factory.annotation.Autowired; @@ -53,7 +54,8 @@ public SimpleDatasafeService getSimpleDataSafeServiceWithSubdir(String subdirBel amazonS3DFSCredentials.toBuilder().rootBucket( amazonS3DFSCredentials.getRootBucket() + "/" + subdirBelowRoot ).build(), - null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig() + null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig(), + new PathEncryptionConfig(true) ); } if (dfsCredentials instanceof FilesystemDFSCredentials) { @@ -62,7 +64,8 @@ public SimpleDatasafeService getSimpleDataSafeServiceWithSubdir(String subdirBel filesystemDFSCredentials.toBuilder().root( filesystemDFSCredentials.getRoot() + "/" + subdirBelowRoot ).build(), - null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig() + null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig(), + new PathEncryptionConfig(true) ); } throw new SimpleAdapterException("missing switch for DFSCredentials" + dfsCredentials); From 73f2f468a6039608685d2936ca49143581fe7dab Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 3 Sep 2020 10:54:32 +0200 Subject: [PATCH 03/14] Encryption switch decided during construction --- .../impl/SimpleDatasafeServiceImpl.java | 26 ++++++++++--------- .../impl/SwitchableDatasafeServices.java | 1 - ...ionImpl.java => NoPathEncryptionImpl.java} | 16 ++---------- ...odule.java => NoPathEncryptionModule.java} | 4 +-- .../impl/SimpleAdapterFeatureTest.java | 2 -- 5 files changed, 18 insertions(+), 31 deletions(-) rename datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/{SwitchablePathEncryptionImpl.java => NoPathEncryptionImpl.java} (64%) rename datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/{SwitchablePathEncryptionModule.java => NoPathEncryptionModule.java} (92%) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index 81f2d07a9..24306cff2 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -28,7 +28,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.api.types.ListRecursiveFlag; import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; -import de.adorsys.datasafe.simple.adapter.impl.pathencryption.SwitchablePathEncryptionImpl; +import de.adorsys.datasafe.simple.adapter.impl.pathencryption.NoPathEncryptionImpl; import de.adorsys.datasafe.storage.api.StorageService; import de.adorsys.datasafe.storage.impl.fs.FileSystemStorageService; import de.adorsys.datasafe.storage.impl.s3.S3StorageService; @@ -82,19 +82,21 @@ public SimpleDatasafeServiceImpl(DFSCredentials dfsCredentials, MutableEncryptio this.rootAndStorage = useAmazonS3((AmazonS3DFSCredentials) dfsCredentials); } - BaseOverridesRegistry baseOverridesRegistry = new BaseOverridesRegistry(); - PathEncryptionImplRuntimeDelegatable.overrideWith(baseOverridesRegistry, args -> - new SwitchablePathEncryptionImpl( - pathEncryptionConfig.withPathEncryption, - args.getSymmetricPathEncryptionService(), - args.getPrivateKeyService())); - - customlyBuiltDatasafeServices = DaggerSwitchableDatasafeServices.builder() + SwitchableDatasafeServices.Builder switchableDatasafeService = DaggerSwitchableDatasafeServices.builder() .config(new DefaultDFSConfig(rootAndStorage.getSystemRoot(), universalReadStorePassword)) .encryption(config.toEncryptionConfig()) - .storage(getStorageService()) - .overridesRegistry(baseOverridesRegistry) - .build(); + .storage(getStorageService()); + + if (!pathEncryptionConfig.withPathEncryption) { + BaseOverridesRegistry baseOverridesRegistry = new BaseOverridesRegistry(); + PathEncryptionImplRuntimeDelegatable.overrideWith(baseOverridesRegistry, args -> + new NoPathEncryptionImpl( + args.getSymmetricPathEncryptionService(), + args.getPrivateKeyService())); + switchableDatasafeService.overridesRegistry(baseOverridesRegistry); + } + + customlyBuiltDatasafeServices = switchableDatasafeService.build(); } public StorageService getStorageService() { diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java index 7c8d420d8..97333bae2 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SwitchableDatasafeServices.java @@ -13,7 +13,6 @@ import de.adorsys.datasafe.directory.api.config.DFSConfig; import de.adorsys.datasafe.encrypiton.api.types.encryption.EncryptionConfig; import de.adorsys.datasafe.simple.adapter.impl.cmsencryption.SwitchableCMSEncryptionModule; -import de.adorsys.datasafe.simple.adapter.impl.pathencryption.SwitchablePathEncryptionModule; import de.adorsys.datasafe.simple.adapter.impl.profile.HardcodedProfileModule; import de.adorsys.datasafe.storage.api.StorageService; import de.adorsys.datasafe.types.api.context.overrides.OverridesRegistry; diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionImpl.java similarity index 64% rename from datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java rename to datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionImpl.java index 63ceec88a..68ded7dbc 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionImpl.java @@ -11,34 +11,22 @@ import java.util.function.Function; @Slf4j -public class SwitchablePathEncryptionImpl extends PathEncryptionImpl { - - private boolean withPathEncryption; +public class NoPathEncryptionImpl extends PathEncryptionImpl { @Inject - public SwitchablePathEncryptionImpl( - Boolean withPathEncryption, + public NoPathEncryptionImpl( SymmetricPathEncryptionService symmetricPathEncryptionService, PrivateKeyService privateKeyService) { super(symmetricPathEncryptionService, privateKeyService); - this.withPathEncryption = withPathEncryption; } @Override public Uri encrypt(UserIDAuth forUser, Uri path) { - if (withPathEncryption) { - log.info("WITH PATH ENCRYPTION TRUE"); - return super.encrypt(forUser, path); - } - log.info("WITH PATH ENCRYPTION FALSE"); return path; } @Override public Function decryptor(UserIDAuth forUser) { - if (withPathEncryption) { - return super.decryptor(forUser); - } return Function.identity(); } } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionModule.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java similarity index 92% rename from datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionModule.java rename to datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java index 95671bd9b..10465a3b5 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/SwitchablePathEncryptionModule.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java @@ -14,7 +14,7 @@ * This module is responsible for providing pathencryption of document. */ @Module -public abstract class SwitchablePathEncryptionModule { +public abstract class NoPathEncryptionModule { /** * SivMode using for encryption and decryption in AES CGM SIV mode * @return SivMode @@ -36,7 +36,7 @@ static SivMode sivMode() { * and pass path with key to {@link SymmetricPathEncryptionService} */ @Binds - abstract PathEncryption pathEncryption(SwitchablePathEncryptionImpl impl); + abstract PathEncryption pathEncryption(NoPathEncryptionImpl impl); /** * Default symmetric path encryption that encrypts URI segment-by-segment. diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java index bc8d7cddf..9d5d34527 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/test/java/de/adorsys/datasafe/simple/adapter/impl/SimpleAdapterFeatureTest.java @@ -1,6 +1,5 @@ package de.adorsys.datasafe.simple.adapter.impl; -import de.adorsys.datasafe.encrypiton.api.pathencryption.PathEncryption; import de.adorsys.datasafe.encrypiton.api.types.UserID; import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth; import de.adorsys.datasafe.simple.adapter.api.types.AmazonS3DFSCredentials; @@ -12,7 +11,6 @@ import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.impl.cmsencryption.SwitchableCmsEncryptionImpl; import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; -import de.adorsys.datasafe.simple.adapter.impl.pathencryption.SwitchablePathEncryptionImpl; import de.adorsys.datasafe.types.api.resource.AbsoluteLocation; import de.adorsys.datasafe.types.api.resource.BasePrivateResource; import de.adorsys.datasafe.types.api.resource.PrivateResource; From 8e36557b14c783f12ce93f133b81fdae31906fff Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 3 Sep 2020 11:48:06 +0200 Subject: [PATCH 04/14] DOC 175 pathEncryption can be configured with properties --- .../impl/SimpleDatasafeServiceImpl.java | 12 +++++------ .../SpringSimpleDatasafeServiceFactory.java | 20 +++++++++---------- ...pringAmazonS3DFSCredentialsProperties.java | 1 + .../SpringDatasafeEncryptionProperties.java | 3 +++ ...ingFilesystemDFSCredentialsProperties.java | 1 + 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index 24306cff2..67e286cbb 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -76,10 +76,10 @@ public SimpleDatasafeServiceImpl() { public SimpleDatasafeServiceImpl(DFSCredentials dfsCredentials, MutableEncryptionConfig config, PathEncryptionConfig pathEncryptionConfig) { if (dfsCredentials instanceof FilesystemDFSCredentials) { - this.rootAndStorage = useFileSystem((FilesystemDFSCredentials) dfsCredentials); + this.rootAndStorage = useFileSystem((FilesystemDFSCredentials) dfsCredentials, pathEncryptionConfig); } if (dfsCredentials instanceof AmazonS3DFSCredentials) { - this.rootAndStorage = useAmazonS3((AmazonS3DFSCredentials) dfsCredentials); + this.rootAndStorage = useAmazonS3((AmazonS3DFSCredentials) dfsCredentials, pathEncryptionConfig); } SwitchableDatasafeServices.Builder switchableDatasafeService = DaggerSwitchableDatasafeServices.builder() @@ -222,14 +222,14 @@ public void cleanupDb() { } - private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials dfsCredentials) { + private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials dfsCredentials, PathEncryptionConfig pathEncryptionConfig) { AmazonS3DFSCredentials amazonS3DFSCredentials = dfsCredentials; LogStringFrame lsf = new LogStringFrame(); lsf.add("AMAZON S3"); lsf.add("root bucket : " + amazonS3DFSCredentials.getRootBucket()); lsf.add("url : " + amazonS3DFSCredentials.getUrl()); lsf.add("region : " + amazonS3DFSCredentials.getRegion()); - lsf.add("path encryption : " + "hallo peter affe"); + lsf.add("path encryption : " + pathEncryptionConfig.withPathEncryption); lsf.add("no https : " + amazonS3DFSCredentials.isNoHttps()); lsf.add("threadpool size : " + amazonS3DFSCredentials.getThreadPoolSize()); int maxConnections = amazonS3DFSCredentials.getMaxConnections(); @@ -305,12 +305,12 @@ private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials df return new SystemRootAndStorageService(systemRoot, storageService); } - private static SystemRootAndStorageService useFileSystem(FilesystemDFSCredentials dfsCredentials) { + private static SystemRootAndStorageService useFileSystem(FilesystemDFSCredentials dfsCredentials, PathEncryptionConfig pathEncryptionConfig) { FilesystemDFSCredentials filesystemDFSCredentials = dfsCredentials; LogStringFrame lsf = new LogStringFrame(); lsf.add("FILESYSTEM"); lsf.add("root bucket : " + filesystemDFSCredentials.getRoot()); - lsf.add("path encryption : " + "hallo peter affe"); + lsf.add("path encryption : " + pathEncryptionConfig.withPathEncryption); log.info(lsf.toString()); URI systemRoot = FileSystems.getDefault().getPath(filesystemDFSCredentials.getRoot()).toAbsolutePath().toUri(); StorageService storageService = new FileSystemStorageService(FileSystems.getDefault().getPath(filesystemDFSCredentials.getRoot())); diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java index 8f2ec8a61..ae779b40e 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java @@ -51,21 +51,21 @@ public SimpleDatasafeService getSimpleDataSafeServiceWithSubdir(String subdirBel if (dfsCredentials instanceof AmazonS3DFSCredentials) { AmazonS3DFSCredentials amazonS3DFSCredentials = (AmazonS3DFSCredentials) dfsCredentials; return new SimpleDatasafeServiceImpl( - amazonS3DFSCredentials.toBuilder().rootBucket( - amazonS3DFSCredentials.getRootBucket() + "/" + subdirBelowRoot - ).build(), - null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig(), - new PathEncryptionConfig(true) + amazonS3DFSCredentials.toBuilder().rootBucket( + amazonS3DFSCredentials.getRootBucket() + "/" + subdirBelowRoot + ).build(), + null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig(), + new PathEncryptionConfig(null == encryptionProperties ? true : encryptionProperties.getPathEncryption()) ); } if (dfsCredentials instanceof FilesystemDFSCredentials) { FilesystemDFSCredentials filesystemDFSCredentials = (FilesystemDFSCredentials) dfsCredentials; return new SimpleDatasafeServiceImpl( - filesystemDFSCredentials.toBuilder().root( - filesystemDFSCredentials.getRoot() + "/" + subdirBelowRoot - ).build(), - null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig(), - new PathEncryptionConfig(true) + filesystemDFSCredentials.toBuilder().root( + filesystemDFSCredentials.getRoot() + "/" + subdirBelowRoot + ).build(), + null != encryptionProperties ? encryptionProperties.getEncryption() : new MutableEncryptionConfig(), + new PathEncryptionConfig(null == encryptionProperties ? true : encryptionProperties.getPathEncryption()) ); } throw new SimpleAdapterException("missing switch for DFSCredentials" + dfsCredentials); diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringAmazonS3DFSCredentialsProperties.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringAmazonS3DFSCredentialsProperties.java index 0013a1e4c..2ce796b94 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringAmazonS3DFSCredentialsProperties.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringAmazonS3DFSCredentialsProperties.java @@ -20,6 +20,7 @@ public class SpringAmazonS3DFSCredentialsProperties { private final static String DEFAULT_ROOT = "datasafe-root"; public final static String template = "\n" + "datasafe:\n" + + " pathEncryption: (optional, default true)\n" + " storeconnection:\n" + " amazons3:\n" + " url: (mandatory)\n" + diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringDatasafeEncryptionProperties.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringDatasafeEncryptionProperties.java index e925ae2bd..fdad9de08 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringDatasafeEncryptionProperties.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringDatasafeEncryptionProperties.java @@ -3,10 +3,13 @@ import de.adorsys.datasafe.encrypiton.api.types.encryption.MutableEncryptionConfig; import lombok.Data; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.lang.Nullable; @Data @ConfigurationProperties(prefix = "datasafe") public class SpringDatasafeEncryptionProperties { private MutableEncryptionConfig encryption = new MutableEncryptionConfig(); + @Nullable + private Boolean pathEncryption = true; } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringFilesystemDFSCredentialsProperties.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringFilesystemDFSCredentialsProperties.java index 71d486ea2..d95567ff9 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringFilesystemDFSCredentialsProperties.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/properties/SpringFilesystemDFSCredentialsProperties.java @@ -16,6 +16,7 @@ public class SpringFilesystemDFSCredentialsProperties { private final static String DEFAULT_ROOT = "datasafe-root"; public final static String template = "\n" + "datasafe:\n" + + " pathEncryption: (optional, default true)\n" + " storeconnection:\n" + " filesystem:\n" + " rootbucket: (mandatory)\n"; From 42844ddd1a95bec29910036b73902e5e38ec713a Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 3 Sep 2020 16:39:35 +0200 Subject: [PATCH 05/14] DOC 175 second test for path unencrypted with application.yml --- .../api/types/AmazonS3DFSCredentials.java | 6 +- .../SpringSimpleDatasafeServiceFactory.java | 6 +- ...ioTest.java => InjectionForMinioTest.java} | 8 +- .../simple/adapter/spring/InjectionTest.java | 76 +++++++++++++++++++ ...ithoutPathEncryptionForFilesystemTest.java | 44 +++++++++++ ...tionWithoutPathEncryptionForMinioTest.java | 49 ++++++++++++ .../application-fs-withoutPathEncryption.yml | 5 ++ ...pplication-minio-withoutPathEncryption.yml | 8 ++ .../teststorage/WithStorageProvider.java | 2 +- 9 files changed, 196 insertions(+), 8 deletions(-) rename datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/{InectionForMinioTest.java => InjectionForMinioTest.java} (86%) create mode 100644 datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java create mode 100644 datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java create mode 100644 datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-fs-withoutPathEncryption.yml create mode 100644 datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-minio-withoutPathEncryption.yml diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java index f38b5bf5f..763f40efa 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java @@ -2,10 +2,12 @@ import lombok.Builder; import lombok.Getter; +import lombok.ToString; // TODO: it is far more than credentials, rename it and parent class to DFSConfig in next major release @Builder(toBuilder = true) @Getter +@ToString public class AmazonS3DFSCredentials extends DFSCredentials { private final String rootBucket; private final String url; @@ -32,11 +34,7 @@ public class AmazonS3DFSCredentials extends DFSCredentials { @Builder.Default private final int requestTimeout = 0; - public String getContainer() { return rootBucket.split("/")[0]; } - - - } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java index ae779b40e..064d3208a 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/main/java/de/adorsys/datasafe/simple/adapter/spring/factory/SpringSimpleDatasafeServiceFactory.java @@ -9,10 +9,12 @@ import de.adorsys.datasafe.simple.adapter.impl.SimpleDatasafeServiceImpl; import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDatasafeEncryptionProperties; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import javax.annotation.PostConstruct; +@Slf4j public class SpringSimpleDatasafeServiceFactory { @Autowired @@ -33,17 +35,19 @@ public void postConstruct() { } dfsCredentials = wiredDfsCredentials; } + log.info("encryptionProperties are:{}", encryptionProperties); } public SpringSimpleDatasafeServiceFactory() { useWiredCredentials = true; } - public SpringSimpleDatasafeServiceFactory(DFSCredentials credentials) { + public SpringSimpleDatasafeServiceFactory(DFSCredentials credentials, SpringDatasafeEncryptionProperties springDatasafeEncryptionProperties) { if (credentials == null) { throw new RuntimeException("dfs credentials passed in must not be null"); } dfsCredentials = credentials; + encryptionProperties = springDatasafeEncryptionProperties; useWiredCredentials = false; } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InectionForMinioTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionForMinioTest.java similarity index 86% rename from datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InectionForMinioTest.java rename to datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionForMinioTest.java index 8517b342c..0a4f14085 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InectionForMinioTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionForMinioTest.java @@ -4,6 +4,7 @@ import de.adorsys.datasafe.simple.adapter.spring.annotations.UseDatasafeSpringConfiguration; import de.adorsys.datasafe.simple.adapter.spring.factory.SpringSimpleDatasafeServiceFactory; import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDFSCredentialProperties; +import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDatasafeEncryptionProperties; import de.adorsys.datasafe.teststorage.WithStorageProvider; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeAll; @@ -18,11 +19,14 @@ @Slf4j @ActiveProfiles("minio") @UseDatasafeSpringConfiguration -public class InectionForMinioTest extends InjectionTest { +public class InjectionForMinioTest extends InjectionTest { @Autowired private SpringDFSCredentialProperties dfsCredentialProperties; + @Autowired + private SpringDatasafeEncryptionProperties encryptionProperties; + @BeforeAll static void startMinio() { minio().getStorageService().get(); @@ -37,7 +41,7 @@ private static Stream minioonly() { @MethodSource("minioonly") public void plainService(WithStorageProvider.StorageDescriptor descriptor) { log.info("descriptor is " + descriptor.getName()); - SpringSimpleDatasafeServiceFactory springSimpleDatasafeServiceFactory = new SpringSimpleDatasafeServiceFactory(SpringPropertiesToDFSCredentialsUtil.dfsCredentials(dfsCredentialProperties)); + SpringSimpleDatasafeServiceFactory springSimpleDatasafeServiceFactory = new SpringSimpleDatasafeServiceFactory(SpringPropertiesToDFSCredentialsUtil.dfsCredentials(dfsCredentialProperties), encryptionProperties); SimpleDatasafeService service = springSimpleDatasafeServiceFactory.getSimpleDataSafeServiceWithSubdir("subdir"); testCreateUser(service); } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java index 726088eef..3a40b1364 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java @@ -3,18 +3,46 @@ import de.adorsys.datasafe.encrypiton.api.types.UserID; import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth; import de.adorsys.datasafe.simple.adapter.api.SimpleDatasafeService; +import de.adorsys.datasafe.simple.adapter.api.types.AmazonS3DFSCredentials; +import de.adorsys.datasafe.simple.adapter.api.types.DFSCredentials; +import de.adorsys.datasafe.simple.adapter.api.types.DSDocument; +import de.adorsys.datasafe.simple.adapter.api.types.DocumentContent; +import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; +import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; +import de.adorsys.datasafe.simple.adapter.impl.SimpleDatasafeServiceImpl; import de.adorsys.datasafe.simple.adapter.spring.annotations.UseDatasafeSpringConfiguration; import de.adorsys.datasafe.teststorage.WithStorageProvider; +import de.adorsys.datasafe.types.api.resource.AbsoluteLocation; +import de.adorsys.datasafe.types.api.resource.BasePrivateResource; +import de.adorsys.datasafe.types.api.resource.PrivateResource; +import de.adorsys.datasafe.types.api.resource.ResolvedResource; +import de.adorsys.datasafe.types.api.resource.Uri; import de.adorsys.datasafe.types.api.types.ReadKeyPassword; import de.adorsys.datasafe.types.api.utils.ReadKeyPasswordTestFactory; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.jetbrains.annotations.Nullable; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; +import org.testcontainers.shaded.org.apache.commons.io.IOUtils; +import java.io.InputStream; +import java.io.StringWriter; +import java.net.URI; +import java.nio.file.FileSystems; +import java.nio.file.Path; +import java.util.Optional; +import java.util.stream.Stream; + +import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.Assert.assertFalse; +@Slf4j @SpringBootTest @ExtendWith(SpringExtension.class) @ContextConfiguration @@ -32,4 +60,52 @@ public void testCreateUser(SimpleDatasafeService datasafeService) { assertThat(datasafeService.userExists(userid)).isTrue(); datasafeService.destroyUser(userIDAuth); } + + @SneakyThrows + void testWithoutPathEncryption(SimpleDatasafeService simpleDatasafeServiceApi, DFSCredentials dfsCredentials) { + if (!(simpleDatasafeServiceApi instanceof SimpleDatasafeServiceImpl)) { + throw new RuntimeException("Did expect instance of SimpleDatasafeServiceImpl"); + } + AbsoluteLocation rootLocation = getPrivateResourceAbsoluteLocation(dfsCredentials); + SimpleDatasafeServiceImpl simpleDatasafeService = (SimpleDatasafeServiceImpl) simpleDatasafeServiceApi; + + UserIDAuth userIDAuth = new UserIDAuth(new UserID("peter"), ReadKeyPasswordTestFactory.getForString("password")); + String content = "content of document"; + String path = "a/b/c.txt"; + DSDocument document = new DSDocument(new DocumentFQN(path), new DocumentContent(content.getBytes())); + simpleDatasafeService.createUser(userIDAuth); + simpleDatasafeService.storeDocument(userIDAuth, document); + + try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation).filter(el -> el.location().toASCIIString().contains(path))) { + Assertions.assertEquals(1, absoluteLocationStream.count()); + } + try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation).filter(el -> el.location().toASCIIString().contains(path))) { + Optional> first = absoluteLocationStream.findFirst(); + + try (InputStream read = simpleDatasafeService.getStorageService().read(first.get())) { + StringWriter writer = new StringWriter(); + IOUtils.copy(read, writer, UTF_8); + assertFalse(writer.toString().equals(content)); + } + } + simpleDatasafeService.destroyUser(userIDAuth); + } + + @Nullable + @SneakyThrows + private AbsoluteLocation getPrivateResourceAbsoluteLocation(DFSCredentials dfsCredentials) { + if (dfsCredentials instanceof FilesystemDFSCredentials) { + String root = ((FilesystemDFSCredentials) dfsCredentials).getRoot(); + Path listpath = FileSystems.getDefault().getPath(root); + return new AbsoluteLocation<>(BasePrivateResource.forPrivate(listpath.toUri())); + } + if (dfsCredentials instanceof AmazonS3DFSCredentials) { + String root = ((AmazonS3DFSCredentials) dfsCredentials).getRootBucket(); + AmazonS3DFSCredentials a = (AmazonS3DFSCredentials) dfsCredentials; + log.info(a.toString()); + return new AbsoluteLocation<>(BasePrivateResource.forPrivate(new URI(a.getUrl() + "/" + root))); + } + throw new RuntimeException("NYI"); + } + } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java new file mode 100644 index 000000000..2fe507fb3 --- /dev/null +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java @@ -0,0 +1,44 @@ +package de.adorsys.datasafe.simple.adapter.spring; + +import de.adorsys.datasafe.simple.adapter.api.SimpleDatasafeService; +import de.adorsys.datasafe.simple.adapter.api.types.DFSCredentials; +import de.adorsys.datasafe.simple.adapter.spring.annotations.UseDatasafeSpringConfiguration; +import de.adorsys.datasafe.simple.adapter.spring.factory.SpringSimpleDatasafeServiceFactory; +import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDFSCredentialProperties; +import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDatasafeEncryptionProperties; +import de.adorsys.datasafe.teststorage.WithStorageProvider; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.SpringBootConfiguration; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.ContextConfiguration; + +import java.util.stream.Stream; + +@Slf4j +@ActiveProfiles("fs-withoutPathEncryption") +@UseDatasafeSpringConfiguration +public class InjectionWithoutPathEncryptionForFilesystemTest extends InjectionTest{ + @Autowired + private SpringDFSCredentialProperties dfsCredentialProperties; + + @Autowired + private SpringDatasafeEncryptionProperties encryptionProperties; + + private static Stream fsonly() { + return Stream.of(fs()); + } + + @ParameterizedTest + @MethodSource("fsonly") + public void plainService(WithStorageProvider.StorageDescriptor descriptor) { + log.info("descriptor is " + descriptor.getName()); + DFSCredentials dfsCredentials = SpringPropertiesToDFSCredentialsUtil.dfsCredentials(dfsCredentialProperties); + SpringSimpleDatasafeServiceFactory springSimpleDatasafeServiceFactory = new SpringSimpleDatasafeServiceFactory(dfsCredentials, encryptionProperties); + SimpleDatasafeService service = springSimpleDatasafeServiceFactory.getSimpleDataSafeServiceWithSubdir("subdir"); + testWithoutPathEncryption(service, dfsCredentials); + } + +} diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java new file mode 100644 index 000000000..9a3d71af7 --- /dev/null +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java @@ -0,0 +1,49 @@ +package de.adorsys.datasafe.simple.adapter.spring; + +import de.adorsys.datasafe.simple.adapter.api.SimpleDatasafeService; +import de.adorsys.datasafe.simple.adapter.api.types.DFSCredentials; +import de.adorsys.datasafe.simple.adapter.spring.annotations.UseDatasafeSpringConfiguration; +import de.adorsys.datasafe.simple.adapter.spring.factory.SpringSimpleDatasafeServiceFactory; +import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDFSCredentialProperties; +import de.adorsys.datasafe.simple.adapter.spring.properties.SpringDatasafeEncryptionProperties; +import de.adorsys.datasafe.teststorage.WithStorageProvider; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.ActiveProfiles; + +import java.util.stream.Stream; + +@Slf4j +@ActiveProfiles("minio-withoutPathEncryption") +@UseDatasafeSpringConfiguration +public class InjectionWithoutPathEncryptionForMinioTest extends InjectionTest { + @Autowired + private SpringDFSCredentialProperties dfsCredentialProperties; + + @Autowired + private SpringDatasafeEncryptionProperties encryptionProperties; + + @BeforeAll + static void startMinio() { + minio().getStorageService().get(); + System.setProperty("MINIO_URL", minio().getMappedUrl()); + } + + private static Stream minioonly() { + return Stream.of(minio()); + } + + @ParameterizedTest + @MethodSource("minioonly") + public void plainService(WithStorageProvider.StorageDescriptor descriptor) { + log.info("descriptor is " + descriptor.getName()); + DFSCredentials dfsCredentials = SpringPropertiesToDFSCredentialsUtil.dfsCredentials(dfsCredentialProperties); + SpringSimpleDatasafeServiceFactory springSimpleDatasafeServiceFactory = new SpringSimpleDatasafeServiceFactory(dfsCredentials, encryptionProperties); + SimpleDatasafeService service = springSimpleDatasafeServiceFactory.getSimpleDataSafeServiceWithSubdir("subdir"); + testWithoutPathEncryption(service, dfsCredentials); + } + +} diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-fs-withoutPathEncryption.yml b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-fs-withoutPathEncryption.yml new file mode 100644 index 000000000..002a1c9b7 --- /dev/null +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-fs-withoutPathEncryption.yml @@ -0,0 +1,5 @@ +datasafe: + pathEncryption: false + storeconnection: + filesystem: + rootbucket: target/test-filesystem diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-minio-withoutPathEncryption.yml b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-minio-withoutPathEncryption.yml new file mode 100644 index 000000000..afcd9bebf --- /dev/null +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/resources/application-minio-withoutPathEncryption.yml @@ -0,0 +1,8 @@ +datasafe: + pathEncryption: false + storeconnection: + amazons3: + url: ${MINIO_URL} + accesskey: admin + secretkey: password + rootbucket: adorsys diff --git a/datasafe-test-storages/src/main/java/de/adorsys/datasafe/teststorage/WithStorageProvider.java b/datasafe-test-storages/src/main/java/de/adorsys/datasafe/teststorage/WithStorageProvider.java index cb3b7cc5f..2b5684e13 100644 --- a/datasafe-test-storages/src/main/java/de/adorsys/datasafe/teststorage/WithStorageProvider.java +++ b/datasafe-test-storages/src/main/java/de/adorsys/datasafe/teststorage/WithStorageProvider.java @@ -470,7 +470,7 @@ public StorageDescriptor(WithStorageProvider.StorageDescriptorName name, Supplie this.region = region; this.rootBucket = rootBucket; - log.info("StorageDescriptor name: {} location: {} region: {} root bucket: {}", this.name, this.location, this.region, this.rootBucket); + log.debug("StorageDescriptor name: {} location: {} region: {} root bucket: {}", this.name, this.location, this.region, this.rootBucket); } public String getMappedUrl() { From 46878b062f043e87b09443e1ca91ddd6570e42e8 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 3 Sep 2020 16:49:07 +0200 Subject: [PATCH 06/14] DOC 175 removed log for DFSCredentials --- .../simple/adapter/api/types/AmazonS3DFSCredentials.java | 1 - .../adorsys/datasafe/simple/adapter/spring/InjectionTest.java | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java index 763f40efa..e116c426e 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java @@ -7,7 +7,6 @@ // TODO: it is far more than credentials, rename it and parent class to DFSConfig in next major release @Builder(toBuilder = true) @Getter -@ToString public class AmazonS3DFSCredentials extends DFSCredentials { private final String rootBucket; private final String url; diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java index 3a40b1364..f56e5167c 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java @@ -100,10 +100,8 @@ private AbsoluteLocation getPrivateResourceAbsoluteLocation(DFS return new AbsoluteLocation<>(BasePrivateResource.forPrivate(listpath.toUri())); } if (dfsCredentials instanceof AmazonS3DFSCredentials) { - String root = ((AmazonS3DFSCredentials) dfsCredentials).getRootBucket(); AmazonS3DFSCredentials a = (AmazonS3DFSCredentials) dfsCredentials; - log.info(a.toString()); - return new AbsoluteLocation<>(BasePrivateResource.forPrivate(new URI(a.getUrl() + "/" + root))); + return new AbsoluteLocation<>(BasePrivateResource.forPrivate(new URI(a.getUrl() + "/" + a.getRootBucket()))); } throw new RuntimeException("NYI"); } From 001117871807744f4e1c2cae169c824a7aaad927 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Tue, 8 Sep 2020 15:32:59 +0200 Subject: [PATCH 07/14] DOC 175 added inbox service --- datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml | 5 +++++ .../datasafe/simple/adapter/api/SimpleDatasafeService.java | 3 +++ .../simple/adapter/impl/SimpleDatasafeServiceImpl.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml index 9941d7d11..b16af9bbb 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml @@ -21,6 +21,11 @@ datasafe-encryption-api ${project.version} + + de.adorsys + datasafe-inbox-api + ${project.version} + org.slf4j diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/SimpleDatasafeService.java b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/SimpleDatasafeService.java index 4f6a8a7e8..8c744907b 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/SimpleDatasafeService.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/SimpleDatasafeService.java @@ -2,6 +2,7 @@ import de.adorsys.datasafe.encrypiton.api.types.UserID; import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth; +import de.adorsys.datasafe.inbox.api.InboxService; import de.adorsys.datasafe.simple.adapter.api.types.DSDocument; import de.adorsys.datasafe.simple.adapter.api.types.DSDocumentStream; import de.adorsys.datasafe.simple.adapter.api.types.DocumentDirectoryFQN; @@ -46,6 +47,8 @@ public interface SimpleDatasafeService { List list(UserIDAuth userIDAuth, DocumentDirectoryFQN documentDirectoryFQN, ListRecursiveFlag recursiveFlag); + InboxService getInboxService(); + // deletes all users and their files from storage void cleanupDb(); } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index 67e286cbb..12f27b5d2 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -15,6 +15,7 @@ import de.adorsys.datasafe.encrypiton.api.types.UserIDAuth; import de.adorsys.datasafe.encrypiton.api.types.encryption.MutableEncryptionConfig; import de.adorsys.datasafe.encrypiton.impl.pathencryption.PathEncryptionImplRuntimeDelegatable; +import de.adorsys.datasafe.inbox.api.InboxService; import de.adorsys.datasafe.simple.adapter.api.SimpleDatasafeService; import de.adorsys.datasafe.simple.adapter.api.exceptions.SimpleAdapterException; import de.adorsys.datasafe.simple.adapter.api.types.AmazonS3DFSCredentials; @@ -213,6 +214,11 @@ public List list(UserIDAuth userIDAuth, DocumentDirectoryFQN docume .collect(Collectors.toList()); } + @Override + public InboxService getInboxService() { + return customlyBuiltDatasafeServices.inboxService(); + } + @Override public void cleanupDb() { rootAndStorage.getStorageService() From bba4a1feda6246d162be100de4ff076e7abe0f38 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 10 Sep 2020 10:55:41 +0200 Subject: [PATCH 08/14] OBG 175 changes as requested by review --- .../adapter/api/types/AmazonS3DFSCredentials.java | 1 - .../simple/adapter/impl/SimpleDatasafeServiceImpl.java | 2 +- .../adapter/impl/config/PathEncryptionConfig.java | 10 ++++++---- .../datasafe/simple/adapter/spring/InjectionTest.java | 10 +++++----- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java index e116c426e..ac03836e8 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/src/main/java/de/adorsys/datasafe/simple/adapter/api/types/AmazonS3DFSCredentials.java @@ -2,7 +2,6 @@ import lombok.Builder; import lombok.Getter; -import lombok.ToString; // TODO: it is far more than credentials, rename it and parent class to DFSConfig in next major release @Builder(toBuilder = true) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index 12f27b5d2..5ae0a3903 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -88,7 +88,7 @@ public SimpleDatasafeServiceImpl(DFSCredentials dfsCredentials, MutableEncryptio .encryption(config.toEncryptionConfig()) .storage(getStorageService()); - if (!pathEncryptionConfig.withPathEncryption) { + if (!pathEncryptionConfig.getWithPathEncryption()) { BaseOverridesRegistry baseOverridesRegistry = new BaseOverridesRegistry(); PathEncryptionImplRuntimeDelegatable.overrideWith(baseOverridesRegistry, args -> new NoPathEncryptionImpl( diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java index 955a68de7..b40d7a787 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/config/PathEncryptionConfig.java @@ -1,8 +1,10 @@ package de.adorsys.datasafe.simple.adapter.impl.config; +import lombok.Getter; +import lombok.RequiredArgsConstructor; + +@RequiredArgsConstructor +@Getter public class PathEncryptionConfig { - public PathEncryptionConfig(Boolean withPathEncryption) { - this.withPathEncryption = withPathEncryption; - } - public Boolean withPathEncryption; + private final Boolean withPathEncryption; } diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java index f56e5167c..564b4a88b 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java @@ -16,7 +16,6 @@ import de.adorsys.datasafe.types.api.resource.BasePrivateResource; import de.adorsys.datasafe.types.api.resource.PrivateResource; import de.adorsys.datasafe.types.api.resource.ResolvedResource; -import de.adorsys.datasafe.types.api.resource.Uri; import de.adorsys.datasafe.types.api.types.ReadKeyPassword; import de.adorsys.datasafe.types.api.utils.ReadKeyPasswordTestFactory; import lombok.SneakyThrows; @@ -41,6 +40,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertFalse; +import static org.junit.jupiter.api.Assertions.assertEquals; @Slf4j @SpringBootTest @@ -76,11 +76,11 @@ void testWithoutPathEncryption(SimpleDatasafeService simpleDatasafeServiceApi, D simpleDatasafeService.createUser(userIDAuth); simpleDatasafeService.storeDocument(userIDAuth, document); - try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation).filter(el -> el.location().toASCIIString().contains(path))) { - Assertions.assertEquals(1, absoluteLocationStream.count()); + try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation)) { + assertEquals(1, absoluteLocationStream.filter(el -> el.location().toASCIIString().contains(path)).count()); } - try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation).filter(el -> el.location().toASCIIString().contains(path))) { - Optional> first = absoluteLocationStream.findFirst(); + try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation)) { + Optional> first = absoluteLocationStream.filter(el -> el.location().toASCIIString().contains(path)).findFirst(); try (InputStream read = simpleDatasafeService.getStorageService().read(first.get())) { StringWriter writer = new StringWriter(); From 27f67283d38c110c5e8db4c57eba74a0f0545e59 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 10 Sep 2020 12:22:16 +0200 Subject: [PATCH 09/14] OBG 175 fixed compile errors --- .../simple/adapter/impl/SimpleDatasafeServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index 5ae0a3903..9af29a0be 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -9,6 +9,7 @@ import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.google.common.base.CharMatcher; import com.google.common.io.ByteStreams; +import de.adorsys.datasafe.business.impl.service.DaggerDefaultDatasafeServices; import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices; import de.adorsys.datasafe.directory.impl.profile.config.DefaultDFSConfig; import de.adorsys.datasafe.encrypiton.api.types.UserID; @@ -28,6 +29,7 @@ import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.api.types.ListRecursiveFlag; +import de.adorsys.datasafe.simple.adapter.impl.cmsencryption.SwitchableCMSEncryptionModule; import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.simple.adapter.impl.pathencryption.NoPathEncryptionImpl; import de.adorsys.datasafe.storage.api.StorageService; @@ -235,7 +237,7 @@ private static SystemRootAndStorageService useAmazonS3(AmazonS3DFSCredentials df lsf.add("root bucket : " + amazonS3DFSCredentials.getRootBucket()); lsf.add("url : " + amazonS3DFSCredentials.getUrl()); lsf.add("region : " + amazonS3DFSCredentials.getRegion()); - lsf.add("path encryption : " + pathEncryptionConfig.withPathEncryption); + lsf.add("path encryption : " + pathEncryptionConfig.getWithPathEncryption()); lsf.add("no https : " + amazonS3DFSCredentials.isNoHttps()); lsf.add("threadpool size : " + amazonS3DFSCredentials.getThreadPoolSize()); int maxConnections = amazonS3DFSCredentials.getMaxConnections(); @@ -316,7 +318,7 @@ private static SystemRootAndStorageService useFileSystem(FilesystemDFSCredential LogStringFrame lsf = new LogStringFrame(); lsf.add("FILESYSTEM"); lsf.add("root bucket : " + filesystemDFSCredentials.getRoot()); - lsf.add("path encryption : " + pathEncryptionConfig.withPathEncryption); + lsf.add("path encryption : " + pathEncryptionConfig.getWithPathEncryption()); log.info(lsf.toString()); URI systemRoot = FileSystems.getDefault().getPath(filesystemDFSCredentials.getRoot()).toAbsolutePath().toUri(); StorageService storageService = new FileSystemStorageService(FileSystems.getDefault().getPath(filesystemDFSCredentials.getRoot())); From 592fef49608e2e88f6ac51d931f9cc17f7e0aef0 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 10 Sep 2020 13:06:32 +0200 Subject: [PATCH 10/14] OBG 175 removed NoPathEncryptionModule --- .../impl/SimpleDatasafeServiceImpl.java | 2 - .../NoPathEncryptionModule.java | 46 ------------------- 2 files changed, 48 deletions(-) delete mode 100644 datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java index 9af29a0be..02f9cb024 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/SimpleDatasafeServiceImpl.java @@ -9,7 +9,6 @@ import com.amazonaws.services.s3.AmazonS3ClientBuilder; import com.google.common.base.CharMatcher; import com.google.common.io.ByteStreams; -import de.adorsys.datasafe.business.impl.service.DaggerDefaultDatasafeServices; import de.adorsys.datasafe.business.impl.service.DefaultDatasafeServices; import de.adorsys.datasafe.directory.impl.profile.config.DefaultDFSConfig; import de.adorsys.datasafe.encrypiton.api.types.UserID; @@ -29,7 +28,6 @@ import de.adorsys.datasafe.simple.adapter.api.types.DocumentFQN; import de.adorsys.datasafe.simple.adapter.api.types.FilesystemDFSCredentials; import de.adorsys.datasafe.simple.adapter.api.types.ListRecursiveFlag; -import de.adorsys.datasafe.simple.adapter.impl.cmsencryption.SwitchableCMSEncryptionModule; import de.adorsys.datasafe.simple.adapter.impl.config.PathEncryptionConfig; import de.adorsys.datasafe.simple.adapter.impl.pathencryption.NoPathEncryptionImpl; import de.adorsys.datasafe.storage.api.StorageService; diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java b/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java deleted file mode 100644 index 10465a3b5..000000000 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/src/main/java/de/adorsys/datasafe/simple/adapter/impl/pathencryption/NoPathEncryptionModule.java +++ /dev/null @@ -1,46 +0,0 @@ -package de.adorsys.datasafe.simple.adapter.impl.pathencryption; - -import dagger.Binds; -import dagger.Module; -import dagger.Provides; -import de.adorsys.datasafe.encrypiton.api.pathencryption.PathEncryption; -import de.adorsys.datasafe.encrypiton.api.pathencryption.encryption.SymmetricPathEncryptionService; -import de.adorsys.datasafe.encrypiton.impl.pathencryption.IntegrityPreservingUriEncryptionRuntimeDelegatable; -import de.adorsys.datasafe.encrypiton.impl.pathencryption.PathEncryptorDecryptor; -import de.adorsys.datasafe.encrypiton.impl.pathencryption.PathSegmentEncryptorDecryptorRuntimeDelegatable; -import org.cryptomator.siv.SivMode; - -/** - * This module is responsible for providing pathencryption of document. - */ -@Module -public abstract class NoPathEncryptionModule { - /** - * SivMode using for encryption and decryption in AES CGM SIV mode - * @return SivMode - */ - @Provides - static SivMode sivMode() { - return new SivMode(); - } - - /** - * Default path encryption that uses Base64-urlsafe path serialization and AES-CGM-SIV mode for encryption - */ - @Binds - abstract PathEncryptorDecryptor pathEncryptorDecryptor(PathSegmentEncryptorDecryptorRuntimeDelegatable impl); - - /** - * By default simply use - * {@link de.adorsys.datasafe.directory.api.profile.keys.PrivateKeyService} to get key - * and pass path with key to {@link SymmetricPathEncryptionService} - */ - @Binds - abstract PathEncryption pathEncryption(NoPathEncryptionImpl impl); - - /** - * Default symmetric path encryption that encrypts URI segment-by-segment. - */ - @Binds - abstract SymmetricPathEncryptionService symmetricPathEncryptionService(IntegrityPreservingUriEncryptionRuntimeDelegatable impl); -} From 7379624929c7aa9d6b22014bdea8b8552ab1d741 Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Thu, 10 Sep 2020 20:24:01 +0200 Subject: [PATCH 11/14] DOC 175 deepCodes fix --- .../InjectionWithoutPathEncryptionForFilesystemTest.java | 4 ++-- .../spring/InjectionWithoutPathEncryptionForMinioTest.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java index 2fe507fb3..969653f13 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForFilesystemTest.java @@ -20,7 +20,7 @@ @Slf4j @ActiveProfiles("fs-withoutPathEncryption") @UseDatasafeSpringConfiguration -public class InjectionWithoutPathEncryptionForFilesystemTest extends InjectionTest{ +public class InjectionWithoutPathEncryptionForFilesystemTest extends InjectionTest { @Autowired private SpringDFSCredentialProperties dfsCredentialProperties; @@ -34,7 +34,7 @@ private static Stream fsonly() { @ParameterizedTest @MethodSource("fsonly") public void plainService(WithStorageProvider.StorageDescriptor descriptor) { - log.info("descriptor is " + descriptor.getName()); + log.info("descriptor is {}", descriptor.getName()); DFSCredentials dfsCredentials = SpringPropertiesToDFSCredentialsUtil.dfsCredentials(dfsCredentialProperties); SpringSimpleDatasafeServiceFactory springSimpleDatasafeServiceFactory = new SpringSimpleDatasafeServiceFactory(dfsCredentials, encryptionProperties); SimpleDatasafeService service = springSimpleDatasafeServiceFactory.getSimpleDataSafeServiceWithSubdir("subdir"); diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java index 9a3d71af7..023f93952 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionWithoutPathEncryptionForMinioTest.java @@ -39,7 +39,7 @@ private static Stream minioonly() { @ParameterizedTest @MethodSource("minioonly") public void plainService(WithStorageProvider.StorageDescriptor descriptor) { - log.info("descriptor is " + descriptor.getName()); + log.info("descriptor is {}", descriptor.getName()); DFSCredentials dfsCredentials = SpringPropertiesToDFSCredentialsUtil.dfsCredentials(dfsCredentialProperties); SpringSimpleDatasafeServiceFactory springSimpleDatasafeServiceFactory = new SpringSimpleDatasafeServiceFactory(dfsCredentials, encryptionProperties); SimpleDatasafeService service = springSimpleDatasafeServiceFactory.getSimpleDataSafeServiceWithSubdir("subdir"); From 10980a5296c2df068fdb2c4227ee5583204d39ae Mon Sep 17 00:00:00 2001 From: electronicpeter Date: Fri, 11 Sep 2020 10:49:12 +0200 Subject: [PATCH 12/14] DOC 1745 make deep code happy --- .../simple/adapter/spring/InjectionTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java index 564b4a88b..e230609f1 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/src/test/java/de/adorsys/datasafe/simple/adapter/spring/InjectionTest.java @@ -64,7 +64,7 @@ public void testCreateUser(SimpleDatasafeService datasafeService) { @SneakyThrows void testWithoutPathEncryption(SimpleDatasafeService simpleDatasafeServiceApi, DFSCredentials dfsCredentials) { if (!(simpleDatasafeServiceApi instanceof SimpleDatasafeServiceImpl)) { - throw new RuntimeException("Did expect instance of SimpleDatasafeServiceImpl"); + throw new TestException("Did expect instance of SimpleDatasafeServiceImpl"); } AbsoluteLocation rootLocation = getPrivateResourceAbsoluteLocation(dfsCredentials); SimpleDatasafeServiceImpl simpleDatasafeService = (SimpleDatasafeServiceImpl) simpleDatasafeServiceApi; @@ -81,6 +81,9 @@ void testWithoutPathEncryption(SimpleDatasafeService simpleDatasafeServiceApi, D } try (Stream> absoluteLocationStream = simpleDatasafeService.getStorageService().list(rootLocation)) { Optional> first = absoluteLocationStream.filter(el -> el.location().toASCIIString().contains(path)).findFirst(); + if (!first.isPresent()) { + throw new TestException("expeceted absoluteLocatinn stream to have at least one element"); + } try (InputStream read = simpleDatasafeService.getStorageService().read(first.get())) { StringWriter writer = new StringWriter(); @@ -103,7 +106,12 @@ private AbsoluteLocation getPrivateResourceAbsoluteLocation(DFS AmazonS3DFSCredentials a = (AmazonS3DFSCredentials) dfsCredentials; return new AbsoluteLocation<>(BasePrivateResource.forPrivate(new URI(a.getUrl() + "/" + a.getRootBucket()))); } - throw new RuntimeException("NYI"); + throw new TestException("NYI"); } + static class TestException extends RuntimeException { + public TestException(String message) { + super(message); + } + } } From 0148157b273dd57a26ab6e0ce1ee6a5d14c898f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Wed, 16 Sep 2020 10:25:05 +0200 Subject: [PATCH 13/14] Disable deployments --- .travis.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e58983a6..77d7169b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,19 +41,19 @@ deploy: tags: true condition: "$TRAVIS_TAG =~ ^v([[:digit:]]+\\.)+[[:digit:]]+(-[[:digit:]]+)?(-SNAPSHOT)?$" - - provider: script - skip_cleanup: true - script: /bin/bash .travis/deploy_develop_to_openshift.sh - on: - branch: develop - - - provider: script - skip_cleanup: true - script: /bin/bash .travis/upload_dockerhub.sh - on: - all_branches: true - tags: true - condition: "$TRAVIS_TAG =~ ^v([[:digit:]]+\\.)+[[:digit:]]+(-[[:digit:]]+)?(-SNAPSHOT)?$" +# - provider: script +# skip_cleanup: true +# script: /bin/bash .travis/deploy_develop_to_openshift.sh +# on: +# branch: develop + +# - provider: script +# skip_cleanup: true +# script: /bin/bash .travis/upload_dockerhub.sh +# on: +# all_branches: true +# tags: true +# condition: "$TRAVIS_TAG =~ ^v([[:digit:]]+\\.)+[[:digit:]]+(-[[:digit:]]+)?(-SNAPSHOT)?$" after_success: - /bin/bash .travis/codecov_bash.sh From cd60148c1f622d2357c68af7395f66059214109d Mon Sep 17 00:00:00 2001 From: psp Date: Mon, 21 Sep 2020 11:27:00 +0200 Subject: [PATCH 14/14] Prepare release 1.0.3 --- datasafe-business/pom.xml | 2 +- datasafe-cli/pom.xml | 2 +- datasafe-directory/datasafe-directory-api/pom.xml | 2 +- datasafe-directory/datasafe-directory-impl/pom.xml | 2 +- datasafe-directory/pom.xml | 2 +- datasafe-encryption/datasafe-encryption-api/pom.xml | 2 +- datasafe-encryption/datasafe-encryption-impl/pom.xml | 2 +- datasafe-encryption/pom.xml | 2 +- datasafe-examples/datasafe-examples-business/pom.xml | 2 +- datasafe-examples/datasafe-examples-customize-dagger/pom.xml | 2 +- datasafe-examples/datasafe-examples-multidfs/pom.xml | 2 +- datasafe-examples/datasafe-examples-versioned-s3/pom.xml | 2 +- datasafe-examples/pom.xml | 2 +- datasafe-inbox/datasafe-inbox-api/pom.xml | 2 +- datasafe-inbox/datasafe-inbox-impl/pom.xml | 2 +- datasafe-inbox/pom.xml | 2 +- .../datasafe-business-tests-random-actions/pom.xml | 2 +- datasafe-long-run-tests/pom.xml | 2 +- datasafe-metainfo/datasafe-metainfo-version-api/pom.xml | 2 +- datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml | 2 +- datasafe-metainfo/pom.xml | 2 +- datasafe-privatestore/datasafe-privatestore-api/pom.xml | 2 +- datasafe-privatestore/datasafe-privatestore-impl/pom.xml | 2 +- datasafe-privatestore/pom.xml | 2 +- datasafe-rest-impl/pom.xml | 4 ++-- datasafe-runtime-delegate/pom.xml | 2 +- datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml | 2 +- datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml | 2 +- .../datasafe-simple-adapter-spring/pom.xml | 2 +- datasafe-simple-adapter/pom.xml | 2 +- datasafe-storage/datasafe-storage-api/pom.xml | 2 +- datasafe-storage/datasafe-storage-impl-db/pom.xml | 2 +- datasafe-storage/datasafe-storage-impl-fs/pom.xml | 2 +- datasafe-storage/datasafe-storage-impl-s3/pom.xml | 2 +- datasafe-storage/pom.xml | 2 +- datasafe-test-storages/pom.xml | 2 +- datasafe-types-api/pom.xml | 2 +- last-module-codecoverage-check/pom.xml | 2 +- pom.xml | 2 +- 39 files changed, 40 insertions(+), 40 deletions(-) diff --git a/datasafe-business/pom.xml b/datasafe-business/pom.xml index 773286a1f..dbf35104b 100644 --- a/datasafe-business/pom.xml +++ b/datasafe-business/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-cli/pom.xml b/datasafe-cli/pom.xml index 4d635ece6..276b47479 100644 --- a/datasafe-cli/pom.xml +++ b/datasafe-cli/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe - 1.0.3-SNAPSHOT + 1.0.3 datasafe-cli diff --git a/datasafe-directory/datasafe-directory-api/pom.xml b/datasafe-directory/datasafe-directory-api/pom.xml index 6763e7968..9e8ceec44 100644 --- a/datasafe-directory/datasafe-directory-api/pom.xml +++ b/datasafe-directory/datasafe-directory-api/pom.xml @@ -3,7 +3,7 @@ de.adorsys datasafe-directory - 1.0.3-SNAPSHOT + 1.0.3 datasafe-directory-api diff --git a/datasafe-directory/datasafe-directory-impl/pom.xml b/datasafe-directory/datasafe-directory-impl/pom.xml index 11acf4957..499010f42 100644 --- a/datasafe-directory/datasafe-directory-impl/pom.xml +++ b/datasafe-directory/datasafe-directory-impl/pom.xml @@ -3,7 +3,7 @@ de.adorsys datasafe-directory - 1.0.3-SNAPSHOT + 1.0.3 datasafe-directory-impl diff --git a/datasafe-directory/pom.xml b/datasafe-directory/pom.xml index 688a8094f..5e7c5a278 100644 --- a/datasafe-directory/pom.xml +++ b/datasafe-directory/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-encryption/datasafe-encryption-api/pom.xml b/datasafe-encryption/datasafe-encryption-api/pom.xml index f24d2a6f1..03062d68a 100644 --- a/datasafe-encryption/datasafe-encryption-api/pom.xml +++ b/datasafe-encryption/datasafe-encryption-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-encryption - 1.0.3-SNAPSHOT + 1.0.3 datasafe-encryption-api diff --git a/datasafe-encryption/datasafe-encryption-impl/pom.xml b/datasafe-encryption/datasafe-encryption-impl/pom.xml index 803bddc8a..62c342c60 100644 --- a/datasafe-encryption/datasafe-encryption-impl/pom.xml +++ b/datasafe-encryption/datasafe-encryption-impl/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-encryption - 1.0.3-SNAPSHOT + 1.0.3 datasafe-encryption-impl diff --git a/datasafe-encryption/pom.xml b/datasafe-encryption/pom.xml index 2911707c3..99494b93c 100644 --- a/datasafe-encryption/pom.xml +++ b/datasafe-encryption/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-examples/datasafe-examples-business/pom.xml b/datasafe-examples/datasafe-examples-business/pom.xml index 75c533f0b..f570942af 100644 --- a/datasafe-examples/datasafe-examples-business/pom.xml +++ b/datasafe-examples/datasafe-examples-business/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.3-SNAPSHOT + 1.0.3 datasafe-examples-business diff --git a/datasafe-examples/datasafe-examples-customize-dagger/pom.xml b/datasafe-examples/datasafe-examples-customize-dagger/pom.xml index 9ff9560b0..10b764cc5 100644 --- a/datasafe-examples/datasafe-examples-customize-dagger/pom.xml +++ b/datasafe-examples/datasafe-examples-customize-dagger/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.3-SNAPSHOT + 1.0.3 datasafe-examples-customize-dagger diff --git a/datasafe-examples/datasafe-examples-multidfs/pom.xml b/datasafe-examples/datasafe-examples-multidfs/pom.xml index 14a0c5fbc..1d9a90dc0 100644 --- a/datasafe-examples/datasafe-examples-multidfs/pom.xml +++ b/datasafe-examples/datasafe-examples-multidfs/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.3-SNAPSHOT + 1.0.3 datasafe-examples-multidfs diff --git a/datasafe-examples/datasafe-examples-versioned-s3/pom.xml b/datasafe-examples/datasafe-examples-versioned-s3/pom.xml index 8c557bed9..046508017 100644 --- a/datasafe-examples/datasafe-examples-versioned-s3/pom.xml +++ b/datasafe-examples/datasafe-examples-versioned-s3/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-examples - 1.0.3-SNAPSHOT + 1.0.3 datasafe-examples-versioned-s3 diff --git a/datasafe-examples/pom.xml b/datasafe-examples/pom.xml index 39bee01a9..69ac73e31 100644 --- a/datasafe-examples/pom.xml +++ b/datasafe-examples/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-inbox/datasafe-inbox-api/pom.xml b/datasafe-inbox/datasafe-inbox-api/pom.xml index 28b06561b..59fcf5480 100644 --- a/datasafe-inbox/datasafe-inbox-api/pom.xml +++ b/datasafe-inbox/datasafe-inbox-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-inbox - 1.0.3-SNAPSHOT + 1.0.3 datasafe-inbox-api diff --git a/datasafe-inbox/datasafe-inbox-impl/pom.xml b/datasafe-inbox/datasafe-inbox-impl/pom.xml index f6d5d20e2..3182d96ff 100644 --- a/datasafe-inbox/datasafe-inbox-impl/pom.xml +++ b/datasafe-inbox/datasafe-inbox-impl/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-inbox - 1.0.3-SNAPSHOT + 1.0.3 datasafe-inbox-impl diff --git a/datasafe-inbox/pom.xml b/datasafe-inbox/pom.xml index 554634509..ee32e4265 100644 --- a/datasafe-inbox/pom.xml +++ b/datasafe-inbox/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml b/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml index 9d196ea14..5c45e511b 100644 --- a/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml +++ b/datasafe-long-run-tests/datasafe-business-tests-random-actions/pom.xml @@ -5,7 +5,7 @@ datasafe-long-run-tests de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-long-run-tests/pom.xml b/datasafe-long-run-tests/pom.xml index fa35d6242..3baeff99a 100644 --- a/datasafe-long-run-tests/pom.xml +++ b/datasafe-long-run-tests/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml b/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml index 3ede9440b..d12b14d62 100644 --- a/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml +++ b/datasafe-metainfo/datasafe-metainfo-version-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-metainfo - 1.0.3-SNAPSHOT + 1.0.3 datasafe-metainfo-version-api diff --git a/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml b/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml index 2a175a57c..afef9d6e3 100644 --- a/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml +++ b/datasafe-metainfo/datasafe-metainfo-version-impl/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-metainfo - 1.0.3-SNAPSHOT + 1.0.3 datasafe-metainfo-version-impl diff --git a/datasafe-metainfo/pom.xml b/datasafe-metainfo/pom.xml index cb8fecb8f..ca94d6adc 100644 --- a/datasafe-metainfo/pom.xml +++ b/datasafe-metainfo/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-privatestore/datasafe-privatestore-api/pom.xml b/datasafe-privatestore/datasafe-privatestore-api/pom.xml index 56e89b5a0..960158328 100644 --- a/datasafe-privatestore/datasafe-privatestore-api/pom.xml +++ b/datasafe-privatestore/datasafe-privatestore-api/pom.xml @@ -5,7 +5,7 @@ datasafe-privatestore de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-privatestore/datasafe-privatestore-impl/pom.xml b/datasafe-privatestore/datasafe-privatestore-impl/pom.xml index 970c4b6b8..14d8167ef 100644 --- a/datasafe-privatestore/datasafe-privatestore-impl/pom.xml +++ b/datasafe-privatestore/datasafe-privatestore-impl/pom.xml @@ -5,7 +5,7 @@ datasafe-privatestore de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-privatestore/pom.xml b/datasafe-privatestore/pom.xml index ebcb4a5f0..a33368c8b 100644 --- a/datasafe-privatestore/pom.xml +++ b/datasafe-privatestore/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-rest-impl/pom.xml b/datasafe-rest-impl/pom.xml index e8d91c9c1..a6e304c5a 100644 --- a/datasafe-rest-impl/pom.xml +++ b/datasafe-rest-impl/pom.xml @@ -5,11 +5,11 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 datasafe-rest-impl - 1.0.3-SNAPSHOT + 1.0.3 datasafe-rest-impl Spring Boot DataSafe Application diff --git a/datasafe-runtime-delegate/pom.xml b/datasafe-runtime-delegate/pom.xml index 27976233e..a883a5bf2 100644 --- a/datasafe-runtime-delegate/pom.xml +++ b/datasafe-runtime-delegate/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe - 1.0.3-SNAPSHOT + 1.0.3 datasafe-runtime-delegate diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml index b16af9bbb..0d6f6f1f0 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-api/pom.xml @@ -5,7 +5,7 @@ datasafe-simple-adapter de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml index 51f77a406..02ffa567f 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-impl/pom.xml @@ -5,7 +5,7 @@ datasafe-simple-adapter de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml b/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml index 3cb8c6321..d26a79b52 100644 --- a/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml +++ b/datasafe-simple-adapter/datasafe-simple-adapter-spring/pom.xml @@ -5,7 +5,7 @@ datasafe-simple-adapter de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-simple-adapter/pom.xml b/datasafe-simple-adapter/pom.xml index 554b6c07d..e868b8ea4 100644 --- a/datasafe-simple-adapter/pom.xml +++ b/datasafe-simple-adapter/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-storage/datasafe-storage-api/pom.xml b/datasafe-storage/datasafe-storage-api/pom.xml index 2622ecfd0..5c19f830b 100644 --- a/datasafe-storage/datasafe-storage-api/pom.xml +++ b/datasafe-storage/datasafe-storage-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe-storage - 1.0.3-SNAPSHOT + 1.0.3 datasafe-storage-api diff --git a/datasafe-storage/datasafe-storage-impl-db/pom.xml b/datasafe-storage/datasafe-storage-impl-db/pom.xml index ec41daabd..8693a50d0 100644 --- a/datasafe-storage/datasafe-storage-impl-db/pom.xml +++ b/datasafe-storage/datasafe-storage-impl-db/pom.xml @@ -5,7 +5,7 @@ datasafe-storage de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-storage/datasafe-storage-impl-fs/pom.xml b/datasafe-storage/datasafe-storage-impl-fs/pom.xml index 94374c7da..a02a779da 100644 --- a/datasafe-storage/datasafe-storage-impl-fs/pom.xml +++ b/datasafe-storage/datasafe-storage-impl-fs/pom.xml @@ -5,7 +5,7 @@ datasafe-storage de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-storage/datasafe-storage-impl-s3/pom.xml b/datasafe-storage/datasafe-storage-impl-s3/pom.xml index 4048133ce..1163d2b4b 100644 --- a/datasafe-storage/datasafe-storage-impl-s3/pom.xml +++ b/datasafe-storage/datasafe-storage-impl-s3/pom.xml @@ -5,7 +5,7 @@ datasafe-storage de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-storage/pom.xml b/datasafe-storage/pom.xml index 845bda442..cf926dd4a 100644 --- a/datasafe-storage/pom.xml +++ b/datasafe-storage/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-test-storages/pom.xml b/datasafe-test-storages/pom.xml index 0fd474866..6a9f2a8e9 100644 --- a/datasafe-test-storages/pom.xml +++ b/datasafe-test-storages/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/datasafe-types-api/pom.xml b/datasafe-types-api/pom.xml index b7ffeb221..d987476ad 100644 --- a/datasafe-types-api/pom.xml +++ b/datasafe-types-api/pom.xml @@ -5,7 +5,7 @@ de.adorsys datasafe - 1.0.3-SNAPSHOT + 1.0.3 datasafe-types-api diff --git a/last-module-codecoverage-check/pom.xml b/last-module-codecoverage-check/pom.xml index 55037c179..8d377f7a6 100644 --- a/last-module-codecoverage-check/pom.xml +++ b/last-module-codecoverage-check/pom.xml @@ -5,7 +5,7 @@ datasafe de.adorsys - 1.0.3-SNAPSHOT + 1.0.3 4.0.0 diff --git a/pom.xml b/pom.xml index b8387c553..e44daf4a6 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ de.adorsys datasafe - 1.0.3-SNAPSHOT + 1.0.3 datasafe Datasafe https://github.com/adorsys/datasafe