From 7062d41cf5cecbb4e0564b3649f463cd0fbba9df Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 8 Feb 2023 09:57:30 +0100 Subject: [PATCH] E2E sharing Signed-off-by: tobiasKaminsky fix detekt, spotless Signed-off-by: tobiasKaminsky re-add Project.xml Signed-off-by: tobiasKaminsky Licenses Signed-off-by: tobiasKaminsky Added test Signed-off-by: tobiasKaminsky migrate CsrHelper to Kotlin Signed-off-by: tobiasKaminsky fix lint Signed-off-by: tobiasKaminsky fix some spotbugs Signed-off-by: tobiasKaminsky temporarily disable test Signed-off-by: tobiasKaminsky --- .drone.yml | 4 +- .idea/codeStyles/Project.xml | 4 +- library/build.gradle | 7 +- library/lint.xml | 29 ++++ ... => GetCapabilitiesRemoteOperationIT.java} | 25 +-- .../e2ee/SendCSRRemoteOperationIT.kt | 73 +++++++++ .../e2ee/UpdateMetadataRemoteOperationIT.java | 153 ++++++++++++++---- .../com/nextcloud/common/OkHttpMethodBase.kt | 5 + .../com/nextcloud/operations/PostMethod.kt | 1 + .../android/lib/resources/e2ee/CsrHelper.kt | 112 +++++++++++++ .../e2ee/GetMetadataRemoteOperation.java | 47 ++++-- .../e2ee/LockFileRemoteOperation.java | 42 +++-- .../lib/resources/e2ee/MetadataResponse.kt | 30 ++++ .../e2ee/StoreMetadataRemoteOperation.java | 2 +- .../e2ee/StoreMetadataV2RemoteOperation.kt | 110 +++++++++++++ .../e2ee/ToggleEncryptionRemoteOperation.java | 19 +-- .../e2ee/UnlockFileRemoteOperation.java | 14 +- .../e2ee/UnlockFileV1RemoteOperation.kt | 80 +++++++++ .../e2ee/UpdateMetadataRemoteOperation.java | 9 +- .../e2ee/UpdateMetadataV2RemoteOperation.kt | 132 +++++++++++++++ .../shares/GetShareesRemoteOperation.java | 18 +-- .../shares/GetSharesRemoteOperation.java | 4 +- .../lib/resources/status/E2EVersion.kt | 41 +++++ .../GetCapabilitiesRemoteOperation.java | 4 + .../lib/resources/status/OCCapability.kt | 1 + ....kt => DeletePrivateKeyRemoteOperation.kt} | 27 ++-- ...va => DeletePublicKeyRemoteOperation.java} | 27 ++-- ...java => GetPrivateKeyRemoteOperation.java} | 25 ++- ....java => GetPublicKeyRemoteOperation.java} | 56 ++++--- ...ation.java => SendCSRRemoteOperation.java} | 56 ++++--- ...va => StorePrivateKeyRemoteOperation.java} | 59 +++---- sample_client/build.gradle | 2 + 32 files changed, 982 insertions(+), 236 deletions(-) create mode 100644 library/lint.xml rename library/src/androidTest/java/com/owncloud/android/{GetCapabilitiesIT.java => GetCapabilitiesRemoteOperationIT.java} (93%) create mode 100644 library/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/SendCSRRemoteOperationIT.kt create mode 100644 library/src/main/java/com/owncloud/android/lib/resources/e2ee/CsrHelper.kt create mode 100644 library/src/main/java/com/owncloud/android/lib/resources/e2ee/MetadataResponse.kt create mode 100644 library/src/main/java/com/owncloud/android/lib/resources/e2ee/StoreMetadataV2RemoteOperation.kt create mode 100644 library/src/main/java/com/owncloud/android/lib/resources/e2ee/UnlockFileV1RemoteOperation.kt create mode 100644 library/src/main/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataV2RemoteOperation.kt create mode 100644 library/src/main/java/com/owncloud/android/lib/resources/status/E2EVersion.kt rename library/src/main/java/com/owncloud/android/lib/resources/users/{DeletePrivateKeyOperation.kt => DeletePrivateKeyRemoteOperation.kt} (71%) rename library/src/main/java/com/owncloud/android/lib/resources/users/{DeletePublicKeyOperation.java => DeletePublicKeyRemoteOperation.java} (72%) rename library/src/main/java/com/owncloud/android/lib/resources/users/{GetPrivateKeyOperation.java => GetPrivateKeyRemoteOperation.java} (72%) rename library/src/main/java/com/owncloud/android/lib/resources/users/{GetPublicKeyOperation.java => GetPublicKeyRemoteOperation.java} (64%) rename library/src/main/java/com/owncloud/android/lib/resources/users/{SendCSROperation.java => SendCSRRemoteOperation.java} (65%) rename library/src/main/java/com/owncloud/android/lib/resources/users/{StorePrivateKeyOperation.java => StorePrivateKeyRemoteOperation.java} (60%) diff --git a/.drone.yml b/.drone.yml index e4165d097..5c97b452b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -79,7 +79,7 @@ services: - su www-data -c "php /var/www/html/occ app:enable activity" - su www-data -c "git clone -b main https://github.com/nextcloud/text.git /var/www/html/apps/text/" - su www-data -c "php /var/www/html/occ app:enable text" - - su www-data -c "git clone -b master https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/" + - su www-data -c "git clone -b artonge/feat/allow_metadata_update_for_subfolders https://github.com/nextcloud/end_to_end_encryption/ /var/www/html/apps/end_to_end_encryption/" - su www-data -c "php /var/www/html/occ app:enable end_to_end_encryption" - su www-data -c "git clone -b master https://github.com/nextcloud/password_policy/ /var/www/html/apps/password_policy/" - su www-data -c "php /var/www/html/occ app:enable password_policy" @@ -213,6 +213,6 @@ trigger: - pull_request --- kind: signature -hmac: 6d69c7c3739747691580d04a781eb67cf95d2f33f8149d5ebd2cbcc30611b4f0 +hmac: 56749c47df149cc2d3c06343c609210a310e27635ea6ccb040890ab0afbce79d ... diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml index c7699d0ba..f9fc0166c 100644 --- a/.idea/codeStyles/Project.xml +++ b/.idea/codeStyles/Project.xml @@ -6,8 +6,6 @@ -