From 18b271665d84e1596ec813d69e5571e27f081bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Mon, 21 Dec 2020 14:02:10 +0100 Subject: [PATCH 01/49] Get OIDC discovery config --- .../oauth/GetOIDCDiscoveryRemoteOperation.kt | 94 +++++++++++++++++++ .../oauth/responses/OIDCDiscoveryResponse.kt | 43 +++++++++ .../resources/oauth/services/OIDCService.kt | 33 +++++++ .../services/implementation/OCOIDCService.kt | 44 +++++++++ 4 files changed, 214 insertions(+) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/OIDCDiscoveryResponse.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt new file mode 100644 index 00000000..204a939e --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt @@ -0,0 +1,94 @@ +/* ownCloud Android Library is available under MIT license + * + * @author Abel García de Prada + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +package com.owncloud.android.lib.resources.oauth + +import com.owncloud.android.lib.common.OwnCloudClient +import com.owncloud.android.lib.common.http.HttpConstants +import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod +import com.owncloud.android.lib.common.operations.RemoteOperation +import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.Moshi +import timber.log.Timber +import java.net.URL + +/** + * Get OIDC Discovery + * + * @author Abel García de Prada + */ +class GetOIDCDiscoveryRemoteOperation : RemoteOperation() { + + override fun run(client: OwnCloudClient): RemoteOperationResult { + var result: RemoteOperationResult + + try { + val uriBuilder = client.baseUri.buildUpon().apply { + appendPath(WELL_KNOWN_PATH) // avoid starting "/" in this method + appendPath(OPENID_CONFIGURATION_RESOURCE) + }.build() + + val getMethod = GetMethod(URL(uriBuilder.toString())).apply { + addRequestHeader(OCS_API_HEADER, OCS_API_HEADER_VALUE) + } + + val status = client.executeHttpMethod(getMethod) + + val responseBody = getMethod.getResponseBodyAsString() + + if (status == HttpConstants.HTTP_OK && responseBody != null) { + Timber.d("Successful response $responseBody") + + // Parse the response + val moshi: Moshi = Moshi.Builder().build() + val jsonAdapter: JsonAdapter = moshi.adapter(OIDCDiscoveryResponse::class.java) + val oidcDiscoveryResponse: OIDCDiscoveryResponse? = jsonAdapter.fromJson(responseBody) + + result = RemoteOperationResult(RemoteOperationResult.ResultCode.OK) + result.data = oidcDiscoveryResponse + + Timber.d("Get OIDC Discovery completed and parsed to $oidcDiscoveryResponse") + } else { + result = RemoteOperationResult(getMethod) + Timber.e("Failed response while getting OIDC server discovery from the server status code: $status; response message: $responseBody") + } + + } catch (e: Exception) { + result = RemoteOperationResult(e) + Timber.e(e, "Exception while getting OIDC server discovery") + } + + return result + } + + companion object { + private const val WELL_KNOWN_PATH = ".well-known" + private const val OPENID_CONFIGURATION_RESOURCE = "openid-configuration" + + } +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/OIDCDiscoveryResponse.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/OIDCDiscoveryResponse.kt new file mode 100644 index 00000000..7072bc1f --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/OIDCDiscoveryResponse.kt @@ -0,0 +1,43 @@ +/* ownCloud Android Library is available under MIT license + * + * @author Abel García de Prada + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +package com.owncloud.android.lib.resources.oauth.responses + +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class OIDCDiscoveryResponse( + val authorization_endpoint: String, + val check_session_iframe: String, + val end_session_endpoint: String, + val issuer: String, + val registration_endpoint: String, + val response_types_supported: List, + val scopes_supported: List, + val token_endpoint: String, + val token_endpoint_auth_methods_supported: List, + val userinfo_endpoint: String, +) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt new file mode 100644 index 00000000..6716baf5 --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt @@ -0,0 +1,33 @@ +/* ownCloud Android Library is available under MIT license + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.owncloud.android.lib.resources.oauth.services + +import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse + +interface OIDCService { + + fun getOIDCServerDiscovery(baseUrl: String): RemoteOperationResult + +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt new file mode 100644 index 00000000..294f6d5f --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt @@ -0,0 +1,44 @@ +/* ownCloud Android Library is available under MIT license + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.owncloud.android.lib.resources.oauth.services.implementation + +import android.net.Uri +import com.owncloud.android.lib.common.OwnCloudClient +import com.owncloud.android.lib.common.authentication.OwnCloudCredentialsFactory +import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.GetOIDCDiscoveryRemoteOperation +import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse +import com.owncloud.android.lib.resources.oauth.services.OIDCService + +class OCOIDCService() : OIDCService { + + override fun getOIDCServerDiscovery(baseUrl: String): RemoteOperationResult = + GetOIDCDiscoveryRemoteOperation().execute(createClientFromPath(baseUrl)) + + private fun createClientFromPath(path: String): OwnCloudClient = + OwnCloudClient(Uri.parse(path)).apply { + credentials = OwnCloudCredentialsFactory.getAnonymousCredentials() + } + +} From 0fc3f7668ddce2af276b0538b80616f03c33f92f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Thu, 19 Nov 2020 19:05:48 +0100 Subject: [PATCH 02/49] Use the same ownCloudClient across the whole login process --- .../status/services/ServerInfoService.kt | 5 ++-- .../implementation/OCServerInfoService.kt | 24 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt index 1efa7f1b..121f617f 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt @@ -23,11 +23,12 @@ */ package com.owncloud.android.lib.resources.status.services +import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.resources.status.OwnCloudVersion interface ServerInfoService { - fun checkPathExistence(path: String, isUserLogged: Boolean): RemoteOperationResult + fun checkPathExistence(path: String, isUserLogged: Boolean, client: OwnCloudClient): RemoteOperationResult - fun getRemoteStatus(path: String): RemoteOperationResult + fun getRemoteStatus(path: String, client: OwnCloudClient): RemoteOperationResult } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt index 76f82a46..65b85479 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt @@ -19,26 +19,28 @@ package com.owncloud.android.lib.resources.status.services.implementation -import android.net.Uri import com.owncloud.android.lib.common.OwnCloudClient -import com.owncloud.android.lib.common.authentication.OwnCloudCredentialsFactory.getAnonymousCredentials import com.owncloud.android.lib.common.operations.RemoteOperationResult -import com.owncloud.android.lib.resources.status.services.ServerInfoService import com.owncloud.android.lib.resources.files.CheckPathExistenceRemoteOperation import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation import com.owncloud.android.lib.resources.status.OwnCloudVersion +import com.owncloud.android.lib.resources.status.services.ServerInfoService class OCServerInfoService : ServerInfoService { - override fun checkPathExistence(path: String, isUserLogged: Boolean): RemoteOperationResult = + + override fun checkPathExistence( + path: String, + isUserLogged: Boolean, + client: OwnCloudClient + ): RemoteOperationResult = CheckPathExistenceRemoteOperation( remotePath = path, isUserLogged = true - ).execute(createClientFromPath(path)) + ).execute(client) - override fun getRemoteStatus(path: String): RemoteOperationResult = - GetRemoteStatusOperation().execute(createClientFromPath(path)) - - private fun createClientFromPath(path: String): OwnCloudClient { - return OwnCloudClient(Uri.parse(path)).apply { credentials = getAnonymousCredentials() } - } + override fun getRemoteStatus( + path: String, + client: OwnCloudClient + ): RemoteOperationResult = + GetRemoteStatusOperation().execute(client) } From f289746c2f2d8db5f644e7f11491869f0eedf0e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 22 Dec 2020 09:49:49 +0100 Subject: [PATCH 03/49] Use ownCloud client base url to perform oidc discovery --- .../lib/resources/oauth/services/OIDCService.kt | 3 ++- .../oauth/services/implementation/OCOIDCService.kt | 13 ++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt index 6716baf5..d877370f 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt @@ -23,11 +23,12 @@ */ package com.owncloud.android.lib.resources.oauth.services +import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse interface OIDCService { - fun getOIDCServerDiscovery(baseUrl: String): RemoteOperationResult + fun getOIDCServerDiscovery(ownCloudClient: OwnCloudClient): RemoteOperationResult } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt index 294f6d5f..ab74ba4b 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt @@ -23,9 +23,7 @@ */ package com.owncloud.android.lib.resources.oauth.services.implementation -import android.net.Uri import com.owncloud.android.lib.common.OwnCloudClient -import com.owncloud.android.lib.common.authentication.OwnCloudCredentialsFactory import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.resources.oauth.GetOIDCDiscoveryRemoteOperation import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse @@ -33,12 +31,9 @@ import com.owncloud.android.lib.resources.oauth.services.OIDCService class OCOIDCService() : OIDCService { - override fun getOIDCServerDiscovery(baseUrl: String): RemoteOperationResult = - GetOIDCDiscoveryRemoteOperation().execute(createClientFromPath(baseUrl)) - - private fun createClientFromPath(path: String): OwnCloudClient = - OwnCloudClient(Uri.parse(path)).apply { - credentials = OwnCloudCredentialsFactory.getAnonymousCredentials() - } + override fun getOIDCServerDiscovery( + ownCloudClient: OwnCloudClient + ): RemoteOperationResult = + GetOIDCDiscoveryRemoteOperation().execute(ownCloudClient) } From 44967be4e3a2d0dded868927478517633ff98218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 22 Dec 2020 15:39:39 +0100 Subject: [PATCH 04/49] First draft of request token implementation --- .../android/lib/common/OwnCloudClient.java | 10 +- .../OwnCloudCredentialsFactory.java | 4 - .../lib/common/http/HttpConstants.java | 6 + .../oauth/TokenRequestRemoteOperation.kt | 104 ++++++++++++++++++ .../oauth/params/TokenRequestParams.kt | 33 ++++++ .../oauth/responses/TokenResponse.kt | 45 ++++++++ .../resources/oauth/services/OIDCService.kt | 7 ++ .../services/implementation/OCOIDCService.kt | 11 +- 8 files changed, 210 insertions(+), 10 deletions(-) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java index 331ad7a0..8d27c34a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClient.java @@ -48,15 +48,15 @@ import java.io.IOException; import java.io.InputStream; import java.util.List; +import static com.owncloud.android.lib.common.http.HttpConstants.AUTHORIZATION_HEADER; import static com.owncloud.android.lib.common.http.HttpConstants.OC_X_REQUEST_ID; public class OwnCloudClient extends HttpClient { public static final String WEBDAV_FILES_PATH_4_0 = "/remote.php/dav/files/"; public static final String WEBDAV_PATH_4_0_AND_LATER = "/remote.php/dav"; - private static final String WEBDAV_UPLOADS_PATH_4_0 = "/remote.php/dav/uploads/"; public static final String STATUS_PATH = "/status.php"; - + private static final String WEBDAV_UPLOADS_PATH_4_0 = "/remote.php/dav/uploads/"; private static final int MAX_REDIRECTIONS_COUNT = 3; private static final int MAX_REPEAT_COUNT_WITH_FRESH_CREDENTIALS = 1; @@ -104,8 +104,8 @@ public class OwnCloudClient extends HttpClient { method.setRequestHeader(HttpConstants.OC_X_REQUEST_ID, requestId); method.setRequestHeader(HttpConstants.USER_AGENT_HEADER, SingleSessionManager.getUserAgent()); method.setRequestHeader(HttpConstants.ACCEPT_ENCODING_HEADER, HttpConstants.ACCEPT_ENCODING_IDENTITY); - if (mCredentials.getHeaderAuth() != null) { - method.setRequestHeader(HttpConstants.AUTHORIZATION_HEADER, mCredentials.getHeaderAuth()); + if (mCredentials.getHeaderAuth() != null && method.getRequestHeader(AUTHORIZATION_HEADER) == null) { + method.setRequestHeader(AUTHORIZATION_HEADER, mCredentials.getHeaderAuth()); } status = method.execute(); @@ -136,7 +136,7 @@ public class OwnCloudClient extends HttpClient { method.setRequestHeader(HttpConstants.USER_AGENT_HEADER, SingleSessionManager.getUserAgent()); method.setRequestHeader(HttpConstants.ACCEPT_ENCODING_HEADER, HttpConstants.ACCEPT_ENCODING_IDENTITY); if (mCredentials.getHeaderAuth() != null) { - method.setRequestHeader(HttpConstants.AUTHORIZATION_HEADER, mCredentials.getHeaderAuth()); + method.setRequestHeader(AUTHORIZATION_HEADER, mCredentials.getHeaderAuth()); } status = method.execute(); diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/OwnCloudCredentialsFactory.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/OwnCloudCredentialsFactory.java index 3d5dae91..621a5c75 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/OwnCloudCredentialsFactory.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/authentication/OwnCloudCredentialsFactory.java @@ -24,10 +24,6 @@ package com.owncloud.android.lib.common.authentication; -import com.owncloud.android.lib.common.OwnCloudClient; -import com.owncloud.android.lib.common.http.HttpClient; -import com.owncloud.android.lib.common.http.HttpConstants; - public class OwnCloudCredentialsFactory { public static final String CREDENTIAL_CHARSET = "UTF-8"; diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java index b86534a3..4a2eb327 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java @@ -51,6 +51,12 @@ public class HttpConstants { public static final String ACCEPT_ENCODING_IDENTITY = "identity"; public static final String OC_FILE_REMOTE_ID = "OC-FileId"; + // OAuth + public static final String HEADER_AUTHORIZATION_CODE = "code"; + public static final String HEADER_GRANT_TYPE = "grant_type"; + public static final String HEADER_REDIRECT_URI = "redirect_uri"; + public static final String HEADER_CODE_VERIFIER = "code_verifier"; + /*********************************************************************************************************** ************************************************ CONTENT TYPES ******************************************** ***********************************************************************************************************/ diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt new file mode 100644 index 00000000..3f96d3fd --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt @@ -0,0 +1,104 @@ +/* ownCloud Android Library is available under MIT license + * + * @author Abel García de Prada + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +package com.owncloud.android.lib.resources.oauth + +import com.owncloud.android.lib.common.OwnCloudClient +import com.owncloud.android.lib.common.http.HttpConstants.AUTHORIZATION_HEADER +import com.owncloud.android.lib.common.http.HttpConstants.HEADER_AUTHORIZATION_CODE +import com.owncloud.android.lib.common.http.HttpConstants.HEADER_CODE_VERIFIER +import com.owncloud.android.lib.common.http.HttpConstants.HEADER_GRANT_TYPE +import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REDIRECT_URI +import com.owncloud.android.lib.common.http.HttpConstants.HTTP_OK +import com.owncloud.android.lib.common.http.methods.nonwebdav.PostMethod +import com.owncloud.android.lib.common.operations.RemoteOperation +import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.params.TokenRequestParams +import com.owncloud.android.lib.resources.oauth.responses.TokenResponse +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.Moshi +import okhttp3.FormBody +import okio.ByteString.Companion.encodeUtf8 +import timber.log.Timber +import java.net.URL + +/** + * Get OIDC Discovery + * + * @author Abel García de Prada + */ +class TokenRequestRemoteOperation( + private val tokenRequestParams: TokenRequestParams +) : RemoteOperation() { + + override fun run(client: OwnCloudClient): RemoteOperationResult { + var result: RemoteOperationResult + + try { + val uriBuilder = client.baseUri.buildUpon().apply { + appendEncodedPath(tokenRequestParams.tokenEndpoint) + }.build() + + val requestBody = FormBody.Builder() + .add(HEADER_AUTHORIZATION_CODE, tokenRequestParams.authorizationCode) + .add(HEADER_GRANT_TYPE, tokenRequestParams.grantType) + .add(HEADER_REDIRECT_URI, tokenRequestParams.redirectUri) + .add(HEADER_CODE_VERIFIER, tokenRequestParams.codeVerifier) + .build() + + val postMethod = PostMethod(URL(uriBuilder.toString()), requestBody) + + postMethod.addRequestHeader(AUTHORIZATION_HEADER, tokenRequestParams.clientAuth) + + val status = client.executeHttpMethod(postMethod) + + val responseBody = postMethod.getResponseBodyAsString() + + if (status == HTTP_OK && responseBody != null) { + Timber.d("Successful response $responseBody") + + // Parse the response + val moshi: Moshi = Moshi.Builder().build() + val jsonAdapter: JsonAdapter = moshi.adapter(TokenResponse::class.java) + val tokenResponse: TokenResponse? = jsonAdapter.fromJson(responseBody) + + result = RemoteOperationResult(RemoteOperationResult.ResultCode.OK) + result.data = tokenResponse + + Timber.d("Get tokens completed and parsed to $tokenResponse") + } else { + result = RemoteOperationResult(postMethod) + Timber.e("Failed response while getting tokens from the server status code: $status; response message: $responseBody") + } + + } catch (e: Exception) { + result = RemoteOperationResult(e) + Timber.e(e, "Exception while getting tokens") + } + + return result + } +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt new file mode 100644 index 00000000..3ac743be --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt @@ -0,0 +1,33 @@ +/* ownCloud Android Library is available under MIT license + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ +package com.owncloud.android.lib.resources.oauth.params + +class TokenRequestParams( + val tokenEndpoint: String, + val authorizationCode: String, + val grantType: String, + val redirectUri: String, + val codeVerifier: String, + val clientAuth: String +) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt new file mode 100644 index 00000000..05b0ea8c --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt @@ -0,0 +1,45 @@ +/* ownCloud Android Library is available under MIT license + * + * Copyright (C) 2020 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +package com.owncloud.android.lib.resources.oauth.responses + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class TokenResponse( + @Json(name = "access_token") + val accessToken: String, + @Json(name = "expires_in") + val expiresIn: Int, + @Json(name = "refresh_token") + val refreshToken: String, + @Json(name = "token_type") + val tokenType: String, + @Json(name = "user_id") + val userId: String?, + val scope: String?, + @Json(name = "additional_parameters") + val additionalParameters: Map? +) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt index d877370f..8955e6ba 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt @@ -25,10 +25,17 @@ package com.owncloud.android.lib.resources.oauth.services import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.params.TokenRequestParams import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse +import com.owncloud.android.lib.resources.oauth.responses.TokenResponse interface OIDCService { fun getOIDCServerDiscovery(ownCloudClient: OwnCloudClient): RemoteOperationResult + fun performTokenRequest( + ownCloudClient: OwnCloudClient, + tokenRequest: TokenRequestParams + ): RemoteOperationResult + } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt index ab74ba4b..abc069af 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt @@ -26,14 +26,23 @@ package com.owncloud.android.lib.resources.oauth.services.implementation import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.resources.oauth.GetOIDCDiscoveryRemoteOperation +import com.owncloud.android.lib.resources.oauth.TokenRequestRemoteOperation +import com.owncloud.android.lib.resources.oauth.params.TokenRequestParams import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse +import com.owncloud.android.lib.resources.oauth.responses.TokenResponse import com.owncloud.android.lib.resources.oauth.services.OIDCService -class OCOIDCService() : OIDCService { +class OCOIDCService : OIDCService { override fun getOIDCServerDiscovery( ownCloudClient: OwnCloudClient ): RemoteOperationResult = GetOIDCDiscoveryRemoteOperation().execute(ownCloudClient) + override fun performTokenRequest( + ownCloudClient: OwnCloudClient, + tokenRequest: TokenRequestParams + ): RemoteOperationResult = + TokenRequestRemoteOperation(tokenRequest).execute(ownCloudClient) + } From d683da36020d0d2c4c42c44878b89b3141b07639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 23 Dec 2020 14:01:08 +0100 Subject: [PATCH 05/49] Support refresh token with own idP --- .../com/owncloud/android/lib/common/http/HttpConstants.java | 1 + .../lib/resources/oauth/TokenRequestRemoteOperation.kt | 4 +++- .../android/lib/resources/oauth/params/TokenRequestParams.kt | 1 + .../android/lib/resources/oauth/responses/TokenResponse.kt | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java index 4a2eb327..cab87f26 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java @@ -56,6 +56,7 @@ public class HttpConstants { public static final String HEADER_GRANT_TYPE = "grant_type"; public static final String HEADER_REDIRECT_URI = "redirect_uri"; public static final String HEADER_CODE_VERIFIER = "code_verifier"; + public static final String HEADER_REFRESH_TOKEN = "refresh_token"; /*********************************************************************************************************** ************************************************ CONTENT TYPES ******************************************** diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt index 3f96d3fd..25c18903 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt @@ -32,6 +32,7 @@ import com.owncloud.android.lib.common.http.HttpConstants.HEADER_AUTHORIZATION_C import com.owncloud.android.lib.common.http.HttpConstants.HEADER_CODE_VERIFIER import com.owncloud.android.lib.common.http.HttpConstants.HEADER_GRANT_TYPE import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REDIRECT_URI +import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REFRESH_TOKEN import com.owncloud.android.lib.common.http.HttpConstants.HTTP_OK import com.owncloud.android.lib.common.http.methods.nonwebdav.PostMethod import com.owncloud.android.lib.common.operations.RemoteOperation @@ -46,7 +47,7 @@ import timber.log.Timber import java.net.URL /** - * Get OIDC Discovery + * Perform token request * * @author Abel García de Prada */ @@ -67,6 +68,7 @@ class TokenRequestRemoteOperation( .add(HEADER_GRANT_TYPE, tokenRequestParams.grantType) .add(HEADER_REDIRECT_URI, tokenRequestParams.redirectUri) .add(HEADER_CODE_VERIFIER, tokenRequestParams.codeVerifier) + .add(HEADER_REFRESH_TOKEN, tokenRequestParams.refreshToken.orEmpty()) .build() val postMethod = PostMethod(URL(uriBuilder.toString()), requestBody) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt index 3ac743be..00b34f85 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt @@ -28,6 +28,7 @@ class TokenRequestParams( val authorizationCode: String, val grantType: String, val redirectUri: String, + val refreshToken: String? = null, val codeVerifier: String, val clientAuth: String ) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt index 05b0ea8c..f7fdc87a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/TokenResponse.kt @@ -34,7 +34,7 @@ data class TokenResponse( @Json(name = "expires_in") val expiresIn: Int, @Json(name = "refresh_token") - val refreshToken: String, + val refreshToken: String?, @Json(name = "token_type") val tokenType: String, @Json(name = "user_id") From 9208af89fe082cca49100346ad5c0983e4fc85d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 23 Dec 2020 15:57:30 +0100 Subject: [PATCH 06/49] Support refresh token with any idP --- .../lib/resources/oauth/TokenRequestRemoteOperation.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt index 25c18903..c927d11b 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt @@ -59,10 +59,6 @@ class TokenRequestRemoteOperation( var result: RemoteOperationResult try { - val uriBuilder = client.baseUri.buildUpon().apply { - appendEncodedPath(tokenRequestParams.tokenEndpoint) - }.build() - val requestBody = FormBody.Builder() .add(HEADER_AUTHORIZATION_CODE, tokenRequestParams.authorizationCode) .add(HEADER_GRANT_TYPE, tokenRequestParams.grantType) @@ -71,7 +67,7 @@ class TokenRequestRemoteOperation( .add(HEADER_REFRESH_TOKEN, tokenRequestParams.refreshToken.orEmpty()) .build() - val postMethod = PostMethod(URL(uriBuilder.toString()), requestBody) + val postMethod = PostMethod(URL(tokenRequestParams.tokenEndpoint), requestBody) postMethod.addRequestHeader(AUTHORIZATION_HEADER, tokenRequestParams.clientAuth) From df8e10fac3e589150c67a1a9a43fea886d2b170d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 23 Dec 2020 18:00:11 +0100 Subject: [PATCH 07/49] Polish code. Send only info required for each type of request --- .../oauth/TokenRequestRemoteOperation.kt | 8 +-- .../oauth/params/TokenRequestParams.kt | 55 ++++++++++++++++--- 2 files changed, 48 insertions(+), 15 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt index c927d11b..79bba2e3 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt @@ -59,13 +59,7 @@ class TokenRequestRemoteOperation( var result: RemoteOperationResult try { - val requestBody = FormBody.Builder() - .add(HEADER_AUTHORIZATION_CODE, tokenRequestParams.authorizationCode) - .add(HEADER_GRANT_TYPE, tokenRequestParams.grantType) - .add(HEADER_REDIRECT_URI, tokenRequestParams.redirectUri) - .add(HEADER_CODE_VERIFIER, tokenRequestParams.codeVerifier) - .add(HEADER_REFRESH_TOKEN, tokenRequestParams.refreshToken.orEmpty()) - .build() + val requestBody = tokenRequestParams.toRequestBody() val postMethod = PostMethod(URL(tokenRequestParams.tokenEndpoint), requestBody) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt index 00b34f85..bc1a1293 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt @@ -23,12 +23,51 @@ */ package com.owncloud.android.lib.resources.oauth.params -class TokenRequestParams( +import com.owncloud.android.lib.common.http.HttpConstants +import okhttp3.FormBody +import okhttp3.RequestBody + +sealed class TokenRequestParams( val tokenEndpoint: String, - val authorizationCode: String, - val grantType: String, - val redirectUri: String, - val refreshToken: String? = null, - val codeVerifier: String, - val clientAuth: String -) + val clientAuth: String, + val grantType: String +) { + abstract fun toRequestBody(): RequestBody + + class Authorization( + tokenEndpoint: String, + clientAuth: String, + grantType: String, + val authorizationCode: String, + val redirectUri: String, + val codeVerifier: String + ) : TokenRequestParams(tokenEndpoint, clientAuth, grantType) { + + override fun toRequestBody(): RequestBody { + return FormBody.Builder() + .add(HttpConstants.HEADER_AUTHORIZATION_CODE, authorizationCode) + .add(HttpConstants.HEADER_GRANT_TYPE, grantType) + .add(HttpConstants.HEADER_REDIRECT_URI, redirectUri) + .add(HttpConstants.HEADER_CODE_VERIFIER, codeVerifier) + .build() + } + } + + class RefreshToken( + tokenEndpoint: String, + clientAuth: String, + grantType: String, + val refreshToken: String? = null + ) : TokenRequestParams(tokenEndpoint, clientAuth, grantType) { + + override fun toRequestBody(): RequestBody { + return FormBody.Builder().apply { + add(HttpConstants.HEADER_GRANT_TYPE, grantType) + if (!refreshToken.isNullOrBlank()) { + add(HttpConstants.HEADER_REFRESH_TOKEN, refreshToken) + } + }.build() + + } + } +} From 44a13f98780fa269a7e909c733e507f8c6f370e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 13 Jan 2021 15:34:07 +0100 Subject: [PATCH 08/49] Polish a little bit the code --- .../owncloud/android/lib/common/http/HttpConstants.java | 1 - .../lib/resources/oauth/TokenRequestRemoteOperation.kt | 7 ------- .../lib/resources/oauth/params/TokenRequestParams.kt | 4 +--- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java index cab87f26..63acd52e 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java @@ -55,7 +55,6 @@ public class HttpConstants { public static final String HEADER_AUTHORIZATION_CODE = "code"; public static final String HEADER_GRANT_TYPE = "grant_type"; public static final String HEADER_REDIRECT_URI = "redirect_uri"; - public static final String HEADER_CODE_VERIFIER = "code_verifier"; public static final String HEADER_REFRESH_TOKEN = "refresh_token"; /*********************************************************************************************************** diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt index 79bba2e3..cd3c9763 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt @@ -28,11 +28,6 @@ package com.owncloud.android.lib.resources.oauth import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.http.HttpConstants.AUTHORIZATION_HEADER -import com.owncloud.android.lib.common.http.HttpConstants.HEADER_AUTHORIZATION_CODE -import com.owncloud.android.lib.common.http.HttpConstants.HEADER_CODE_VERIFIER -import com.owncloud.android.lib.common.http.HttpConstants.HEADER_GRANT_TYPE -import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REDIRECT_URI -import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REFRESH_TOKEN import com.owncloud.android.lib.common.http.HttpConstants.HTTP_OK import com.owncloud.android.lib.common.http.methods.nonwebdav.PostMethod import com.owncloud.android.lib.common.operations.RemoteOperation @@ -41,8 +36,6 @@ import com.owncloud.android.lib.resources.oauth.params.TokenRequestParams import com.owncloud.android.lib.resources.oauth.responses.TokenResponse import com.squareup.moshi.JsonAdapter import com.squareup.moshi.Moshi -import okhttp3.FormBody -import okio.ByteString.Companion.encodeUtf8 import timber.log.Timber import java.net.URL diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt index bc1a1293..1a1109b0 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt @@ -39,8 +39,7 @@ sealed class TokenRequestParams( clientAuth: String, grantType: String, val authorizationCode: String, - val redirectUri: String, - val codeVerifier: String + val redirectUri: String ) : TokenRequestParams(tokenEndpoint, clientAuth, grantType) { override fun toRequestBody(): RequestBody { @@ -48,7 +47,6 @@ sealed class TokenRequestParams( .add(HttpConstants.HEADER_AUTHORIZATION_CODE, authorizationCode) .add(HttpConstants.HEADER_GRANT_TYPE, grantType) .add(HttpConstants.HEADER_REDIRECT_URI, redirectUri) - .add(HttpConstants.HEADER_CODE_VERIFIER, codeVerifier) .build() } } From 0d09540f9bc4e52706c2f50e4195517b0319537b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 13 Jan 2021 15:53:08 +0100 Subject: [PATCH 09/49] Apply suggestions from CR --- .../oauth/GetOIDCDiscoveryRemoteOperation.kt | 17 ++++++++--------- .../oauth/TokenRequestRemoteOperation.kt | 18 ++++++++---------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt index 204a939e..9cebcf44 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/GetOIDCDiscoveryRemoteOperation.kt @@ -45,8 +45,6 @@ import java.net.URL class GetOIDCDiscoveryRemoteOperation : RemoteOperation() { override fun run(client: OwnCloudClient): RemoteOperationResult { - var result: RemoteOperationResult - try { val uriBuilder = client.baseUri.buildUpon().apply { appendPath(WELL_KNOWN_PATH) // avoid starting "/" in this method @@ -68,22 +66,23 @@ class GetOIDCDiscoveryRemoteOperation : RemoteOperation() val moshi: Moshi = Moshi.Builder().build() val jsonAdapter: JsonAdapter = moshi.adapter(OIDCDiscoveryResponse::class.java) val oidcDiscoveryResponse: OIDCDiscoveryResponse? = jsonAdapter.fromJson(responseBody) + Timber.d("Get OIDC Discovery completed and parsed to [$oidcDiscoveryResponse]") - result = RemoteOperationResult(RemoteOperationResult.ResultCode.OK) - result.data = oidcDiscoveryResponse + return RemoteOperationResult(RemoteOperationResult.ResultCode.OK).apply { + data = oidcDiscoveryResponse + } - Timber.d("Get OIDC Discovery completed and parsed to $oidcDiscoveryResponse") } else { - result = RemoteOperationResult(getMethod) Timber.e("Failed response while getting OIDC server discovery from the server status code: $status; response message: $responseBody") + + return RemoteOperationResult(getMethod) } } catch (e: Exception) { - result = RemoteOperationResult(e) Timber.e(e, "Exception while getting OIDC server discovery") - } - return result + return RemoteOperationResult(e) + } } companion object { diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt index cd3c9763..67253c4c 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/TokenRequestRemoteOperation.kt @@ -49,8 +49,6 @@ class TokenRequestRemoteOperation( ) : RemoteOperation() { override fun run(client: OwnCloudClient): RemoteOperationResult { - var result: RemoteOperationResult - try { val requestBody = tokenRequestParams.toRequestBody() @@ -69,21 +67,21 @@ class TokenRequestRemoteOperation( val moshi: Moshi = Moshi.Builder().build() val jsonAdapter: JsonAdapter = moshi.adapter(TokenResponse::class.java) val tokenResponse: TokenResponse? = jsonAdapter.fromJson(responseBody) - - result = RemoteOperationResult(RemoteOperationResult.ResultCode.OK) - result.data = tokenResponse - Timber.d("Get tokens completed and parsed to $tokenResponse") + + return RemoteOperationResult(RemoteOperationResult.ResultCode.OK).apply { + data = tokenResponse + } + } else { - result = RemoteOperationResult(postMethod) Timber.e("Failed response while getting tokens from the server status code: $status; response message: $responseBody") + return RemoteOperationResult(postMethod) } } catch (e: Exception) { - result = RemoteOperationResult(e) Timber.e(e, "Exception while getting tokens") - } + return RemoteOperationResult(e) - return result + } } } From 9ae720502f42fe7bdbe0d3154f79f8bf3aacc4aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 20 Jan 2021 12:42:29 +0100 Subject: [PATCH 10/49] Apply Code Review suggestions --- .../android/lib/common/http/HttpConstants.java | 8 ++++---- .../lib/resources/oauth/params/TokenRequestParams.kt | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java index 63acd52e..ad8c6d1c 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java @@ -52,10 +52,10 @@ public class HttpConstants { public static final String OC_FILE_REMOTE_ID = "OC-FileId"; // OAuth - public static final String HEADER_AUTHORIZATION_CODE = "code"; - public static final String HEADER_GRANT_TYPE = "grant_type"; - public static final String HEADER_REDIRECT_URI = "redirect_uri"; - public static final String HEADER_REFRESH_TOKEN = "refresh_token"; + public static final String OAUTH_HEADER_AUTHORIZATION_CODE = "code"; + public static final String OAUTH_HEADER_GRANT_TYPE = "grant_type"; + public static final String OAUTH_HEADER_REDIRECT_URI = "redirect_uri"; + public static final String OAUTH_HEADER_REFRESH_TOKEN = "refresh_token"; /*********************************************************************************************************** ************************************************ CONTENT TYPES ******************************************** diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt index 1a1109b0..eef3823a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt @@ -44,9 +44,9 @@ sealed class TokenRequestParams( override fun toRequestBody(): RequestBody { return FormBody.Builder() - .add(HttpConstants.HEADER_AUTHORIZATION_CODE, authorizationCode) - .add(HttpConstants.HEADER_GRANT_TYPE, grantType) - .add(HttpConstants.HEADER_REDIRECT_URI, redirectUri) + .add(HttpConstants.OAUTH_HEADER_AUTHORIZATION_CODE, authorizationCode) + .add(HttpConstants.OAUTH_HEADER_GRANT_TYPE, grantType) + .add(HttpConstants.OAUTH_HEADER_REDIRECT_URI, redirectUri) .build() } } @@ -60,9 +60,9 @@ sealed class TokenRequestParams( override fun toRequestBody(): RequestBody { return FormBody.Builder().apply { - add(HttpConstants.HEADER_GRANT_TYPE, grantType) + add(HttpConstants.OAUTH_HEADER_GRANT_TYPE, grantType) if (!refreshToken.isNullOrBlank()) { - add(HttpConstants.HEADER_REFRESH_TOKEN, refreshToken) + add(HttpConstants.OAUTH_HEADER_REFRESH_TOKEN, refreshToken) } }.build() From fbbb1c9adbd638d2b80d793fa91b4d1c3df7bee3 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Tue, 2 Feb 2021 17:27:13 +0100 Subject: [PATCH 11/49] Gradle 6.8.1 --- gradle/wrapper/gradle-wrapper.jar | Bin 53636 -> 59203 bytes gradle/wrapper/gradle-wrapper.properties | 3 +- gradlew | 149 +++++++++++++---------- gradlew.bat | 53 ++++---- 4 files changed, 112 insertions(+), 93 deletions(-) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 13372aef5e24af05341d49695ee84e5f9b594659..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f 100644 GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9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+dw)6Xd@CpQNK$j z{CU;-cmpK=egplZ3y3%y=sEnCJ^eYVKXzV8H2_r*fJ*%*B;a1_lOpt6)IT1IAK2eB z{rie|uDJUrbgfUE>~C>@RO|m5ex55F{=~Bb4Cucp{ok7Yf9V}QuZ`#Gc|WaqsQlK- zKaV)iMRR__&Ak2Z=IM9R9g5$WM4u{a^C-7uX*!myEym z#_#p^T!P~#Dx$%^K>Y_nj_3J*E_LwJ60-5Xu=LkJAwcP@|0;a&+|+ZX`Jbj9P5;T% z|KOc}4*#4o{U?09`9Hz`Xo-I!P=9XfIrr*MQ}y=$!qgv?_J38^bNb4kM&_OVg^_=Eu-qG5U(fw0KMgH){C8pazq~51rN97hf#20-7=aK0)N|UM H-+%o-(+5aQ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 391434d7..28ff446a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Sun Sep 08 09:13:16 CEST 2019 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip diff --git a/gradlew b/gradlew index 91a7e269..4f906e0c 100755 --- a/gradlew +++ b/gradlew @@ -1,4 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## ## @@ -6,47 +22,6 @@ ## ############################################################################## -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# For Cygwin, ensure paths are in UNIX format before anything is touched. -if $cygwin ; then - [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` -fi - # Attempt to set APP_HOME # Resolve links: $0 may be a link PRG="$0" @@ -61,12 +36,53 @@ while [ -h "$PRG" ] ; do fi done SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >&- +cd "`dirname \"$PRG\"`/" >/dev/null APP_HOME="`pwd -P`" -cd "$SAVED" >&- +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then @@ -90,7 +106,7 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then MAX_FD_LIMIT=`ulimit -H -n` if [ $? -eq 0 ] ; then if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then @@ -110,11 +126,13 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + # We build the pattern for arguments to be converted via cygpath ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` SEP="" @@ -138,27 +156,30 @@ if $cygwin ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " } -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +APP_ARGS=`save "$@"` -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index aec99730..ac1b06f9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -8,20 +24,23 @@ @rem Set local scope for the variables with windows NT shell if "%OS%"=="Windows_NT" setlocal -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS= - set DIRNAME=%~dp0 if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,34 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windowz variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell From e792cf6c7048f3cd9ba5309be082aac8d009a256 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Tue, 2 Feb 2021 17:27:36 +0100 Subject: [PATCH 12/49] Android Studio 4.1.2 --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5cb2900a..c5e4736d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlinVersion = '1.4.20' + kotlinVersion = '1.4.21' moshiVersion = "1.9.2" } @@ -9,7 +9,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:4.1.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" } } From 67699ffcc010dc9952d9d6b4635d4a91261ab3f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 9 Feb 2021 12:19:18 +0100 Subject: [PATCH 13/49] Bump kotlinVersion from 1.4.20 to 1.4.30 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c5e4736d..ade0c18c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlinVersion = '1.4.21' + kotlinVersion = '1.4.30' moshiVersion = "1.9.2" } From f35f41688a7baf61698c2bdd116609027c840a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Wed, 27 Jan 2021 12:37:17 +0100 Subject: [PATCH 14/49] Create remote operation to register clients dynamically. --- .../oauth/RegisterClientRemoteOperation.kt | 82 +++++++++++++++++++ .../oauth/params/ClientRegistrationParams.kt | 61 ++++++++++++++ .../responses/ClientRegistrationResponse.kt | 42 ++++++++++ .../resources/oauth/services/OIDCService.kt | 8 +- .../services/implementation/OCOIDCService.kt | 11 ++- 5 files changed, 202 insertions(+), 2 deletions(-) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/ClientRegistrationResponse.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt new file mode 100644 index 00000000..720035a7 --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt @@ -0,0 +1,82 @@ +/* ownCloud Android Library is available under MIT license + * + * @author Abel García de Prada + * + * Copyright (C) 2021 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ + +package com.owncloud.android.lib.resources.oauth + +import com.owncloud.android.lib.common.OwnCloudClient +import com.owncloud.android.lib.common.http.HttpConstants +import com.owncloud.android.lib.common.http.methods.nonwebdav.PostMethod +import com.owncloud.android.lib.common.operations.RemoteOperation +import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.params.ClientRegistrationParams +import com.owncloud.android.lib.resources.oauth.responses.ClientRegistrationResponse +import com.squareup.moshi.JsonAdapter +import com.squareup.moshi.Moshi +import timber.log.Timber +import java.net.URL + +class RegisterClientRemoteOperation( + private val clientRegistrationParams: ClientRegistrationParams +) : RemoteOperation() { + + override fun run(client: OwnCloudClient): RemoteOperationResult { + try { + val requestBody = clientRegistrationParams.toRequestBody() + + val postMethod = PostMethod(URL(clientRegistrationParams.registrationEndpoint), requestBody) + + val status = client.executeHttpMethod(postMethod) + + val responseBody = postMethod.getResponseBodyAsString() + + if (status == HttpConstants.HTTP_CREATED && responseBody != null) { + Timber.d("Successful response $responseBody") + + // Parse the response + val moshi: Moshi = Moshi.Builder().build() + val jsonAdapter: JsonAdapter = + moshi.adapter(ClientRegistrationResponse::class.java) + val clientRegistrationResponse: ClientRegistrationResponse? = jsonAdapter.fromJson(responseBody) + Timber.d("Client registered and parsed to $clientRegistrationResponse") + + return RemoteOperationResult(RemoteOperationResult.ResultCode.OK).apply { + data = clientRegistrationResponse + } + + } else { + Timber.e("Failed response while registering a new client. Status code: $status; response message: $responseBody") + return RemoteOperationResult(postMethod) + } + + } catch (e: Exception) { + Timber.e(e, "Exception while registering a new client.") + return RemoteOperationResult(e) + + } + + } +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt new file mode 100644 index 00000000..454c5f6c --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt @@ -0,0 +1,61 @@ +/* ownCloud Android Library is available under MIT license + * + * @author Abel García de Prada + * + * Copyright (C) 2021 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +package com.owncloud.android.lib.resources.oauth.params + +import com.owncloud.android.lib.common.http.HttpConstants.CONTENT_TYPE_JSON +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.RequestBody +import okhttp3.RequestBody.Companion.toRequestBody +import org.json.JSONArray +import org.json.JSONObject + +data class ClientRegistrationParams( + val registrationEndpoint: String, + val clientName: String, + val redirectUris: List, + val tokenEndpointAuthMethod: String, + val applicationType: String +) { + fun toRequestBody(): RequestBody { + val jsonObject = JSONObject().apply { + put(PARAM_APPLICATION_TYPE, applicationType) + put(PARAM_CLIENT_NAME, clientName) + put(PARAM_REDIRECT_URIS, JSONArray(redirectUris)) + put(PARAM_TOKEN_ENDPOINT_AUTH_METHOD, tokenEndpointAuthMethod) + } + + val mediaType = CONTENT_TYPE_JSON.toMediaType() + return jsonObject.toString().toRequestBody(mediaType) + } + + companion object { + private const val PARAM_APPLICATION_TYPE = "application_type" + private const val PARAM_CLIENT_NAME = "client_name" + private const val PARAM_TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method" + private const val PARAM_REDIRECT_URIS = "redirect_uris" + } +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/ClientRegistrationResponse.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/ClientRegistrationResponse.kt new file mode 100644 index 00000000..2a1f3c05 --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/responses/ClientRegistrationResponse.kt @@ -0,0 +1,42 @@ +/* ownCloud Android Library is available under MIT license + * + * @author Abel García de Prada + * + * Copyright (C) 2021 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ +package com.owncloud.android.lib.resources.oauth.responses + +import com.squareup.moshi.Json +import com.squareup.moshi.JsonClass + +@JsonClass(generateAdapter = true) +data class ClientRegistrationResponse( + @Json(name = "client_id") + val clientId: String, + @Json(name = "client_secret") + val clientSecret: String?, + @Json(name = "client_id_issued_at") + val clientIdIssuedAt: Int?, + @Json(name = "client_secret_expires_at") + val clientSecretExpiration: Int, +) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt index 8955e6ba..d61fdd09 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/OIDCService.kt @@ -1,6 +1,6 @@ /* ownCloud Android Library is available under MIT license * - * Copyright (C) 2020 ownCloud GmbH. + * Copyright (C) 2021 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -25,7 +25,9 @@ package com.owncloud.android.lib.resources.oauth.services import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.oauth.params.ClientRegistrationParams import com.owncloud.android.lib.resources.oauth.params.TokenRequestParams +import com.owncloud.android.lib.resources.oauth.responses.ClientRegistrationResponse import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse import com.owncloud.android.lib.resources.oauth.responses.TokenResponse @@ -38,4 +40,8 @@ interface OIDCService { tokenRequest: TokenRequestParams ): RemoteOperationResult + fun registerClientWithRegistrationEndpoint( + ownCloudClient: OwnCloudClient, + clientRegistrationParams: ClientRegistrationParams + ): RemoteOperationResult } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt index abc069af..fe6b8fc9 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/services/implementation/OCOIDCService.kt @@ -1,6 +1,6 @@ /* ownCloud Android Library is available under MIT license * - * Copyright (C) 2020 ownCloud GmbH. + * Copyright (C) 2021 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -26,8 +26,11 @@ package com.owncloud.android.lib.resources.oauth.services.implementation import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.resources.oauth.GetOIDCDiscoveryRemoteOperation +import com.owncloud.android.lib.resources.oauth.RegisterClientRemoteOperation import com.owncloud.android.lib.resources.oauth.TokenRequestRemoteOperation +import com.owncloud.android.lib.resources.oauth.params.ClientRegistrationParams import com.owncloud.android.lib.resources.oauth.params.TokenRequestParams +import com.owncloud.android.lib.resources.oauth.responses.ClientRegistrationResponse import com.owncloud.android.lib.resources.oauth.responses.OIDCDiscoveryResponse import com.owncloud.android.lib.resources.oauth.responses.TokenResponse import com.owncloud.android.lib.resources.oauth.services.OIDCService @@ -45,4 +48,10 @@ class OCOIDCService : OIDCService { ): RemoteOperationResult = TokenRequestRemoteOperation(tokenRequest).execute(ownCloudClient) + override fun registerClientWithRegistrationEndpoint( + ownCloudClient: OwnCloudClient, + clientRegistrationParams: ClientRegistrationParams + ): RemoteOperationResult = + RegisterClientRemoteOperation(clientRegistrationParams).execute(ownCloudClient) + } From 37250fc55c64738612598832d749eacfb1373b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 9 Feb 2021 09:45:35 +0100 Subject: [PATCH 15/49] Apply CR suggestions --- .../resources/oauth/RegisterClientRemoteOperation.kt | 5 ++++- .../resources/oauth/params/ClientRegistrationParams.kt | 10 +++------- .../lib/resources/oauth/params/TokenRequestParams.kt | 10 ++++------ 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt index 720035a7..5d6482da 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/RegisterClientRemoteOperation.kt @@ -47,7 +47,10 @@ class RegisterClientRemoteOperation( try { val requestBody = clientRegistrationParams.toRequestBody() - val postMethod = PostMethod(URL(clientRegistrationParams.registrationEndpoint), requestBody) + val postMethod = PostMethod( + url = URL(clientRegistrationParams.registrationEndpoint), + postRequestBody = requestBody + ) val status = client.executeHttpMethod(postMethod) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt index 454c5f6c..e26604a0 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/ClientRegistrationParams.kt @@ -40,17 +40,13 @@ data class ClientRegistrationParams( val tokenEndpointAuthMethod: String, val applicationType: String ) { - fun toRequestBody(): RequestBody { - val jsonObject = JSONObject().apply { + fun toRequestBody(): RequestBody = + JSONObject().apply { put(PARAM_APPLICATION_TYPE, applicationType) put(PARAM_CLIENT_NAME, clientName) put(PARAM_REDIRECT_URIS, JSONArray(redirectUris)) put(PARAM_TOKEN_ENDPOINT_AUTH_METHOD, tokenEndpointAuthMethod) - } - - val mediaType = CONTENT_TYPE_JSON.toMediaType() - return jsonObject.toString().toRequestBody(mediaType) - } + }.toString().toRequestBody(CONTENT_TYPE_JSON.toMediaType()) companion object { private const val PARAM_APPLICATION_TYPE = "application_type" diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt index eef3823a..367af463 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt @@ -42,13 +42,12 @@ sealed class TokenRequestParams( val redirectUri: String ) : TokenRequestParams(tokenEndpoint, clientAuth, grantType) { - override fun toRequestBody(): RequestBody { - return FormBody.Builder() + override fun toRequestBody(): RequestBody = + FormBody.Builder() .add(HttpConstants.OAUTH_HEADER_AUTHORIZATION_CODE, authorizationCode) .add(HttpConstants.OAUTH_HEADER_GRANT_TYPE, grantType) .add(HttpConstants.OAUTH_HEADER_REDIRECT_URI, redirectUri) .build() - } } class RefreshToken( @@ -58,14 +57,13 @@ sealed class TokenRequestParams( val refreshToken: String? = null ) : TokenRequestParams(tokenEndpoint, clientAuth, grantType) { - override fun toRequestBody(): RequestBody { - return FormBody.Builder().apply { + override fun toRequestBody(): RequestBody = + FormBody.Builder().apply { add(HttpConstants.OAUTH_HEADER_GRANT_TYPE, grantType) if (!refreshToken.isNullOrBlank()) { add(HttpConstants.OAUTH_HEADER_REFRESH_TOKEN, refreshToken) } }.build() - } } } From 94065ae4494a185b336c67b94fe44408c2ff8c55 Mon Sep 17 00:00:00 2001 From: Hannes Achleitner Date: Thu, 18 Feb 2021 08:28:39 +0100 Subject: [PATCH 16/49] Introduce dependabot --- .github/dependabot.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..a542bfd5 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,17 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gradle" + directory: "/" # Location of package manifests + schedule: + interval: "daily" + labels: + - "dependencies" + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" \ No newline at end of file From 97df0b655def493c0defa1cea3d66b2bda2612c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 07:00:20 +0000 Subject: [PATCH 17/49] Bump kotlinVersion from 1.4.30 to 1.4.31 Bumps `kotlinVersion` from 1.4.30 to 1.4.31. Updates `kotlin-gradle-plugin` from 1.4.30 to 1.4.31 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.4.31/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.4.30...v1.4.31) Updates `kotlin-stdlib-jdk8` from 1.4.30 to 1.4.31 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.4.31/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.4.30...v1.4.31) Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ade0c18c..88d11683 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { ext { - kotlinVersion = '1.4.30' + kotlinVersion = '1.4.31' moshiVersion = "1.9.2" } From 38d4dd604ed4939a16eb25c2a8de96e9b8a42592 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:13:05 +0000 Subject: [PATCH 18/49] Bump moshiVersion from 1.9.2 to 1.11.0 Bumps `moshiVersion` from 1.9.2 to 1.11.0. Updates `moshi-kotlin` from 1.9.2 to 1.11.0 - [Release notes](https://github.com/square/moshi/releases) - [Changelog](https://github.com/square/moshi/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/moshi/compare/moshi-parent-1.9.2...moshi-parent-1.11.0) Updates `moshi-kotlin-codegen` from 1.9.2 to 1.11.0 - [Release notes](https://github.com/square/moshi/releases) - [Changelog](https://github.com/square/moshi/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/moshi/compare/moshi-parent-1.9.2...moshi-parent-1.11.0) Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 88d11683..619fd3be 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ buildscript { ext { kotlinVersion = '1.4.31' - moshiVersion = "1.9.2" + moshiVersion = "1.11.0" } repositories { From e821bee59403728ef2f49e0eab9403433c2100f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Mar 2021 08:31:56 +0000 Subject: [PATCH 19/49] Bump junit from 4.13.1 to 4.13.2 Bumps [junit](https://github.com/junit-team/junit4) from 4.13.1 to 4.13.2. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.13.1.md) - [Commits](https://github.com/junit-team/junit4/compare/r4.13.1...r4.13.2) Signed-off-by: dependabot[bot] --- owncloudComLibrary/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owncloudComLibrary/build.gradle b/owncloudComLibrary/build.gradle index 0a003a08..7053882e 100644 --- a/owncloudComLibrary/build.gradle +++ b/owncloudComLibrary/build.gradle @@ -14,7 +14,7 @@ dependencies { } kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion" - testImplementation 'junit:junit:4.13.1' + testImplementation 'junit:junit:4.13.2' } android { From cc91ad9ddeb28f74cc9b702b188c4ad1d3012744 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Mon, 14 Sep 2020 17:47:55 +0200 Subject: [PATCH 20/49] add fix for redirect, untested --- .../status/GetRemoteStatusOperation.kt | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index f47544b1..0a4e3654 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -53,7 +53,8 @@ class GetRemoteStatusOperation : RemoteOperation() { val baseUriStr = client.baseUri.toString() if (baseUriStr.startsWith(HTTP_PREFIX) || baseUriStr.startsWith( HTTPS_PREFIX - )) { + ) + ) { tryConnection(client) } else { client.baseUri = Uri.parse(HTTPS_PREFIX + baseUriStr) @@ -67,11 +68,18 @@ class GetRemoteStatusOperation : RemoteOperation() { return latestResult } + private fun updateLocationWithRelativePath(oldLocation: String, redirectedLocation: String): String { + if(!redirectedLocation.startsWith("/")) + return redirectedLocation + val oldLocation = URL(oldLocation) + return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString() + } + private fun tryConnection(client: OwnCloudClient): Boolean { var successfulConnection = false - val baseUrlSt = client.baseUri.toString() + val baseUrlStr = client.baseUri.toString() try { - var getMethod = GetMethod(URL(baseUrlSt + OwnCloudClient.STATUS_PATH)).apply { + var getMethod = GetMethod(URL(baseUrlStr + OwnCloudClient.STATUS_PATH)).apply { setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) } @@ -89,11 +97,11 @@ class GetRemoteStatusOperation : RemoteOperation() { return successfulConnection } - var redirectedLocation = latestResult.redirectedLocation + var redirectedLocation = updateLocationWithRelativePath(baseUrlStr, latestResult.redirectedLocation) while (!redirectedLocation.isNullOrEmpty() && !latestResult.isSuccess) { isRedirectToNonSecureConnection = isRedirectToNonSecureConnection || - (baseUrlSt.startsWith(HTTPS_PREFIX) && redirectedLocation.startsWith( + (baseUrlStr.startsWith(HTTPS_PREFIX) && redirectedLocation.startsWith( HTTP_PREFIX )) @@ -104,7 +112,7 @@ class GetRemoteStatusOperation : RemoteOperation() { status = client.executeHttpMethod(getMethod) latestResult = RemoteOperationResult(getMethod) - redirectedLocation = latestResult.redirectedLocation + redirectedLocation = updateLocationWithRelativePath(redirectedLocation, latestResult.redirectedLocation) } if (isSuccess(status)) { @@ -119,7 +127,7 @@ class GetRemoteStatusOperation : RemoteOperation() { latestResult = if (isRedirectToNonSecureConnection) { RemoteOperationResult(ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) } else { - if (baseUrlSt.startsWith(HTTPS_PREFIX)) RemoteOperationResult(ResultCode.OK_SSL) + if (baseUrlStr.startsWith(HTTPS_PREFIX)) RemoteOperationResult(ResultCode.OK_SSL) else RemoteOperationResult(ResultCode.OK_NO_SSL) } latestResult.data = ocVersion @@ -134,12 +142,12 @@ class GetRemoteStatusOperation : RemoteOperation() { latestResult = RemoteOperationResult(e) } when { - latestResult.isSuccess -> Timber.i("Connection check at $baseUrlSt successful: ${latestResult.logMessage}") + latestResult.isSuccess -> Timber.i("Connection check at $baseUrlStr successful: ${latestResult.logMessage}") latestResult.isException -> - Timber.e(latestResult.exception, "Connection check at $baseUrlSt: ${latestResult.logMessage}") + Timber.e(latestResult.exception, "Connection check at $baseUrlStr: ${latestResult.logMessage}") - else -> Timber.e("Connection check at $baseUrlSt failed: ${latestResult.logMessage}") + else -> Timber.e("Connection check at $baseUrlStr failed: ${latestResult.logMessage}") } return successfulConnection } From 257cbcff03a9b03afdcb2626a73fcad7dc971ec5 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 15 Sep 2020 13:51:56 +0200 Subject: [PATCH 21/49] add basic test functionality for andorid library --- .../status/GetRemoteStatusOperation.kt | 6 +-- .../lib/GetRemoteStatusOperationTest.kt | 42 +++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index 0a4e3654..bab89609 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -68,7 +68,7 @@ class GetRemoteStatusOperation : RemoteOperation() { return latestResult } - private fun updateLocationWithRelativePath(oldLocation: String, redirectedLocation: String): String { + fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { if(!redirectedLocation.startsWith("/")) return redirectedLocation val oldLocation = URL(oldLocation) @@ -97,7 +97,7 @@ class GetRemoteStatusOperation : RemoteOperation() { return successfulConnection } - var redirectedLocation = updateLocationWithRelativePath(baseUrlStr, latestResult.redirectedLocation) + var redirectedLocation = updateLocationWithRedirectPath(baseUrlStr, latestResult.redirectedLocation) while (!redirectedLocation.isNullOrEmpty() && !latestResult.isSuccess) { isRedirectToNonSecureConnection = isRedirectToNonSecureConnection || @@ -112,7 +112,7 @@ class GetRemoteStatusOperation : RemoteOperation() { status = client.executeHttpMethod(getMethod) latestResult = RemoteOperationResult(getMethod) - redirectedLocation = updateLocationWithRelativePath(redirectedLocation, latestResult.redirectedLocation) + redirectedLocation = updateLocationWithRedirectPath(redirectedLocation, latestResult.redirectedLocation) } if (isSuccess(status)) { diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt new file mode 100644 index 00000000..2f3b3d8b --- /dev/null +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt @@ -0,0 +1,42 @@ +package com.owncloud.android.lib + +import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation +import org.junit.Assert.assertEquals +import org.junit.Test + +class GetRemoteStatusOperationTest { + private val remoteStatusOperation = GetRemoteStatusOperation() + + @Test + fun `update location with an absolute path`() { + val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + "https://cloud.somewhere.com", "https://cloud.somewhere.com/subdir" + ) + assertEquals("https://cloud.somewhere.com/subdir", newLocation) + } + + @Test + fun `update location with a smaler aboslute path`() { + + val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + "https://cloud.somewhere.com/subdir", "https://cloud.somewhere.com/" + ) + assertEquals("https://cloud.somewhere.com/", newLocation) + } + + @Test + fun `update location with a relative path`() { + val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + "https://cloud.somewhere.com", "/subdir" + ) + assertEquals("https://cloud.somewhere.com/subdir", newLocation) + } + + @Test + fun `update location by replacing the relative path`() { + val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + "https://cloud.somewhere.com/some/other/subdir", "/subdir" + ) + assertEquals("https://cloud.somewhere.com/subdir", newLocation) + } +} \ No newline at end of file From cbfd9773506cf46a07b47e4458e22ed9ff472f50 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 15 Sep 2020 17:18:00 +0200 Subject: [PATCH 22/49] clean up tryConnect function --- .../status/GetRemoteStatusOperation.kt | 145 ++++++++++-------- 1 file changed, 81 insertions(+), 64 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index bab89609..d58cfd86 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -69,87 +69,104 @@ class GetRemoteStatusOperation : RemoteOperation() { } fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { - if(!redirectedLocation.startsWith("/")) + if (!redirectedLocation.startsWith("/")) return redirectedLocation val oldLocation = URL(oldLocation) return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString() } - private fun tryConnection(client: OwnCloudClient): Boolean { - var successfulConnection = false - val baseUrlStr = client.baseUri.toString() - try { - var getMethod = GetMethod(URL(baseUrlStr + OwnCloudClient.STATUS_PATH)).apply { - setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) - setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) - } - client.setFollowRedirects(false) - var isRedirectToNonSecureConnection = false - var status: Int - try { - status = client.executeHttpMethod(getMethod) - latestResult = - if (isSuccess(status)) RemoteOperationResult(ResultCode.OK) - else RemoteOperationResult(getMethod) + private fun checkIfConnectionIsRedirectedToNoneSecure( + isConnectionSecure: Boolean, + baseUrl: String, + redirectedUrl: String + ): Boolean { + return isConnectionSecure || + (baseUrl.startsWith(HTTPS_PREFIX) && redirectedUrl.startsWith(HTTP_PREFIX)) + } - } catch (sslE: SSLException) { - latestResult = RemoteOperationResult(sslE) - return successfulConnection - } + private fun getGetMethod(url: String): GetMethod { + return GetMethod(URL(url + OwnCloudClient.STATUS_PATH)).apply { + setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) + setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) + } + } - var redirectedLocation = updateLocationWithRedirectPath(baseUrlStr, latestResult.redirectedLocation) - while (!redirectedLocation.isNullOrEmpty() && !latestResult.isSuccess) { - isRedirectToNonSecureConnection = - isRedirectToNonSecureConnection || - (baseUrlStr.startsWith(HTTPS_PREFIX) && redirectedLocation.startsWith( - HTTP_PREFIX - )) + data class RequestResult( + val getMethod: GetMethod, + val status: Int, + val result: RemoteOperationResult, + val redirectedToUnsecureLocation: Boolean + ) - getMethod = GetMethod(URL(redirectedLocation)).apply { - setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) - setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) - } + fun requestAndFollowRedirects(baseLocation: String): RequestResult { + var currentLocation = baseLocation + var redirectedToUnsecureLocation = false + var status: Int - status = client.executeHttpMethod(getMethod) - latestResult = RemoteOperationResult(getMethod) - redirectedLocation = updateLocationWithRedirectPath(redirectedLocation, latestResult.redirectedLocation) - } + while (true) { + val getMethod = getGetMethod(currentLocation) - if (isSuccess(status)) { - val respJSON = JSONObject(getMethod.getResponseBodyAsString()) - if (!respJSON.getBoolean(NODE_INSTALLED)) { - latestResult = RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) - } else { - val version = respJSON.getString(NODE_VERSION) - val ocVersion = OwnCloudVersion(version) - // the version object will be returned even if the version is invalid, no error code; - // every app will decide how to act if (ocVersion.isVersionValid() == false) - latestResult = if (isRedirectToNonSecureConnection) { - RemoteOperationResult(ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) - } else { - if (baseUrlStr.startsWith(HTTPS_PREFIX)) RemoteOperationResult(ResultCode.OK_SSL) - else RemoteOperationResult(ResultCode.OK_NO_SSL) - } - latestResult.data = ocVersion - successfulConnection = true - } + status = client.executeHttpMethod(getMethod) + val result = + if (isSuccess(status)) RemoteOperationResult(ResultCode.OK) + else RemoteOperationResult(getMethod) + + if (result.redirectedLocation.isNullOrEmpty() || result.isSuccess) { + return RequestResult(getMethod, status, result, redirectedToUnsecureLocation) } else { - latestResult = RemoteOperationResult(getMethod) + val nextLocation = updateLocationWithRedirectPath(currentLocation, result.redirectedLocation) + redirectedToUnsecureLocation = + checkIfConnectionIsRedirectedToNoneSecure( + redirectedToUnsecureLocation, + currentLocation, + nextLocation + ) + currentLocation = nextLocation } + } + } + + private fun handleRequestResult(requestResult: RequestResult, baseUrl: String): RemoteOperationResult { + if (!isSuccess(requestResult.status)) + return RemoteOperationResult(requestResult.getMethod) + + val respJSON = JSONObject(requestResult.getMethod.getResponseBodyAsString()) + if (!respJSON.getBoolean(NODE_INSTALLED)) + return RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) + + val version = respJSON.getString(NODE_VERSION) + val ocVersion = OwnCloudVersion(version) + // the version object will be returned even if the version is invalid, no error code; + // every app will decide how to act if (ocVersion.isVersionValid() == false) + val result = + if (requestResult.redirectedToUnsecureLocation) { + RemoteOperationResult(ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) + } else { + if (baseUrl.startsWith(HTTPS_PREFIX)) RemoteOperationResult(ResultCode.OK_SSL) + else RemoteOperationResult(ResultCode.OK_NO_SSL) + } + result.data = ocVersion + return result + } + + private fun tryConnection(client: OwnCloudClient): Boolean { + val baseUrl = client.baseUri.toString() + try { + client.setFollowRedirects(false) + + val requestResult = requestAndFollowRedirects(baseUrl) + val operationResult = handleRequestResult(requestResult, baseUrl) + return operationResult.code == ResultCode.OK_SSL || operationResult.code == ResultCode.OK_NO_SSL } catch (e: JSONException) { latestResult = RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) + return false } catch (e: Exception) { latestResult = RemoteOperationResult(e) + return false + } catch (sslE: SSLException) { + latestResult = RemoteOperationResult(sslE) + return false } - when { - latestResult.isSuccess -> Timber.i("Connection check at $baseUrlStr successful: ${latestResult.logMessage}") - - latestResult.isException -> - Timber.e(latestResult.exception, "Connection check at $baseUrlStr: ${latestResult.logMessage}") - - else -> Timber.e("Connection check at $baseUrlStr failed: ${latestResult.logMessage}") - } - return successfulConnection } private fun isSuccess(status: Int): Boolean = status == HttpConstants.HTTP_OK From 9d4b88cad72c1620c309cbd4cec8129b75509858 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Wed, 16 Sep 2020 15:08:28 +0200 Subject: [PATCH 23/49] refactor run function --- .../status/GetRemoteStatusOperation.kt | 59 ++++++++----------- 1 file changed, 23 insertions(+), 36 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index d58cfd86..ab344524 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -35,7 +35,6 @@ import org.json.JSONObject import timber.log.Timber import java.net.URL import java.util.concurrent.TimeUnit -import javax.net.ssl.SSLException /** * Checks if the server is valid @@ -46,26 +45,18 @@ import javax.net.ssl.SSLException * @author Abel García de Prada */ class GetRemoteStatusOperation : RemoteOperation() { - private lateinit var latestResult: RemoteOperationResult - override fun run(client: OwnCloudClient): RemoteOperationResult { + if (client.baseUri.scheme.isNullOrEmpty()) + client.baseUri = Uri.parse(HTTPS_SCHEME + "://" + client.baseUri.toString()) - val baseUriStr = client.baseUri.toString() - if (baseUriStr.startsWith(HTTP_PREFIX) || baseUriStr.startsWith( - HTTPS_PREFIX - ) - ) { - tryConnection(client) - } else { - client.baseUri = Uri.parse(HTTPS_PREFIX + baseUriStr) - val httpsSuccess = tryConnection(client) - if (!httpsSuccess && !latestResult.isSslRecoverableException) { - Timber.d("Establishing secure connection failed, trying non secure connection") - client.baseUri = Uri.parse(HTTP_PREFIX + baseUriStr) - tryConnection(client) - } + var result = tryToConnect(client) + if (result.code != ResultCode.OK_SSL && !result.isSslRecoverableException) { + Timber.d("Establishing secure connection failed, trying non secure connection") + client.baseUri = client.baseUri.buildUpon().scheme(HTTP_SCHEME).build() + result = tryToConnect(client) } - return latestResult + + return result } fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { @@ -81,7 +72,7 @@ class GetRemoteStatusOperation : RemoteOperation() { redirectedUrl: String ): Boolean { return isConnectionSecure || - (baseUrl.startsWith(HTTPS_PREFIX) && redirectedUrl.startsWith(HTTP_PREFIX)) + (baseUrl.startsWith(HTTPS_SCHEME) && redirectedUrl.startsWith(HTTP_SCHEME)) } private fun getGetMethod(url: String): GetMethod { @@ -126,7 +117,10 @@ class GetRemoteStatusOperation : RemoteOperation() { } } - private fun handleRequestResult(requestResult: RequestResult, baseUrl: String): RemoteOperationResult { + private fun handleRequestResult( + requestResult: RequestResult, + baseUrl: String + ): RemoteOperationResult { if (!isSuccess(requestResult.status)) return RemoteOperationResult(requestResult.getMethod) @@ -142,30 +136,23 @@ class GetRemoteStatusOperation : RemoteOperation() { if (requestResult.redirectedToUnsecureLocation) { RemoteOperationResult(ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) } else { - if (baseUrl.startsWith(HTTPS_PREFIX)) RemoteOperationResult(ResultCode.OK_SSL) + if (baseUrl.startsWith(HTTPS_SCHEME)) RemoteOperationResult(ResultCode.OK_SSL) else RemoteOperationResult(ResultCode.OK_NO_SSL) } result.data = ocVersion return result } - private fun tryConnection(client: OwnCloudClient): Boolean { + private fun tryToConnect(client: OwnCloudClient): RemoteOperationResult { val baseUrl = client.baseUri.toString() - try { - client.setFollowRedirects(false) - + client.setFollowRedirects(false) + return try { val requestResult = requestAndFollowRedirects(baseUrl) - val operationResult = handleRequestResult(requestResult, baseUrl) - return operationResult.code == ResultCode.OK_SSL || operationResult.code == ResultCode.OK_NO_SSL + handleRequestResult(requestResult, baseUrl) } catch (e: JSONException) { - latestResult = RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) - return false + RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) } catch (e: Exception) { - latestResult = RemoteOperationResult(e) - return false - } catch (sslE: SSLException) { - latestResult = RemoteOperationResult(sslE) - return false + RemoteOperationResult(e) } } @@ -179,7 +166,7 @@ class GetRemoteStatusOperation : RemoteOperation() { private const val TRY_CONNECTION_TIMEOUT: Long = 5000 private const val NODE_INSTALLED = "installed" private const val NODE_VERSION = "version" - private const val HTTPS_PREFIX = "https://" - private const val HTTP_PREFIX = "http://" + private const val HTTPS_SCHEME = "https" + private const val HTTP_SCHEME = "http" } } From 84240ef78b8636b1a343aabbdda3fe9d3e31a6aa Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Wed, 16 Sep 2020 16:20:54 +0200 Subject: [PATCH 24/49] detach request logic from operation --- .../status/GetRemoteStatusOperation.kt | 114 ++---------------- .../lib/resources/status/StatusRequestor.kt | 113 +++++++++++++++++ ...perationTest.kt => StatusRequestorTest.kt} | 16 +-- 3 files changed, 130 insertions(+), 113 deletions(-) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt rename owncloudComLibrary/src/test/java/com/owncloud/android/lib/{GetRemoteStatusOperationTest.kt => StatusRequestorTest.kt} (66%) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index ab344524..e9c1c10b 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -25,16 +25,12 @@ package com.owncloud.android.lib.resources.status import android.net.Uri import com.owncloud.android.lib.common.OwnCloudClient -import com.owncloud.android.lib.common.http.HttpConstants -import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod import com.owncloud.android.lib.common.operations.RemoteOperation import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode import org.json.JSONException -import org.json.JSONObject import timber.log.Timber -import java.net.URL -import java.util.concurrent.TimeUnit + /** * Checks if the server is valid @@ -45,6 +41,11 @@ import java.util.concurrent.TimeUnit * @author Abel García de Prada */ class GetRemoteStatusOperation : RemoteOperation() { + companion object { + const val HTTPS_SCHEME = "https" + const val HTTP_SCHEME = "http" + } + override fun run(client: OwnCloudClient): RemoteOperationResult { if (client.baseUri.scheme.isNullOrEmpty()) client.baseUri = Uri.parse(HTTPS_SCHEME + "://" + client.baseUri.toString()) @@ -59,114 +60,17 @@ class GetRemoteStatusOperation : RemoteOperation() { return result } - fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { - if (!redirectedLocation.startsWith("/")) - return redirectedLocation - val oldLocation = URL(oldLocation) - return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString() - } - - private fun checkIfConnectionIsRedirectedToNoneSecure( - isConnectionSecure: Boolean, - baseUrl: String, - redirectedUrl: String - ): Boolean { - return isConnectionSecure || - (baseUrl.startsWith(HTTPS_SCHEME) && redirectedUrl.startsWith(HTTP_SCHEME)) - } - - private fun getGetMethod(url: String): GetMethod { - return GetMethod(URL(url + OwnCloudClient.STATUS_PATH)).apply { - setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) - setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) - } - } - - data class RequestResult( - val getMethod: GetMethod, - val status: Int, - val result: RemoteOperationResult, - val redirectedToUnsecureLocation: Boolean - ) - - fun requestAndFollowRedirects(baseLocation: String): RequestResult { - var currentLocation = baseLocation - var redirectedToUnsecureLocation = false - var status: Int - - while (true) { - val getMethod = getGetMethod(currentLocation) - - status = client.executeHttpMethod(getMethod) - val result = - if (isSuccess(status)) RemoteOperationResult(ResultCode.OK) - else RemoteOperationResult(getMethod) - - if (result.redirectedLocation.isNullOrEmpty() || result.isSuccess) { - return RequestResult(getMethod, status, result, redirectedToUnsecureLocation) - } else { - val nextLocation = updateLocationWithRedirectPath(currentLocation, result.redirectedLocation) - redirectedToUnsecureLocation = - checkIfConnectionIsRedirectedToNoneSecure( - redirectedToUnsecureLocation, - currentLocation, - nextLocation - ) - currentLocation = nextLocation - } - } - } - - private fun handleRequestResult( - requestResult: RequestResult, - baseUrl: String - ): RemoteOperationResult { - if (!isSuccess(requestResult.status)) - return RemoteOperationResult(requestResult.getMethod) - - val respJSON = JSONObject(requestResult.getMethod.getResponseBodyAsString()) - if (!respJSON.getBoolean(NODE_INSTALLED)) - return RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) - - val version = respJSON.getString(NODE_VERSION) - val ocVersion = OwnCloudVersion(version) - // the version object will be returned even if the version is invalid, no error code; - // every app will decide how to act if (ocVersion.isVersionValid() == false) - val result = - if (requestResult.redirectedToUnsecureLocation) { - RemoteOperationResult(ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) - } else { - if (baseUrl.startsWith(HTTPS_SCHEME)) RemoteOperationResult(ResultCode.OK_SSL) - else RemoteOperationResult(ResultCode.OK_NO_SSL) - } - result.data = ocVersion - return result - } - private fun tryToConnect(client: OwnCloudClient): RemoteOperationResult { val baseUrl = client.baseUri.toString() client.setFollowRedirects(false) return try { - val requestResult = requestAndFollowRedirects(baseUrl) - handleRequestResult(requestResult, baseUrl) + val requestor = StatusRequestor() + val requestResult = requestor.requestAndFollowRedirects(baseUrl, client) + requestor.handleRequestResult(requestResult, baseUrl) } catch (e: JSONException) { RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) } catch (e: Exception) { RemoteOperationResult(e) } } - - private fun isSuccess(status: Int): Boolean = status == HttpConstants.HTTP_OK - - companion object { - /** - * Maximum time to wait for a response from the server when the connection is being tested, - * in MILLISECONDs. - */ - private const val TRY_CONNECTION_TIMEOUT: Long = 5000 - private const val NODE_INSTALLED = "installed" - private const val NODE_VERSION = "version" - private const val HTTPS_SCHEME = "https" - private const val HTTP_SCHEME = "http" - } } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt new file mode 100644 index 00000000..c36c3426 --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt @@ -0,0 +1,113 @@ +package com.owncloud.android.lib.resources.status + +import com.owncloud.android.lib.common.OwnCloudClient +import com.owncloud.android.lib.common.http.HttpConstants +import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod +import com.owncloud.android.lib.common.operations.RemoteOperationResult +import org.json.JSONObject +import java.net.URL +import java.util.concurrent.TimeUnit + +internal class StatusRequestor { + + companion object { + /** + * Maximum time to wait for a response from the server when the connection is being tested, + * in MILLISECONDs. + */ + private const val TRY_CONNECTION_TIMEOUT: Long = 5000 + private const val NODE_INSTALLED = "installed" + private const val HTTPS_SCHEME = "https" + private const val HTTP_SCHEME = "http" + private const val NODE_VERSION = "version" + } + + private fun checkIfConnectionIsRedirectedToNoneSecure( + isConnectionSecure: Boolean, + baseUrl: String, + redirectedUrl: String + ): Boolean { + return isConnectionSecure || + (baseUrl.startsWith(HTTPS_SCHEME) && redirectedUrl.startsWith( + HTTP_SCHEME + )) + } + + fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { + if (!redirectedLocation.startsWith("/")) + return redirectedLocation + val oldLocation = URL(oldLocation) + return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString() + } + + private fun getGetMethod(url: String): GetMethod { + return GetMethod(URL(url + OwnCloudClient.STATUS_PATH)).apply { + setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) + setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) + } + } + + data class RequestResult( + val getMethod: GetMethod, + val status: Int, + val result: RemoteOperationResult, + val redirectedToUnsecureLocation: Boolean + ) + + fun requestAndFollowRedirects(baseLocation: String, client: OwnCloudClient): RequestResult { + var currentLocation = baseLocation + var redirectedToUnsecureLocation = false + var status: Int + + while (true) { + val getMethod = getGetMethod(currentLocation) + + status = client.executeHttpMethod(getMethod) + val result = + if (isSuccess(status)) RemoteOperationResult(RemoteOperationResult.ResultCode.OK) + else RemoteOperationResult(getMethod) + + if (result.redirectedLocation.isNullOrEmpty() || result.isSuccess) { + return RequestResult(getMethod, status, result, redirectedToUnsecureLocation) + } else { + val nextLocation = updateLocationWithRedirectPath(currentLocation, result.redirectedLocation) + redirectedToUnsecureLocation = + checkIfConnectionIsRedirectedToNoneSecure( + redirectedToUnsecureLocation, + currentLocation, + nextLocation + ) + currentLocation = nextLocation + } + } + } + + private fun isSuccess(status: Int): Boolean = status == HttpConstants.HTTP_OK + + fun handleRequestResult( + requestResult: RequestResult, + baseUrl: String + ): RemoteOperationResult { + if (!isSuccess(requestResult.status)) + return RemoteOperationResult(requestResult.getMethod) + + val respJSON = JSONObject(requestResult.getMethod.getResponseBodyAsString() ?: "") + if (!respJSON.getBoolean(NODE_INSTALLED)) + return RemoteOperationResult(RemoteOperationResult.ResultCode.INSTANCE_NOT_CONFIGURED) + + val ocVersion = OwnCloudVersion(respJSON.getString(NODE_VERSION)) + // the version object will be returned even if the version is invalid, no error code; + // every app will decide how to act if (ocVersion.isVersionValid() == false) + val result = + if (requestResult.redirectedToUnsecureLocation) { + RemoteOperationResult(RemoteOperationResult.ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) + } else { + if (baseUrl.startsWith(HTTPS_SCHEME)) RemoteOperationResult( + RemoteOperationResult.ResultCode.OK_SSL + ) + else RemoteOperationResult(RemoteOperationResult.ResultCode.OK_NO_SSL) + } + result.data = ocVersion + return result + } +} \ No newline at end of file diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt similarity index 66% rename from owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt rename to owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index 2f3b3d8b..f1ca501b 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -1,24 +1,24 @@ package com.owncloud.android.lib -import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation +import com.owncloud.android.lib.resources.status.StatusRequestor import org.junit.Assert.assertEquals import org.junit.Test -class GetRemoteStatusOperationTest { - private val remoteStatusOperation = GetRemoteStatusOperation() +class StatusRequestorTest { + private val requestor = StatusRequestor() @Test fun `update location with an absolute path`() { - val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + val newLocation = requestor.updateLocationWithRedirectPath( "https://cloud.somewhere.com", "https://cloud.somewhere.com/subdir" ) assertEquals("https://cloud.somewhere.com/subdir", newLocation) } @Test - fun `update location with a smaler aboslute path`() { - val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + fun `update location with a smaler aboslute path`() { + val newLocation = requestor.updateLocationWithRedirectPath( "https://cloud.somewhere.com/subdir", "https://cloud.somewhere.com/" ) assertEquals("https://cloud.somewhere.com/", newLocation) @@ -26,7 +26,7 @@ class GetRemoteStatusOperationTest { @Test fun `update location with a relative path`() { - val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + val newLocation = requestor.updateLocationWithRedirectPath( "https://cloud.somewhere.com", "/subdir" ) assertEquals("https://cloud.somewhere.com/subdir", newLocation) @@ -34,7 +34,7 @@ class GetRemoteStatusOperationTest { @Test fun `update location by replacing the relative path`() { - val newLocation = remoteStatusOperation.updateLocationWithRedirectPath( + val newLocation = requestor.updateLocationWithRedirectPath( "https://cloud.somewhere.com/some/other/subdir", "/subdir" ) assertEquals("https://cloud.somewhere.com/subdir", newLocation) From 270e1279401117826753f89e370d6d89c59433d6 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 17 Sep 2020 12:23:45 +0200 Subject: [PATCH 25/49] fix according to review --- .../status/GetRemoteStatusOperation.kt | 15 ++--- .../lib/resources/status/HttpScheme.kt | 30 +++++++++ ...{StatusRequestor.kt => StatusRequester.kt} | 62 +++++++++++++------ .../android/lib/StatusRequestorTest.kt | 57 ++++++++++++----- 4 files changed, 119 insertions(+), 45 deletions(-) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt rename owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/{StatusRequestor.kt => StatusRequester.kt} (71%) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index e9c1c10b..ba3b4311 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -28,10 +28,11 @@ import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperation import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode +import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_SCHEME +import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME import org.json.JSONException import timber.log.Timber - /** * Checks if the server is valid * @@ -41,14 +42,10 @@ import timber.log.Timber * @author Abel García de Prada */ class GetRemoteStatusOperation : RemoteOperation() { - companion object { - const val HTTPS_SCHEME = "https" - const val HTTP_SCHEME = "http" - } override fun run(client: OwnCloudClient): RemoteOperationResult { if (client.baseUri.scheme.isNullOrEmpty()) - client.baseUri = Uri.parse(HTTPS_SCHEME + "://" + client.baseUri.toString()) + client.baseUri = Uri.parse("$HTTPS_SCHEME://${client.baseUri}") var result = tryToConnect(client) if (result.code != ResultCode.OK_SSL && !result.isSslRecoverableException) { @@ -64,9 +61,9 @@ class GetRemoteStatusOperation : RemoteOperation() { val baseUrl = client.baseUri.toString() client.setFollowRedirects(false) return try { - val requestor = StatusRequestor() - val requestResult = requestor.requestAndFollowRedirects(baseUrl, client) - requestor.handleRequestResult(requestResult, baseUrl) + val requester = StatusRequester() + val requestResult = requester.requestAndFollowRedirects(baseUrl, client) + requester.handleRequestResult(requestResult, baseUrl) } catch (e: JSONException) { RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) } catch (e: Exception) { diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt new file mode 100644 index 00000000..091ce146 --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt @@ -0,0 +1,30 @@ +/* ownCloud Android Library is available under MIT license +* Copyright (C) 2020 ownCloud GmbH. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +*/ + +package com.owncloud.android.lib.resources.status + +object HttpScheme { + const val HTTP_SCHEME = "http" + const val HTTPS_SCHEME = "https" +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt similarity index 71% rename from owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt rename to owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index c36c3426..14af1cee 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequestor.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -1,26 +1,40 @@ +/* ownCloud Android Library is available under MIT license +* Copyright (C) 2020 ownCloud GmbH. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +*/ + package com.owncloud.android.lib.resources.status import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.http.HttpConstants import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod import com.owncloud.android.lib.common.operations.RemoteOperationResult +import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_SCHEME +import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME import org.json.JSONObject import java.net.URL import java.util.concurrent.TimeUnit -internal class StatusRequestor { - - companion object { - /** - * Maximum time to wait for a response from the server when the connection is being tested, - * in MILLISECONDs. - */ - private const val TRY_CONNECTION_TIMEOUT: Long = 5000 - private const val NODE_INSTALLED = "installed" - private const val HTTPS_SCHEME = "https" - private const val HTTP_SCHEME = "http" - private const val NODE_VERSION = "version" - } +internal class StatusRequester { private fun checkIfConnectionIsRedirectedToNoneSecure( isConnectionSecure: Boolean, @@ -28,9 +42,7 @@ internal class StatusRequestor { redirectedUrl: String ): Boolean { return isConnectionSecure || - (baseUrl.startsWith(HTTPS_SCHEME) && redirectedUrl.startsWith( - HTTP_SCHEME - )) + (baseUrl.startsWith(HTTPS_SCHEME) && redirectedUrl.startsWith(HTTP_SCHEME)) } fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { @@ -64,7 +76,7 @@ internal class StatusRequestor { status = client.executeHttpMethod(getMethod) val result = - if (isSuccess(status)) RemoteOperationResult(RemoteOperationResult.ResultCode.OK) + if (status.isSuccess()) RemoteOperationResult(RemoteOperationResult.ResultCode.OK) else RemoteOperationResult(getMethod) if (result.redirectedLocation.isNullOrEmpty() || result.isSuccess) { @@ -82,13 +94,13 @@ internal class StatusRequestor { } } - private fun isSuccess(status: Int): Boolean = status == HttpConstants.HTTP_OK + private fun Int.isSuccess() = this == HttpConstants.HTTP_OK fun handleRequestResult( requestResult: RequestResult, baseUrl: String ): RemoteOperationResult { - if (!isSuccess(requestResult.status)) + if (!requestResult.status.isSuccess()) return RemoteOperationResult(requestResult.getMethod) val respJSON = JSONObject(requestResult.getMethod.getResponseBodyAsString() ?: "") @@ -110,4 +122,14 @@ internal class StatusRequestor { result.data = ocVersion return result } -} \ No newline at end of file + + companion object { + /** + * Maximum time to wait for a response from the server when the connection is being tested, + * in MILLISECONDs. + */ + private const val TRY_CONNECTION_TIMEOUT: Long = 5000 + private const val NODE_INSTALLED = "installed" + private const val NODE_VERSION = "version" + } +} diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index f1ca501b..107b5238 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -1,42 +1,67 @@ +/* ownCloud Android Library is available under MIT license +* Copyright (C) 2020 ownCloud GmbH. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +*/ + package com.owncloud.android.lib -import com.owncloud.android.lib.resources.status.StatusRequestor +import com.owncloud.android.lib.resources.status.StatusRequester import org.junit.Assert.assertEquals import org.junit.Test class StatusRequestorTest { - private val requestor = StatusRequestor() + private val requestor = StatusRequester() @Test fun `update location with an absolute path`() { - val newLocation = requestor.updateLocationWithRedirectPath( - "https://cloud.somewhere.com", "https://cloud.somewhere.com/subdir" - ) - assertEquals("https://cloud.somewhere.com/subdir", newLocation) + val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN/subdir") + assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test - fun `update location with a smaler aboslute path`() { - val newLocation = requestor.updateLocationWithRedirectPath( - "https://cloud.somewhere.com/subdir", "https://cloud.somewhere.com/" - ) - assertEquals("https://cloud.somewhere.com/", newLocation) + fun `update location with a smaller absolute path`() { + val newLocation = requestor.updateLocationWithRedirectPath("$TEST_DOMAIN$SUB_PATH", TEST_DOMAIN) + assertEquals(TEST_DOMAIN, newLocation) } @Test fun `update location with a relative path`() { val newLocation = requestor.updateLocationWithRedirectPath( - "https://cloud.somewhere.com", "/subdir" + TEST_DOMAIN, SUB_PATH ) - assertEquals("https://cloud.somewhere.com/subdir", newLocation) + assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test fun `update location by replacing the relative path`() { val newLocation = requestor.updateLocationWithRedirectPath( - "https://cloud.somewhere.com/some/other/subdir", "/subdir" + "$TEST_DOMAIN/some/other/subdir", SUB_PATH ) - assertEquals("https://cloud.somewhere.com/subdir", newLocation) + assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } -} \ No newline at end of file + + companion object { + const val TEST_DOMAIN = "https://cloud.somewhere.com" + const val SUB_PATH = "/subdir" + } +} From dac7bcc0e7aff29608da717fb9e0e71c0e1172a2 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 17 Sep 2020 12:33:03 +0200 Subject: [PATCH 26/49] pleasure the linter --- .../android/lib/resources/status/StatusRequester.kt | 4 ++-- .../java/com/owncloud/android/lib/StatusRequestorTest.kt | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index 14af1cee..358ec608 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -48,8 +48,8 @@ internal class StatusRequester { fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { if (!redirectedLocation.startsWith("/")) return redirectedLocation - val oldLocation = URL(oldLocation) - return URL(oldLocation.protocol, oldLocation.host, oldLocation.port, redirectedLocation).toString() + val oldLocationURL = URL(oldLocation) + return URL(oldLocationURL.protocol, oldLocationURL.host, oldLocationURL.port, redirectedLocation).toString() } private fun getGetMethod(url: String): GetMethod { diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index 107b5238..15988187 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -33,7 +33,7 @@ class StatusRequestorTest { @Test fun `update location with an absolute path`() { - val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN/subdir") + val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH") assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @@ -46,9 +46,7 @@ class StatusRequestorTest { @Test fun `update location with a relative path`() { - val newLocation = requestor.updateLocationWithRedirectPath( - TEST_DOMAIN, SUB_PATH - ) + val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } From b207fd1c6788e903ba830a9882f1d9da51862c10 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Mon, 21 Sep 2020 10:45:26 +0200 Subject: [PATCH 27/49] fix rellative redirect --- .../owncloud/android/lib/resources/status/StatusRequester.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index 358ec608..2dbb3653 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -53,7 +53,7 @@ internal class StatusRequester { } private fun getGetMethod(url: String): GetMethod { - return GetMethod(URL(url + OwnCloudClient.STATUS_PATH)).apply { + return GetMethod(URL(url)).apply { setReadTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) setConnectionTimeout(TRY_CONNECTION_TIMEOUT, TimeUnit.SECONDS) } @@ -67,7 +67,7 @@ internal class StatusRequester { ) fun requestAndFollowRedirects(baseLocation: String, client: OwnCloudClient): RequestResult { - var currentLocation = baseLocation + var currentLocation = baseLocation + OwnCloudClient.STATUS_PATH var redirectedToUnsecureLocation = false var status: Int From 91c7900d5cc37786b1fdd58085e1ad54adb4159e Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Mon, 21 Sep 2020 15:03:53 +0200 Subject: [PATCH 28/49] fix ip address without http prefix not recognized --- .../lib/GetRemoteStatusOperationTest.kt | 118 ++++++++++++++++++ .../android/lib/StatusRequestorTest.kt | 9 +- .../status/GetRemoteStatusOperation.kt | 17 ++- .../lib/resources/status/HttpScheme.kt | 2 + 4 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt rename owncloudComLibrary/src/{test => androidTest}/java/com/owncloud/android/lib/StatusRequestorTest.kt (91%) diff --git a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt new file mode 100644 index 00000000..14097c86 --- /dev/null +++ b/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt @@ -0,0 +1,118 @@ +package com.owncloud.android.lib + +import android.net.Uri +import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation +import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_PREFIX +import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_PREFIX +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Test + +class GetRemoteStatusOperationTest { + + @Test + fun urlStartingWithHttpMustBeDetectedAsSuch() { + assertTrue(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(HTTP_SOME_OWNCLOUD))) + } + + @Test + fun urlStartingWithHttpsMustBeDetectedAsSuch() { + assertTrue(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(HTTPS_SOME_OWNCLOUD))) + } + + @Test + fun incompleteUrlWithoutHttpsOrHttpSchemeMustBeDetectedAsSuch() { + assertFalse(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(SOME_OWNCLOUD))) + } + + @Test + fun completeUrlWithHttpMustBeReturnedAsSuch() { + assertEquals( + Uri.parse(HTTP_SOME_OWNCLOUD), + GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_OWNCLOUD)) + ) + } + + @Test + fun completeUrlWithHttpsMustBeReturnedAsSuch() { + assertEquals( + Uri.parse(HTTPS_SOME_OWNCLOUD), + GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTPS_SOME_OWNCLOUD)) + ) + } + + @Test + fun incompleteUrlWithoutHttpPrefixMustBeConvertedToProperUrlWithHttpsPrefix() { + assertEquals( + Uri.parse(HTTPS_SOME_OWNCLOUD), + GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_OWNCLOUD)) + ) + } + + @Test + fun completeUrlWithSubdirAndHttpsMustBeReturnedAsSuch() { + assertEquals( + Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( + Uri.parse( + HTTPS_SOME_OWNCLOUD_WITH_SUBDIR + ) + ) + ) + } + + @Test + fun incompleteUrlWithSubdirAndWithoutHttpPrefixMustBeConvertedToProperUrlWithHttpsPrefix() { + assertEquals( + Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( + Uri.parse( + SOME_OWNCLOUD_WITH_SUBDIR + ) + ) + ) + } + + @Test + fun ipMustBeConvertedToProperUrl() { + assertEquals(Uri.parse(HTTPS_SOME_IP), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_IP))) + } + + @Test + fun urlContainingIpAndHttpPrefixMustBeReturnedAsSuch() { + assertEquals(Uri.parse(HTTP_SOME_IP), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_IP))) + } + + @Test + fun ipAndPortMustBeConvertedToProperUrl() { + assertEquals( + Uri.parse(HTTPS_SOME_IP_WITH_PORT), + GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_IP_WITH_PORT)) + ) + } + + @Test + fun urlContainingIpAndPortAndHttpPrefixMustBeReturnedAsSuch() { + assertEquals( + Uri.parse(HTTP_SOME_IP_WITH_PORT), + GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_IP_WITH_PORT)) + ) + } + + companion object { + val SOME_OWNCLOUD = "some_owncloud.com" + val HTTP_SOME_OWNCLOUD = "$HTTP_PREFIX$SOME_OWNCLOUD" + val HTTPS_SOME_OWNCLOUD = "$HTTPS_PREFIX$SOME_OWNCLOUD" + + val SOME_OWNCLOUD_WITH_SUBDIR = "some_owncloud.com/subdir" + val HTTP_SOME_OWNCLOUD_WITH_SUBDIR = "$HTTP_PREFIX$SOME_OWNCLOUD_WITH_SUBDIR" + val HTTPS_SOME_OWNCLOUD_WITH_SUBDIR = "$HTTPS_PREFIX$SOME_OWNCLOUD_WITH_SUBDIR" + + val SOME_IP = "184.123.185.12" + val HTTP_SOME_IP = "$HTTP_PREFIX$SOME_IP" + val HTTPS_SOME_IP = "$HTTPS_PREFIX$SOME_IP" + + val SOME_IP_WITH_PORT = "184.123.185.12:5678" + val HTTP_SOME_IP_WITH_PORT = "$HTTP_PREFIX$SOME_IP_WITH_PORT" + val HTTPS_SOME_IP_WITH_PORT = "$HTTPS_PREFIX$SOME_IP_WITH_PORT" + } +} \ No newline at end of file diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/StatusRequestorTest.kt similarity index 91% rename from owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt rename to owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/StatusRequestorTest.kt index 15988187..c4697503 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -32,26 +32,25 @@ class StatusRequestorTest { private val requestor = StatusRequester() @Test - fun `update location with an absolute path`() { + fun testUpdateLocationWithAnAbsolutePath() { val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH") assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test - - fun `update location with a smaller absolute path`() { + fun updateLocationWithASmallerAbsolutePath() { val newLocation = requestor.updateLocationWithRedirectPath("$TEST_DOMAIN$SUB_PATH", TEST_DOMAIN) assertEquals(TEST_DOMAIN, newLocation) } @Test - fun `update location with a relative path`() { + fun updateLocationWithARelativePath() { val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test - fun `update location by replacing the relative path`() { + fun updateLocationByReplacingTheRelativePath() { val newLocation = requestor.updateLocationWithRedirectPath( "$TEST_DOMAIN/some/other/subdir", SUB_PATH ) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index ba3b4311..5c16b844 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -28,7 +28,9 @@ import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperation import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode +import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_PREFIX import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_SCHEME +import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_PREFIX import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME import org.json.JSONException import timber.log.Timber @@ -44,8 +46,7 @@ import timber.log.Timber class GetRemoteStatusOperation : RemoteOperation() { override fun run(client: OwnCloudClient): RemoteOperationResult { - if (client.baseUri.scheme.isNullOrEmpty()) - client.baseUri = Uri.parse("$HTTPS_SCHEME://${client.baseUri}") + client.baseUri = buildFullHttpsUrl(client.baseUri) var result = tryToConnect(client) if (result.code != ResultCode.OK_SSL && !result.isSslRecoverableException) { @@ -70,4 +71,16 @@ class GetRemoteStatusOperation : RemoteOperation() { RemoteOperationResult(e) } } + + companion object { + fun usesHttpOrHttps(uri: Uri) = + uri.toString().startsWith(HTTPS_PREFIX) || uri.toString().startsWith(HTTP_PREFIX) + + fun buildFullHttpsUrl(baseUri: Uri): Uri { + if (usesHttpOrHttps(baseUri)) { + return baseUri + } + return Uri.parse("$HTTPS_PREFIX$baseUri") + } + } } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt index 091ce146..48659324 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt @@ -27,4 +27,6 @@ package com.owncloud.android.lib.resources.status object HttpScheme { const val HTTP_SCHEME = "http" const val HTTPS_SCHEME = "https" + const val HTTP_PREFIX = "$HTTP_SCHEME://" + const val HTTPS_PREFIX = "$HTTPS_SCHEME://" } From d0a710e31b03886b634ce6326ceedf1afc0c250f Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 24 Sep 2020 12:16:46 +0200 Subject: [PATCH 29/49] add fixes according to review --- .../lib/GetRemoteStatusOperationTest.kt | 48 +++++++++---------- .../android/lib/StatusRequestorTest.kt | 8 ++-- 2 files changed, 28 insertions(+), 28 deletions(-) rename owncloudComLibrary/src/{androidTest => test}/java/com/owncloud/android/lib/StatusRequestorTest.kt (91%) diff --git a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt index 14097c86..3a274441 100644 --- a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt +++ b/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt @@ -12,22 +12,22 @@ import org.junit.Test class GetRemoteStatusOperationTest { @Test - fun urlStartingWithHttpMustBeDetectedAsSuch() { + fun use_http_or_https_ok_http() { assertTrue(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(HTTP_SOME_OWNCLOUD))) } @Test - fun urlStartingWithHttpsMustBeDetectedAsSuch() { + fun uses_http_or_https_ok_https() { assertTrue(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(HTTPS_SOME_OWNCLOUD))) } @Test - fun incompleteUrlWithoutHttpsOrHttpSchemeMustBeDetectedAsSuch() { + fun use_http_or_https_ok_no_http_or_https() { assertFalse(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(SOME_OWNCLOUD))) } @Test - fun completeUrlWithHttpMustBeReturnedAsSuch() { + fun build_full_https_url_ok_http() { assertEquals( Uri.parse(HTTP_SOME_OWNCLOUD), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_OWNCLOUD)) @@ -35,7 +35,7 @@ class GetRemoteStatusOperationTest { } @Test - fun completeUrlWithHttpsMustBeReturnedAsSuch() { + fun build_full_https_url_ok_https() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTPS_SOME_OWNCLOUD)) @@ -43,7 +43,7 @@ class GetRemoteStatusOperationTest { } @Test - fun incompleteUrlWithoutHttpPrefixMustBeConvertedToProperUrlWithHttpsPrefix() { + fun build_full_https_url_ok_no_prefix() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_OWNCLOUD)) @@ -51,7 +51,7 @@ class GetRemoteStatusOperationTest { } @Test - fun completeUrlWithSubdirAndHttpsMustBeReturnedAsSuch() { + fun build_full_https_url_ok_no_https_with_subdir() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( Uri.parse( @@ -62,7 +62,7 @@ class GetRemoteStatusOperationTest { } @Test - fun incompleteUrlWithSubdirAndWithoutHttpPrefixMustBeConvertedToProperUrlWithHttpsPrefix() { + fun build_full_https_url_ok_no_prefix_with_subdir() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( Uri.parse( @@ -73,17 +73,17 @@ class GetRemoteStatusOperationTest { } @Test - fun ipMustBeConvertedToProperUrl() { + fun build_full_https_url_ok_ip() { assertEquals(Uri.parse(HTTPS_SOME_IP), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_IP))) } @Test - fun urlContainingIpAndHttpPrefixMustBeReturnedAsSuch() { + fun build_full_https_url_http_ip() { assertEquals(Uri.parse(HTTP_SOME_IP), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_IP))) } @Test - fun ipAndPortMustBeConvertedToProperUrl() { + fun build_full_https_url_ok_ip_with_port() { assertEquals( Uri.parse(HTTPS_SOME_IP_WITH_PORT), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_IP_WITH_PORT)) @@ -91,7 +91,7 @@ class GetRemoteStatusOperationTest { } @Test - fun urlContainingIpAndPortAndHttpPrefixMustBeReturnedAsSuch() { + fun build_full_https_url_ok_ip_with_http_and_port() { assertEquals( Uri.parse(HTTP_SOME_IP_WITH_PORT), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_IP_WITH_PORT)) @@ -99,20 +99,20 @@ class GetRemoteStatusOperationTest { } companion object { - val SOME_OWNCLOUD = "some_owncloud.com" - val HTTP_SOME_OWNCLOUD = "$HTTP_PREFIX$SOME_OWNCLOUD" - val HTTPS_SOME_OWNCLOUD = "$HTTPS_PREFIX$SOME_OWNCLOUD" + const val SOME_OWNCLOUD = "some_owncloud.com" + const val HTTP_SOME_OWNCLOUD = "$HTTP_PREFIX$SOME_OWNCLOUD" + const val HTTPS_SOME_OWNCLOUD = "$HTTPS_PREFIX$SOME_OWNCLOUD" - val SOME_OWNCLOUD_WITH_SUBDIR = "some_owncloud.com/subdir" - val HTTP_SOME_OWNCLOUD_WITH_SUBDIR = "$HTTP_PREFIX$SOME_OWNCLOUD_WITH_SUBDIR" - val HTTPS_SOME_OWNCLOUD_WITH_SUBDIR = "$HTTPS_PREFIX$SOME_OWNCLOUD_WITH_SUBDIR" + const val SOME_OWNCLOUD_WITH_SUBDIR = "some_owncloud.com/subdir" + const val HTTP_SOME_OWNCLOUD_WITH_SUBDIR = "$HTTP_PREFIX$SOME_OWNCLOUD_WITH_SUBDIR" + const val HTTPS_SOME_OWNCLOUD_WITH_SUBDIR = "$HTTPS_PREFIX$SOME_OWNCLOUD_WITH_SUBDIR" - val SOME_IP = "184.123.185.12" - val HTTP_SOME_IP = "$HTTP_PREFIX$SOME_IP" - val HTTPS_SOME_IP = "$HTTPS_PREFIX$SOME_IP" + const val SOME_IP = "184.123.185.12" + const val HTTP_SOME_IP = "$HTTP_PREFIX$SOME_IP" + const val HTTPS_SOME_IP = "$HTTPS_PREFIX$SOME_IP" - val SOME_IP_WITH_PORT = "184.123.185.12:5678" - val HTTP_SOME_IP_WITH_PORT = "$HTTP_PREFIX$SOME_IP_WITH_PORT" - val HTTPS_SOME_IP_WITH_PORT = "$HTTPS_PREFIX$SOME_IP_WITH_PORT" + const val SOME_IP_WITH_PORT = "184.123.185.12:5678" + const val HTTP_SOME_IP_WITH_PORT = "$HTTP_PREFIX$SOME_IP_WITH_PORT" + const val HTTPS_SOME_IP_WITH_PORT = "$HTTPS_PREFIX$SOME_IP_WITH_PORT" } } \ No newline at end of file diff --git a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt similarity index 91% rename from owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/StatusRequestorTest.kt rename to owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index c4697503..a4e3de0e 100644 --- a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -32,25 +32,25 @@ class StatusRequestorTest { private val requestor = StatusRequester() @Test - fun testUpdateLocationWithAnAbsolutePath() { + fun `update location - ok - absolute path`() { val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH") assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test - fun updateLocationWithASmallerAbsolutePath() { + fun `update location - ok - smaller absolute path`() { val newLocation = requestor.updateLocationWithRedirectPath("$TEST_DOMAIN$SUB_PATH", TEST_DOMAIN) assertEquals(TEST_DOMAIN, newLocation) } @Test - fun updateLocationWithARelativePath() { + fun `update location - ok - relative path`() { val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test - fun updateLocationByReplacingTheRelativePath() { + fun `update location - ok - replace relative path`() { val newLocation = requestor.updateLocationWithRedirectPath( "$TEST_DOMAIN/some/other/subdir", SUB_PATH ) From cba63c060f914b6fc9c08020584eb834dbbfd1c7 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 24 Sep 2020 12:27:25 +0200 Subject: [PATCH 30/49] use robolectric for android tests --- gradle.properties | 4 ++++ owncloudComLibrary/build.gradle | 7 +++++++ .../owncloud/android/lib/GetRemoteStatusOperationTest.kt | 6 ++++++ 3 files changed, 17 insertions(+) rename owncloudComLibrary/src/{androidTest => test}/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt (94%) diff --git a/gradle.properties b/gradle.properties index 53ae0ae4..57264122 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,7 @@ android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M +<<<<<<< HEAD +======= +android.enableUnitTestBinaryResources=true +>>>>>>> use robolectric for android tests diff --git a/owncloudComLibrary/build.gradle b/owncloudComLibrary/build.gradle index 7053882e..85232e93 100644 --- a/owncloudComLibrary/build.gradle +++ b/owncloudComLibrary/build.gradle @@ -15,6 +15,7 @@ dependencies { kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion" testImplementation 'junit:junit:4.13.2' + testImplementation 'org.robolectric:robolectric:4.3.1' } android { @@ -37,4 +38,10 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } + + testOptions { + unitTests { + includeAndroidResources = true + } + } } diff --git a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt similarity index 94% rename from owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt rename to owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt index 3a274441..7838215f 100644 --- a/owncloudComLibrary/src/androidTest/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt @@ -1,6 +1,7 @@ package com.owncloud.android.lib import android.net.Uri +import android.os.Build import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_PREFIX import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_PREFIX @@ -8,7 +9,12 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.Test +import org.junit.runner.RunWith +import org.robolectric.RobolectricTestRunner +import org.robolectric.annotation.Config +@RunWith(RobolectricTestRunner::class) +@Config(sdk = [Build.VERSION_CODES.O_MR1]) class GetRemoteStatusOperationTest { @Test From c54f1c98f6d38c90bb37484da73a3348b7fd8041 Mon Sep 17 00:00:00 2001 From: agarcia Date: Thu, 24 Sep 2020 15:18:59 +0200 Subject: [PATCH 31/49] Update some tests naming and remove unused dependencies --- .../lib/GetRemoteStatusOperationTest.kt | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt index 7838215f..8cb93022 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt @@ -14,26 +14,26 @@ import org.robolectric.RobolectricTestRunner import org.robolectric.annotation.Config @RunWith(RobolectricTestRunner::class) -@Config(sdk = [Build.VERSION_CODES.O_MR1]) +@Config(sdk = [Build.VERSION_CODES.O], manifest = Config.NONE) class GetRemoteStatusOperationTest { @Test - fun use_http_or_https_ok_http() { + fun `uses http or https - ok - http`() { assertTrue(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(HTTP_SOME_OWNCLOUD))) } @Test - fun uses_http_or_https_ok_https() { + fun `uses http or https - ok - https`() { assertTrue(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(HTTPS_SOME_OWNCLOUD))) } @Test - fun use_http_or_https_ok_no_http_or_https() { + fun `uses http or https - ok - no http or https`() { assertFalse(GetRemoteStatusOperation.usesHttpOrHttps(Uri.parse(SOME_OWNCLOUD))) } @Test - fun build_full_https_url_ok_http() { + fun `build full https url - ok - http`() { assertEquals( Uri.parse(HTTP_SOME_OWNCLOUD), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_OWNCLOUD)) @@ -41,7 +41,7 @@ class GetRemoteStatusOperationTest { } @Test - fun build_full_https_url_ok_https() { + fun `build full https url - ok - https`() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTPS_SOME_OWNCLOUD)) @@ -49,7 +49,7 @@ class GetRemoteStatusOperationTest { } @Test - fun build_full_https_url_ok_no_prefix() { + fun `build full https url - ok - no prefix`() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_OWNCLOUD)) @@ -57,7 +57,7 @@ class GetRemoteStatusOperationTest { } @Test - fun build_full_https_url_ok_no_https_with_subdir() { + fun `build full https url - ok - no https with subdir`() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( Uri.parse( @@ -68,7 +68,7 @@ class GetRemoteStatusOperationTest { } @Test - fun build_full_https_url_ok_no_prefix_with_subdir() { + fun `build full https url - ok - no prefix with subdir`() { assertEquals( Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( Uri.parse( @@ -79,17 +79,17 @@ class GetRemoteStatusOperationTest { } @Test - fun build_full_https_url_ok_ip() { + fun `build full https url - ok - ip`() { assertEquals(Uri.parse(HTTPS_SOME_IP), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_IP))) } @Test - fun build_full_https_url_http_ip() { + fun `build full https url - ok - http ip`() { assertEquals(Uri.parse(HTTP_SOME_IP), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_IP))) } @Test - fun build_full_https_url_ok_ip_with_port() { + fun `build full https url - ok - ip with port`() { assertEquals( Uri.parse(HTTPS_SOME_IP_WITH_PORT), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(SOME_IP_WITH_PORT)) @@ -97,7 +97,7 @@ class GetRemoteStatusOperationTest { } @Test - fun build_full_https_url_ok_ip_with_http_and_port() { + fun `build full https url - ok - ip with http and port`() { assertEquals( Uri.parse(HTTP_SOME_IP_WITH_PORT), GetRemoteStatusOperation.buildFullHttpsUrl(Uri.parse(HTTP_SOME_IP_WITH_PORT)) From c3189b7b465dd0a3aaf985ee868639d24f624c8a Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 22 Sep 2020 16:38:28 +0200 Subject: [PATCH 32/49] replace old cookies but don't delete them --- .../lib/common/OwnCloudClientFactory.java | 8 ++ .../android/lib/common/http/CookieJarImpl.kt | 40 +++++++ .../android/lib/common/http/HttpClient.java | 107 ++++++++---------- .../status/GetRemoteStatusOperation.kt | 2 +- .../implementation/OCServerInfoService.kt | 6 + 5 files changed, 103 insertions(+), 60 deletions(-) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java index d78e4d6a..f5c64bfa 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java @@ -27,6 +27,8 @@ package com.owncloud.android.lib.common; import android.content.Context; import android.net.Uri; +import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation; + public class OwnCloudClientFactory { /** @@ -43,7 +45,13 @@ public class OwnCloudClientFactory { client.setFollowRedirects(followRedirects); client.setContext(context); + retriveCookisFromMiddleware(client); return client; } + + public static void retriveCookisFromMiddleware(OwnCloudClient client) { + final GetRemoteStatusOperation statusOperation = new GetRemoteStatusOperation(); + statusOperation.run(client); + } } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt new file mode 100644 index 00000000..9070c812 --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt @@ -0,0 +1,40 @@ +package com.owncloud.android.lib.common.http + +import okhttp3.Cookie +import okhttp3.CookieJar +import okhttp3.HttpUrl + +class CookieJarImpl( + private val sCookieStore: HashMap> +) : CookieJar { + + private fun containsCookieWithName(cookies: List, name: String): Boolean { + for (cookie: Cookie in cookies) { + if (cookie.name == name) { + return true; + } + } + return false; + } + + private fun getUpdatedCookies(oldCookies: List, newCookies: List): List { + val updatedList = ArrayList(newCookies); + for (oldCookie: Cookie in oldCookies) { + if (!containsCookieWithName(updatedList, oldCookie.name)) { + updatedList.add(oldCookie); + } + } + return updatedList; + } + + override fun saveFromResponse(url: HttpUrl, newCookies: List) { + // Avoid duplicated cookies but update + val currentCookies: List = sCookieStore[url.host] ?: ArrayList() + val updatedCookies: List = getUpdatedCookies(currentCookies, newCookies); + sCookieStore.put(url.host, updatedCookies); + } + + override fun loadForRequest(url: HttpUrl) = + sCookieStore[url.host] ?: ArrayList() + +} diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java index 06e8056d..8762954a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java @@ -39,13 +39,11 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.SSLSocketFactory; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; +import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; -import java.util.HashSet; import java.util.List; -import java.util.Set; import java.util.concurrent.TimeUnit; /** @@ -53,6 +51,7 @@ import java.util.concurrent.TimeUnit; * * @author David González Verdugo */ + public class HttpClient { private static OkHttpClient sOkHttpClient; private static Context sContext; @@ -64,66 +63,13 @@ public class HttpClient { try { final X509TrustManager trustManager = new AdvancedX509TrustManager( NetworkUtils.getKnownServersStore(sContext)); - - SSLContext sslContext; - - try { - sslContext = SSLContext.getInstance("TLSv1.3"); - } catch (NoSuchAlgorithmException tlsv13Exception) { - try { - Timber.w("TLSv1.3 is not supported in this device; falling through TLSv1.2"); - sslContext = SSLContext.getInstance("TLSv1.2"); - } catch (NoSuchAlgorithmException tlsv12Exception) { - try { - Timber.w("TLSv1.2 is not supported in this device; falling through TLSv1.1"); - sslContext = SSLContext.getInstance("TLSv1.1"); - } catch (NoSuchAlgorithmException tlsv11Exception) { - Timber.w("TLSv1.1 is not supported in this device; falling through TLSv1.0"); - sslContext = SSLContext.getInstance("TLSv1"); - // should be available in any device; see reference of supported protocols in - // http://developer.android.com/reference/javax/net/ssl/SSLSocket.html - } - } - } - - sslContext.init(null, new TrustManager[]{trustManager}, null); - - SSLSocketFactory sslSocketFactory; - - sslSocketFactory = sslContext.getSocketFactory(); - + final SSLSocketFactory sslSocketFactory = getNewSslSocketFactory(trustManager); // Automatic cookie handling, NOT PERSISTENT - CookieJar cookieJar = new CookieJar() { - @Override - public void saveFromResponse(HttpUrl url, List cookies) { - // Avoid duplicated cookies - Set nonDuplicatedCookiesSet = new HashSet<>(cookies); - List nonDuplicatedCookiesList = new ArrayList<>(nonDuplicatedCookiesSet); + final CookieJar cookieJar = new CookieJarImpl(sCookieStore); - sCookieStore.put(url.host(), nonDuplicatedCookiesList); - } - - @Override - public List loadForRequest(HttpUrl url) { - List cookies = sCookieStore.get(url.host()); - return cookies != null ? cookies : new ArrayList<>(); - } - }; - - OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder() - .addNetworkInterceptor(getLogInterceptor()) - .protocols(Arrays.asList(Protocol.HTTP_1_1)) - .readTimeout(HttpConstants.DEFAULT_DATA_TIMEOUT, TimeUnit.MILLISECONDS) - .writeTimeout(HttpConstants.DEFAULT_DATA_TIMEOUT, TimeUnit.MILLISECONDS) - .connectTimeout(HttpConstants.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS) - .followRedirects(false) - .sslSocketFactory(sslSocketFactory, trustManager) - .hostnameVerifier((asdf, usdf) -> true) - .cookieJar(cookieJar); // TODO: Not verifying the hostname against certificate. ask owncloud security human if this is ok. //.hostnameVerifier(new BrowserCompatHostnameVerifier()); - - sOkHttpClient = clientBuilder.build(); + sOkHttpClient = buildNewOkHttpClient(sslSocketFactory, trustManager, cookieJar); } catch (Exception e) { Timber.e(e, "Could not setup SSL system."); @@ -132,6 +78,49 @@ public class HttpClient { return sOkHttpClient; } + private static SSLContext getSslContext() throws NoSuchAlgorithmException { + try { + return SSLContext.getInstance("TLSv1.3"); + } catch (NoSuchAlgorithmException tlsv13Exception) { + try { + Timber.w("TLSv1.3 is not supported in this device; falling through TLSv1.2"); + return SSLContext.getInstance("TLSv1.2"); + } catch (NoSuchAlgorithmException tlsv12Exception) { + try { + Timber.w("TLSv1.2 is not supported in this device; falling through TLSv1.1"); + return SSLContext.getInstance("TLSv1.1"); + } catch (NoSuchAlgorithmException tlsv11Exception) { + Timber.w("TLSv1.1 is not supported in this device; falling through TLSv1.0"); + return SSLContext.getInstance("TLSv1"); + // should be available in any device; see reference of supported protocols in + // http://developer.android.com/reference/javax/net/ssl/SSLSocket.html + } + } + } + } + + private static SSLSocketFactory getNewSslSocketFactory(X509TrustManager trustManager) + throws NoSuchAlgorithmException, KeyManagementException { + final SSLContext sslContext = getSslContext(); + sslContext.init(null, new TrustManager[]{trustManager}, null); + return sslContext.getSocketFactory(); + } + + private static OkHttpClient buildNewOkHttpClient(SSLSocketFactory sslSocketFactory, X509TrustManager trustManager, + CookieJar cookieJar) { + return new OkHttpClient.Builder() + .addNetworkInterceptor(getLogInterceptor()) + .protocols(Arrays.asList(Protocol.HTTP_1_1)) + .readTimeout(HttpConstants.DEFAULT_DATA_TIMEOUT, TimeUnit.MILLISECONDS) + .writeTimeout(HttpConstants.DEFAULT_DATA_TIMEOUT, TimeUnit.MILLISECONDS) + .connectTimeout(HttpConstants.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS) + .followRedirects(false) + .sslSocketFactory(sslSocketFactory, trustManager) + .hostnameVerifier((asdf, usdf) -> true) + .cookieJar(cookieJar) + .build(); + } + public Context getContext() { return sContext; } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index 5c16b844..ecace174 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -45,7 +45,7 @@ import timber.log.Timber */ class GetRemoteStatusOperation : RemoteOperation() { - override fun run(client: OwnCloudClient): RemoteOperationResult { + public override fun run(client: OwnCloudClient): RemoteOperationResult { client.baseUri = buildFullHttpsUrl(client.baseUri) var result = tryToConnect(client) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt index 65b85479..e1250d84 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt @@ -43,4 +43,10 @@ class OCServerInfoService : ServerInfoService { client: OwnCloudClient ): RemoteOperationResult = GetRemoteStatusOperation().execute(client) + + private fun createClientFromPath(path: String): OwnCloudClient { + val client = OwnCloudClient(Uri.parse(path)).apply { credentials = getAnonymousCredentials() } + OwnCloudClientFactory.retriveCookisFromMiddleware(client) + return client + } } From 654efea7e5fb173beecac31dc501c8a91da804aa Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 22 Sep 2020 17:15:45 +0200 Subject: [PATCH 33/49] add tests for cookie jar --- .../android/lib/common/http/CookieJarImpl.kt | 10 +-- .../owncloud/android/lib/CookieJarImplTest.kt | 74 +++++++++++++++++++ 2 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt index 9070c812..83ad8f5c 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt @@ -8,7 +8,7 @@ class CookieJarImpl( private val sCookieStore: HashMap> ) : CookieJar { - private fun containsCookieWithName(cookies: List, name: String): Boolean { + fun containsCookieWithName(cookies: List, name: String): Boolean { for (cookie: Cookie in cookies) { if (cookie.name == name) { return true; @@ -17,7 +17,7 @@ class CookieJarImpl( return false; } - private fun getUpdatedCookies(oldCookies: List, newCookies: List): List { + fun getUpdatedCookies(oldCookies: List, newCookies: List): List { val updatedList = ArrayList(newCookies); for (oldCookie: Cookie in oldCookies) { if (!containsCookieWithName(updatedList, oldCookie.name)) { @@ -27,11 +27,11 @@ class CookieJarImpl( return updatedList; } - override fun saveFromResponse(url: HttpUrl, newCookies: List) { + override fun saveFromResponse(url: HttpUrl, cookies: List) { // Avoid duplicated cookies but update val currentCookies: List = sCookieStore[url.host] ?: ArrayList() - val updatedCookies: List = getUpdatedCookies(currentCookies, newCookies); - sCookieStore.put(url.host, updatedCookies); + val updatedCookies: List = getUpdatedCookies(currentCookies, cookies); + sCookieStore[url.host] = updatedCookies; } override fun loadForRequest(url: HttpUrl) = diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt new file mode 100644 index 00000000..f0e62a1f --- /dev/null +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt @@ -0,0 +1,74 @@ +package com.owncloud.android.lib + +import com.owncloud.android.lib.common.http.CookieJarImpl +import junit.framework.Assert.assertEquals +import junit.framework.Assert.assertFalse +import junit.framework.Assert.assertTrue +import okhttp3.Cookie +import okhttp3.HttpUrl.Companion.toHttpUrl +import org.junit.Test + +class CookieJarImplTest { + + private val oldCookies = ArrayList().apply { + add(COOKIE_A) + add(COOKIE_B_OLD) + } + + private val newCookies = ArrayList().apply { + add(COOKIE_B_NEW) + } + + private val updatedCookies = ArrayList().apply { + add(COOKIE_A) + add(COOKIE_B_NEW) + } + + private val cookieStore = HashMap>().apply { + put(SOME_HOST, oldCookies) + } + + private val cookieJarImpl = CookieJarImpl(cookieStore) + + @Test + fun testContainsCookieWithNameReturnsTrue() { + assertTrue(cookieJarImpl.containsCookieWithName(oldCookies, COOKIE_B_OLD.name)) + } + + @Test + fun testContainsCookieWithNameReturnsFalse() { + assertFalse(cookieJarImpl.containsCookieWithName(newCookies, COOKIE_A.name)) + } + + @Test + fun testGetUpdatedCookies() { + val generatedUpdatedCookies = cookieJarImpl.getUpdatedCookies(oldCookies, newCookies) + assertEquals(2, generatedUpdatedCookies.size) + assertEquals(updatedCookies[0], generatedUpdatedCookies[1]) + assertEquals(updatedCookies[1], generatedUpdatedCookies[0]) + } + + @Test + fun testCookieStoreUpdateViaSaveFromResponse() { + cookieJarImpl.saveFromResponse(SOME_URL, newCookies) + val generatedUpdatedCookies = cookieStore[SOME_HOST] + assertEquals(2, generatedUpdatedCookies?.size) + assertEquals(updatedCookies[0], generatedUpdatedCookies?.get(1)) + assertEquals(updatedCookies[1], generatedUpdatedCookies?.get(0)) + } + + @Test + fun testLoadForRequest() { + val cookies = cookieJarImpl.loadForRequest(SOME_URL) + assertEquals(oldCookies[0], cookies[0]) + assertEquals(oldCookies[1], cookies[1]) + } + + companion object { + const val SOME_HOST = "some.host.com" + val SOME_URL = "https://$SOME_HOST".toHttpUrl() + val COOKIE_A = Cookie.parse(SOME_URL, "CookieA=CookieValueA")!! + val COOKIE_B_OLD = Cookie.parse(SOME_URL, "CookieB=CookieOldValueB")!! + val COOKIE_B_NEW = Cookie.parse(SOME_URL, "CookieB=CookieNewValueB")!! + } +} \ No newline at end of file From f8904dca9da14f02f78dfe672a50dd8ad280acfd Mon Sep 17 00:00:00 2001 From: agarcia Date: Wed, 23 Sep 2020 13:21:15 +0200 Subject: [PATCH 34/49] Make get cookies static --- .../java/com/owncloud/android/lib/common/http/HttpClient.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java index 8762954a..7a904c93 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java @@ -136,7 +136,7 @@ public class HttpClient { return sLogInterceptor; } - public List getCookiesFromUrl(HttpUrl httpUrl) { + public static List getCookiesFromUrl(HttpUrl httpUrl) { return sCookieStore.get(httpUrl.host()); } From 033e6822a246d0e7d59c4c490cd4b8dc9df0ac2b Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Mon, 19 Oct 2020 14:55:39 +0200 Subject: [PATCH 35/49] prevent acumulating cookies on account change --- .../owncloud/android/lib/common/SingleSessionManager.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java index e011a7fa..e3c94d7a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java @@ -111,6 +111,12 @@ public class SingleSessionManager { account.getBaseUri(), context.getApplicationContext(), true); // TODO remove dependency on OwnCloudClientFactory + + //the next two lines are a hack because okHttpclient is used as a singleton instead of being an + //injected instance that can be deleted when required + client.clearCookies(); + client.clearCredentials(); + client.setAccount(account); HttpClient.setContext(context); From 51dacd0bb0bac926752d04f32cacd613ad152819 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 29 Oct 2020 04:36:26 +0100 Subject: [PATCH 36/49] remove KEY_OC_VERSION key --- .../owncloud/android/lib/common/accounts/AccountUtils.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java index d8983ed9..21aa5f29 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java @@ -299,11 +299,6 @@ public class AccountUtils { public static final String OAUTH_SUPPORTED_TRUE = "TRUE"; - /** - * OC account cookies - */ - public static final String KEY_COOKIES = "oc_account_cookies"; - /** * OC account version */ From f9ea701e2f09480dc4b0e4d4d8016e6a666e4a9f Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Thu, 22 Oct 2020 14:15:18 +0200 Subject: [PATCH 37/49] remove cookie persistence --- .../lib/common/SingleSessionManager.java | 30 --------- .../lib/common/accounts/AccountUtils.java | 63 ------------------- .../common/operations/RemoteOperation.java | 5 -- 3 files changed, 98 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java index e3c94d7a..c410cc90 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/SingleSessionManager.java @@ -24,8 +24,6 @@ package com.owncloud.android.lib.common; -import android.accounts.Account; -import android.accounts.AccountManager; import android.accounts.AuthenticatorException; import android.accounts.OperationCanceledException; import android.content.Context; @@ -37,7 +35,6 @@ import com.owncloud.android.lib.common.http.HttpClient; import timber.log.Timber; import java.io.IOException; -import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; @@ -136,7 +133,6 @@ public class SingleSessionManager { Timber.v("reusing client for session %s", sessionName); } - keepCookiesUpdated(context, account, client); keepUriUpdated(account, client); } Timber.d("getClientFor finishing "); @@ -167,32 +163,6 @@ public class SingleSessionManager { Timber.d("removeClientFor finishing "); } - public void saveAllClients(Context context, String accountType) { - Timber.d("Saving sessions... "); - - Iterator accountNames = mClientsWithKnownUsername.keySet().iterator(); - String accountName; - Account account; - while (accountNames.hasNext()) { - accountName = accountNames.next(); - account = new Account(accountName, accountType); - AccountUtils.saveClient(mClientsWithKnownUsername.get(accountName), account, context); - } - - Timber.d("All sessions saved"); - } - - private void keepCookiesUpdated(Context context, OwnCloudAccount account, OwnCloudClient reusedClient) { - AccountManager am = AccountManager.get(context.getApplicationContext()); - if (am != null && account.getSavedAccount() != null) { - String recentCookies = am.getUserData(account.getSavedAccount(), AccountUtils.Constants.KEY_COOKIES); - String previousCookies = reusedClient.getCookiesString(); - if (recentCookies != null && !previousCookies.equals("") && !recentCookies.equals(previousCookies)) { - AccountUtils.restoreCookies(account.getSavedAccount(), reusedClient, context); - } - } - } - public void refreshCredentialsForAccount(String accountName, OwnCloudCredentials credentials) { OwnCloudClient ownCloudClient = mClientsWithKnownUsername.get(accountName); if (ownCloudClient == null) { diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java index 21aa5f29..32e062ae 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/accounts/AccountUtils.java @@ -36,15 +36,10 @@ import android.net.Uri; import com.owncloud.android.lib.common.OwnCloudClient; import com.owncloud.android.lib.common.authentication.OwnCloudCredentials; import com.owncloud.android.lib.common.authentication.OwnCloudCredentialsFactory; -import com.owncloud.android.lib.resources.files.FileUtils; import com.owncloud.android.lib.resources.status.OwnCloudVersion; -import okhttp3.Cookie; import timber.log.Timber; -import java.io.File; import java.io.IOException; -import java.util.ArrayList; -import java.util.List; public class AccountUtils { /** @@ -202,64 +197,6 @@ public class AccountUtils { return username + "@" + url; } - public static void saveClient(OwnCloudClient client, Account savedAccount, Context context) { - // Account Manager - AccountManager ac = AccountManager.get(context.getApplicationContext()); - - if (client != null) { - String cookiesString = client.getCookiesString(); - if (!"".equals(cookiesString)) { - ac.setUserData(savedAccount, Constants.KEY_COOKIES, cookiesString); - Timber.d("Saving Cookies: %s", cookiesString); - } - } - } - - /** - * Restore the client cookies persisted in an account stored in the system AccountManager. - * - * @param account Stored account. - * @param client Client to restore cookies in. - * @param context Android context used to access the system AccountManager. - */ - public static void restoreCookies(Account account, OwnCloudClient client, Context context) { - if (account == null) { - Timber.d("Cannot restore cookie for null account"); - - } else { - Timber.d("Restoring cookies for %s", account.name); - - // Account Manager - AccountManager am = AccountManager.get(context.getApplicationContext()); - - Uri serverUri = (client.getBaseUri() != null) ? client.getBaseUri() : client.getUserFilesWebDavUri(); - - String cookiesString = am.getUserData(account, Constants.KEY_COOKIES); - if (cookiesString != null) { - String[] rawCookies = cookiesString.split(";"); - List cookieList = new ArrayList<>(rawCookies.length); - for (String rawCookie : rawCookies) { - rawCookie = rawCookie.replace(" ", ""); - final int equalPos = rawCookie.indexOf('='); - if (equalPos == -1) { - continue; - } - cookieList.add(new Cookie.Builder() - .name(rawCookie.substring(0, equalPos)) - .value(rawCookie.substring(equalPos + 1)) - .domain(serverUri.getHost()) - .path( - serverUri.getPath().equals("") - ? File.separator - : serverUri.getPath() - ) - .build()); - } - client.setCookiesForCurrentAccount(cookieList); - } - } - } - public static class AccountNotFoundException extends AccountsException { /** diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperation.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperation.java index 321907b6..ef2a8321 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperation.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/operations/RemoteOperation.java @@ -258,11 +258,6 @@ public abstract class RemoteOperation implements Runnable { final RemoteOperationResult resultToSend = runOperation(); - if (mAccount != null && mContext != null) { - // Save Client Cookies - AccountUtils.saveClient(mClient, mAccount, mContext); - } - if (mListenerHandler != null && mListener != null) { mListenerHandler.post(() -> mListener.onRemoteOperationFinish(RemoteOperation.this, resultToSend)); From 6ea9f9996dd67887619a9459a377be2bf047dbb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 3 Nov 2020 09:21:47 +0100 Subject: [PATCH 38/49] Fix problem during rebase --- gradle.properties | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 57264122..53ae0ae4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,3 @@ android.enableJetifier=true android.useAndroidX=true org.gradle.jvmargs=-Xmx1536M -<<<<<<< HEAD -======= -android.enableUnitTestBinaryResources=true ->>>>>>> use robolectric for android tests From 8eaa98af302dc1d1ca88cbe95efac823644b70d9 Mon Sep 17 00:00:00 2001 From: Schabi Date: Mon, 9 Nov 2020 14:39:51 +0100 Subject: [PATCH 39/49] accept ssl connections for status when OK is returned --- .../android/lib/resources/status/GetRemoteStatusOperation.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index ecace174..10d543c0 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -49,7 +49,9 @@ class GetRemoteStatusOperation : RemoteOperation() { client.baseUri = buildFullHttpsUrl(client.baseUri) var result = tryToConnect(client) - if (result.code != ResultCode.OK_SSL && !result.isSslRecoverableException) { + if (!(result.code == ResultCode.OK || result.code == ResultCode.OK_SSL) + && !result.isSslRecoverableException + ) { Timber.d("Establishing secure connection failed, trying non secure connection") client.baseUri = client.baseUri.buildUpon().scheme(HTTP_SCHEME).build() result = tryToConnect(client) From 950d3a50daf59a5455beda960e612a67e2056760 Mon Sep 17 00:00:00 2001 From: Schabi Date: Tue, 10 Nov 2020 11:25:33 +0100 Subject: [PATCH 40/49] fix wrong handling of redirect to unsecure connection --- .../lib/resources/status/StatusRequester.kt | 21 ++++++---- .../android/lib/StatusRequestorTest.kt | 39 ++++++++++++++++--- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index 2dbb3653..da13fa5c 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -28,6 +28,7 @@ import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.http.HttpConstants import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod import com.owncloud.android.lib.common.operations.RemoteOperationResult + import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_SCHEME import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME import org.json.JSONObject @@ -36,14 +37,20 @@ import java.util.concurrent.TimeUnit internal class StatusRequester { - private fun checkIfConnectionIsRedirectedToNoneSecure( - isConnectionSecure: Boolean, + /** + * This function is ment to detect if a redirect from a secure to an unsecure connection + * was made. If only connections from unsecure connections to unsecure connections were made + * this function should not return true, because if the whole redirect chain was unsecure + * we assume it was a debug setup. + */ + fun isRedirectedToNonSecureConnection( + redirectedToUnsecureLocationBefore: Boolean, baseUrl: String, redirectedUrl: String - ): Boolean { - return isConnectionSecure || - (baseUrl.startsWith(HTTPS_SCHEME) && redirectedUrl.startsWith(HTTP_SCHEME)) - } + ) = redirectedToUnsecureLocationBefore + || (baseUrl.startsWith(HTTPS_SCHEME) + && (!redirectedUrl.startsWith(HTTPS_SCHEME)) + && redirectedUrl.startsWith(HTTP_SCHEME)) fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { if (!redirectedLocation.startsWith("/")) @@ -84,7 +91,7 @@ internal class StatusRequester { } else { val nextLocation = updateLocationWithRedirectPath(currentLocation, result.redirectedLocation) redirectedToUnsecureLocation = - checkIfConnectionIsRedirectedToNoneSecure( + isRedirectedToNonSecureConnection( redirectedToUnsecureLocation, currentLocation, nextLocation diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index a4e3de0e..adf4d3ea 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -26,39 +26,68 @@ package com.owncloud.android.lib import com.owncloud.android.lib.resources.status.StatusRequester import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue import org.junit.Test class StatusRequestorTest { - private val requestor = StatusRequester() + private val requester = StatusRequester() @Test fun `update location - ok - absolute path`() { - val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH") + val newLocation = requester.updateLocationWithRedirectPath(TEST_DOMAIN, "$TEST_DOMAIN$SUB_PATH") assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test fun `update location - ok - smaller absolute path`() { - val newLocation = requestor.updateLocationWithRedirectPath("$TEST_DOMAIN$SUB_PATH", TEST_DOMAIN) + val newLocation = requester.updateLocationWithRedirectPath("$TEST_DOMAIN$SUB_PATH", TEST_DOMAIN) assertEquals(TEST_DOMAIN, newLocation) } @Test fun `update location - ok - relative path`() { - val newLocation = requestor.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH) + val newLocation = requester.updateLocationWithRedirectPath(TEST_DOMAIN, SUB_PATH) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test fun `update location - ok - replace relative path`() { - val newLocation = requestor.updateLocationWithRedirectPath( + val newLocation = requester.updateLocationWithRedirectPath( "$TEST_DOMAIN/some/other/subdir", SUB_PATH ) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } + @Test + fun `check redirect to unsecure connection - ok - redirect to http`() { + assertTrue(requester.isRedirectedToNonSecureConnection( + false, SECURE_DOMAIN, UNSECURE_DOMAIN)) + } + + @Test + fun `check redirect to unsecure connection - ko - redirect to https from http`() { + assertFalse(requester.isRedirectedToNonSecureConnection( + false, UNSECURE_DOMAIN, SECURE_DOMAIN)) + } + + @Test + fun `check redirect to unsecure connection - ko - from https to https`() { + assertFalse(requester.isRedirectedToNonSecureConnection( + false, SECURE_DOMAIN, SECURE_DOMAIN)) + } + + @Test + fun `check redirect to unsecure connection - ok - from https to https with previous http`() { + assertTrue(requester.isRedirectedToNonSecureConnection( + true, SECURE_DOMAIN, SECURE_DOMAIN)) + } + companion object { const val TEST_DOMAIN = "https://cloud.somewhere.com" const val SUB_PATH = "/subdir" + + const val SECURE_DOMAIN = "https://cloud.somewhere.com" + const val UNSECURE_DOMAIN = "http://somewhereelse.org" } } From 61ee5aab910bc0de12738f5f0192323ec8d3a8f8 Mon Sep 17 00:00:00 2001 From: Schabi Date: Tue, 10 Nov 2020 11:35:53 +0100 Subject: [PATCH 41/49] add test from redirect from http to http --- .../java/com/owncloud/android/lib/StatusRequestorTest.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt index adf4d3ea..2ea243c5 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt @@ -83,6 +83,12 @@ class StatusRequestorTest { true, SECURE_DOMAIN, SECURE_DOMAIN)) } + @Test + fun `check redirect to unsecure connection - ok - from http to http`() { + assertFalse(requester.isRedirectedToNonSecureConnection( + false, UNSECURE_DOMAIN, UNSECURE_DOMAIN)) + } + companion object { const val TEST_DOMAIN = "https://cloud.somewhere.com" const val SUB_PATH = "/subdir" From 9ad0e8f9bc56b07283fa0392e9e061af0846a8d4 Mon Sep 17 00:00:00 2001 From: Schabi Date: Tue, 10 Nov 2020 11:43:39 +0100 Subject: [PATCH 42/49] apply codereview --- .../owncloud/android/lib/resources/status/StatusRequester.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index da13fa5c..cb172003 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -49,8 +49,7 @@ internal class StatusRequester { redirectedUrl: String ) = redirectedToUnsecureLocationBefore || (baseUrl.startsWith(HTTPS_SCHEME) - && (!redirectedUrl.startsWith(HTTPS_SCHEME)) - && redirectedUrl.startsWith(HTTP_SCHEME)) + && !redirectedUrl.startsWith(HTTPS_SCHEME)) fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { if (!redirectedLocation.startsWith("/")) From 2a23a1c7730bf4b8112ae00652432ec57f3f8a35 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Tue, 10 Nov 2020 13:34:37 +0100 Subject: [PATCH 43/49] remove result from status requester --- .../owncloud/android/lib/resources/status/StatusRequester.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index cb172003..c19b9bea 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -68,7 +68,6 @@ internal class StatusRequester { data class RequestResult( val getMethod: GetMethod, val status: Int, - val result: RemoteOperationResult, val redirectedToUnsecureLocation: Boolean ) @@ -86,7 +85,7 @@ internal class StatusRequester { else RemoteOperationResult(getMethod) if (result.redirectedLocation.isNullOrEmpty() || result.isSuccess) { - return RequestResult(getMethod, status, result, redirectedToUnsecureLocation) + return RequestResult(getMethod, status, redirectedToUnsecureLocation) } else { val nextLocation = updateLocationWithRedirectPath(currentLocation, result.redirectedLocation) redirectedToUnsecureLocation = From 1194b9a412fad282967ae170961adf10266ed8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Thu, 19 Nov 2020 19:05:48 +0100 Subject: [PATCH 44/49] Use the same ownCloudClient across the whole login process --- .../status/services/implementation/OCServerInfoService.kt | 6 ------ 1 file changed, 6 deletions(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt index e1250d84..65b85479 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt @@ -43,10 +43,4 @@ class OCServerInfoService : ServerInfoService { client: OwnCloudClient ): RemoteOperationResult = GetRemoteStatusOperation().execute(client) - - private fun createClientFromPath(path: String): OwnCloudClient { - val client = OwnCloudClient(Uri.parse(path)).apply { credentials = getAnonymousCredentials() } - OwnCloudClientFactory.retriveCookisFromMiddleware(client) - return client - } } From 3a79a86cd74739448ebe4ef2d27c15652f772bd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 23 Feb 2021 17:46:04 +0100 Subject: [PATCH 45/49] Fix 301 redirections --- .../lib/common/OwnCloudClientFactory.java | 7 +-- .../status/GetRemoteStatusOperation.kt | 11 ++--- .../lib/resources/status/RemoteServerInfo.kt | 30 ++++++++++++ .../lib/resources/status/StatusRequester.kt | 46 +++++++++++++------ .../status/services/ServerInfoService.kt | 4 +- .../implementation/OCServerInfoService.kt | 4 +- 6 files changed, 73 insertions(+), 29 deletions(-) create mode 100644 owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java index f5c64bfa..948e8a07 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/OwnCloudClientFactory.java @@ -27,6 +27,7 @@ package com.owncloud.android.lib.common; import android.content.Context; import android.net.Uri; +import com.owncloud.android.lib.common.http.HttpClient; import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation; public class OwnCloudClientFactory { @@ -44,13 +45,13 @@ public class OwnCloudClientFactory { client.setFollowRedirects(followRedirects); - client.setContext(context); - retriveCookisFromMiddleware(client); + HttpClient.setContext(context); + retrieveCookiesFromMiddleware(client); return client; } - public static void retriveCookisFromMiddleware(OwnCloudClient client) { + private static void retrieveCookiesFromMiddleware(OwnCloudClient client) { final GetRemoteStatusOperation statusOperation = new GetRemoteStatusOperation(); statusOperation.run(client); } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index 10d543c0..eeb2aadf 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -29,7 +29,6 @@ import com.owncloud.android.lib.common.operations.RemoteOperation import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_PREFIX -import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_SCHEME import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_PREFIX import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME import org.json.JSONException @@ -43,15 +42,13 @@ import timber.log.Timber * @author David González Verdugo * @author Abel García de Prada */ -class GetRemoteStatusOperation : RemoteOperation() { +class GetRemoteStatusOperation : RemoteOperation() { - public override fun run(client: OwnCloudClient): RemoteOperationResult { + public override fun run(client: OwnCloudClient): RemoteOperationResult { client.baseUri = buildFullHttpsUrl(client.baseUri) var result = tryToConnect(client) - if (!(result.code == ResultCode.OK || result.code == ResultCode.OK_SSL) - && !result.isSslRecoverableException - ) { + if (!(result.code == ResultCode.OK || result.code == ResultCode.OK_SSL) && !result.isSslRecoverableException) { Timber.d("Establishing secure connection failed, trying non secure connection") client.baseUri = client.baseUri.buildUpon().scheme(HTTP_SCHEME).build() result = tryToConnect(client) @@ -60,7 +57,7 @@ class GetRemoteStatusOperation : RemoteOperation() { return result } - private fun tryToConnect(client: OwnCloudClient): RemoteOperationResult { + private fun tryToConnect(client: OwnCloudClient): RemoteOperationResult { val baseUrl = client.baseUri.toString() client.setFollowRedirects(false) return try { diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt new file mode 100644 index 00000000..5938368d --- /dev/null +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt @@ -0,0 +1,30 @@ +/* ownCloud Android Library is available under MIT license +* Copyright (C) 2020 ownCloud GmbH. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to deal +* in the Software without restriction, including without limitation the rights +* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +* copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +* THE SOFTWARE. +* +*/ +package com.owncloud.android.lib.resources.status + +data class RemoteServerInfo( + val ownCloudVersion: OwnCloudVersion, + val baseUrl: String, + val isSecureConnection: Boolean +) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index c19b9bea..842c7d36 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -28,9 +28,7 @@ import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.http.HttpConstants import com.owncloud.android.lib.common.http.methods.nonwebdav.GetMethod import com.owncloud.android.lib.common.operations.RemoteOperationResult - import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_SCHEME -import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME import org.json.JSONObject import java.net.URL import java.util.concurrent.TimeUnit @@ -44,14 +42,21 @@ internal class StatusRequester { * we assume it was a debug setup. */ fun isRedirectedToNonSecureConnection( - redirectedToUnsecureLocationBefore: Boolean, + redirectedToNonSecureLocationBefore: Boolean, baseUrl: String, redirectedUrl: String - ) = redirectedToUnsecureLocationBefore + ) = redirectedToNonSecureLocationBefore || (baseUrl.startsWith(HTTPS_SCHEME) && !redirectedUrl.startsWith(HTTPS_SCHEME)) fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String { + /** Redirection with different endpoint. + * When asking for server.com/status.php and redirected to different.one/, we need to ask different.one/status.php + */ + if (redirectedLocation.endsWith('/')) { + return redirectedLocation.trimEnd('/') + OwnCloudClient.STATUS_PATH + } + if (!redirectedLocation.startsWith("/")) return redirectedLocation val oldLocationURL = URL(oldLocation) @@ -68,7 +73,8 @@ internal class StatusRequester { data class RequestResult( val getMethod: GetMethod, val status: Int, - val redirectedToUnsecureLocation: Boolean + val redirectedToUnsecureLocation: Boolean, + val lastLocation: String ) fun requestAndFollowRedirects(baseLocation: String, client: OwnCloudClient): RequestResult { @@ -85,7 +91,7 @@ internal class StatusRequester { else RemoteOperationResult(getMethod) if (result.redirectedLocation.isNullOrEmpty() || result.isSuccess) { - return RequestResult(getMethod, status, redirectedToUnsecureLocation) + return RequestResult(getMethod, status, redirectedToUnsecureLocation, currentLocation) } else { val nextLocation = updateLocationWithRedirectPath(currentLocation, result.redirectedLocation) redirectedToUnsecureLocation = @@ -104,7 +110,7 @@ internal class StatusRequester { fun handleRequestResult( requestResult: RequestResult, baseUrl: String - ): RemoteOperationResult { + ): RemoteOperationResult { if (!requestResult.status.isSuccess()) return RemoteOperationResult(requestResult.getMethod) @@ -115,25 +121,35 @@ internal class StatusRequester { val ocVersion = OwnCloudVersion(respJSON.getString(NODE_VERSION)) // the version object will be returned even if the version is invalid, no error code; // every app will decide how to act if (ocVersion.isVersionValid() == false) - val result = + val result: RemoteOperationResult = if (requestResult.redirectedToUnsecureLocation) { - RemoteOperationResult(RemoteOperationResult.ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) + RemoteOperationResult(RemoteOperationResult.ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION) } else { - if (baseUrl.startsWith(HTTPS_SCHEME)) RemoteOperationResult( - RemoteOperationResult.ResultCode.OK_SSL - ) + if (baseUrl.startsWith(HTTPS_SCHEME)) RemoteOperationResult(RemoteOperationResult.ResultCode.OK_SSL) else RemoteOperationResult(RemoteOperationResult.ResultCode.OK_NO_SSL) } - result.data = ocVersion + val finalUrl = URL(requestResult.lastLocation) + val finalBaseUrl = URL( + finalUrl.protocol, + finalUrl.host, + finalUrl.port, + finalUrl.file.dropLastWhile { it != '/' }.trimEnd('/') + ) + + result.data = RemoteServerInfo( + ownCloudVersion = ocVersion, + baseUrl = finalBaseUrl.toString(), + isSecureConnection = finalBaseUrl.protocol.startsWith(HTTPS_SCHEME) + ) return result } companion object { /** * Maximum time to wait for a response from the server when the connection is being tested, - * in MILLISECONDs. + * in milliseconds. */ - private const val TRY_CONNECTION_TIMEOUT: Long = 5000 + private const val TRY_CONNECTION_TIMEOUT = 5_000L private const val NODE_INSTALLED = "installed" private const val NODE_VERSION = "version" } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt index 121f617f..911b2b80 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/ServerInfoService.kt @@ -25,10 +25,10 @@ package com.owncloud.android.lib.resources.status.services import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult -import com.owncloud.android.lib.resources.status.OwnCloudVersion +import com.owncloud.android.lib.resources.status.RemoteServerInfo interface ServerInfoService { fun checkPathExistence(path: String, isUserLogged: Boolean, client: OwnCloudClient): RemoteOperationResult - fun getRemoteStatus(path: String, client: OwnCloudClient): RemoteOperationResult + fun getRemoteStatus(path: String, client: OwnCloudClient): RemoteOperationResult } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt index 65b85479..0dbae093 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/services/implementation/OCServerInfoService.kt @@ -23,7 +23,7 @@ import com.owncloud.android.lib.common.OwnCloudClient import com.owncloud.android.lib.common.operations.RemoteOperationResult import com.owncloud.android.lib.resources.files.CheckPathExistenceRemoteOperation import com.owncloud.android.lib.resources.status.GetRemoteStatusOperation -import com.owncloud.android.lib.resources.status.OwnCloudVersion +import com.owncloud.android.lib.resources.status.RemoteServerInfo import com.owncloud.android.lib.resources.status.services.ServerInfoService class OCServerInfoService : ServerInfoService { @@ -41,6 +41,6 @@ class OCServerInfoService : ServerInfoService { override fun getRemoteStatus( path: String, client: OwnCloudClient - ): RemoteOperationResult = + ): RemoteOperationResult = GetRemoteStatusOperation().execute(client) } From f248448e0877bf56134fe1d59bafac3c8e9fb6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Fri, 26 Feb 2021 15:22:11 +0100 Subject: [PATCH 46/49] Update licenses, naming and apply CR suggestions --- owncloudComLibrary/build.gradle | 2 +- .../android/lib/common/http/CookieJarImpl.kt | 37 ++++++++--- .../android/lib/common/http/HttpClient.java | 29 ++++----- .../lib/resources/status/HttpScheme.kt | 2 +- .../lib/resources/status/RemoteServerInfo.kt | 2 +- .../lib/resources/status/StatusRequester.kt | 2 +- .../owncloud/android/lib/CookieJarImplTest.kt | 62 +++++++++++-------- .../lib/GetRemoteStatusOperationTest.kt | 39 +++++++++--- ...equestorTest.kt => StatusRequesterTest.kt} | 35 ++++++----- 9 files changed, 135 insertions(+), 75 deletions(-) rename owncloudComLibrary/src/test/java/com/owncloud/android/lib/{StatusRequestorTest.kt => StatusRequesterTest.kt} (80%) diff --git a/owncloudComLibrary/build.gradle b/owncloudComLibrary/build.gradle index 85232e93..5c6bc1a7 100644 --- a/owncloudComLibrary/build.gradle +++ b/owncloudComLibrary/build.gradle @@ -9,7 +9,7 @@ dependencies { api 'com.github.AppDevNext.Logcat:LogcatCore:2.2.2' // Moshi - implementation ("com.squareup.moshi:moshi-kotlin:$moshiVersion") { + implementation("com.squareup.moshi:moshi-kotlin:$moshiVersion") { exclude module: "kotlin-reflect" } kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshiVersion" diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt index 83ad8f5c..ae76424e 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/CookieJarImpl.kt @@ -1,3 +1,26 @@ +/* ownCloud Android Library is available under MIT license + * Copyright (C) 2021 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ package com.owncloud.android.lib.common.http import okhttp3.Cookie @@ -11,27 +34,27 @@ class CookieJarImpl( fun containsCookieWithName(cookies: List, name: String): Boolean { for (cookie: Cookie in cookies) { if (cookie.name == name) { - return true; + return true } } - return false; + return false } fun getUpdatedCookies(oldCookies: List, newCookies: List): List { - val updatedList = ArrayList(newCookies); + val updatedList = ArrayList(newCookies) for (oldCookie: Cookie in oldCookies) { if (!containsCookieWithName(updatedList, oldCookie.name)) { - updatedList.add(oldCookie); + updatedList.add(oldCookie) } } - return updatedList; + return updatedList } override fun saveFromResponse(url: HttpUrl, cookies: List) { // Avoid duplicated cookies but update val currentCookies: List = sCookieStore[url.host] ?: ArrayList() - val updatedCookies: List = getUpdatedCookies(currentCookies, cookies); - sCookieStore[url.host] = updatedCookies; + val updatedCookies: List = getUpdatedCookies(currentCookies, cookies) + sCookieStore[url.host] = updatedCookies } override fun loadForRequest(url: HttpUrl) = diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java index 7a904c93..046dc711 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpClient.java @@ -33,6 +33,7 @@ import okhttp3.CookieJar; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Protocol; +import okhttp3.TlsVersion; import timber.log.Timber; import javax.net.ssl.SSLContext; @@ -41,7 +42,7 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; -import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.concurrent.TimeUnit; @@ -80,18 +81,18 @@ public class HttpClient { private static SSLContext getSslContext() throws NoSuchAlgorithmException { try { - return SSLContext.getInstance("TLSv1.3"); + return SSLContext.getInstance(TlsVersion.TLS_1_3.javaName()); } catch (NoSuchAlgorithmException tlsv13Exception) { try { Timber.w("TLSv1.3 is not supported in this device; falling through TLSv1.2"); - return SSLContext.getInstance("TLSv1.2"); + return SSLContext.getInstance(TlsVersion.TLS_1_2.javaName()); } catch (NoSuchAlgorithmException tlsv12Exception) { try { Timber.w("TLSv1.2 is not supported in this device; falling through TLSv1.1"); - return SSLContext.getInstance("TLSv1.1"); + return SSLContext.getInstance(TlsVersion.TLS_1_1.javaName()); } catch (NoSuchAlgorithmException tlsv11Exception) { Timber.w("TLSv1.1 is not supported in this device; falling through TLSv1.0"); - return SSLContext.getInstance("TLSv1"); + return SSLContext.getInstance(TlsVersion.TLS_1_0.javaName()); // should be available in any device; see reference of supported protocols in // http://developer.android.com/reference/javax/net/ssl/SSLSocket.html } @@ -110,7 +111,7 @@ public class HttpClient { CookieJar cookieJar) { return new OkHttpClient.Builder() .addNetworkInterceptor(getLogInterceptor()) - .protocols(Arrays.asList(Protocol.HTTP_1_1)) + .protocols(Collections.singletonList(Protocol.HTTP_1_1)) .readTimeout(HttpConstants.DEFAULT_DATA_TIMEOUT, TimeUnit.MILLISECONDS) .writeTimeout(HttpConstants.DEFAULT_DATA_TIMEOUT, TimeUnit.MILLISECONDS) .connectTimeout(HttpConstants.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS) @@ -121,14 +122,6 @@ public class HttpClient { .build(); } - public Context getContext() { - return sContext; - } - - public static void setContext(Context context) { - sContext = context; - } - public static LogInterceptor getLogInterceptor() { if (sLogInterceptor == null) { sLogInterceptor = new LogInterceptor(); @@ -140,6 +133,14 @@ public class HttpClient { return sCookieStore.get(httpUrl.host()); } + public Context getContext() { + return sContext; + } + + public static void setContext(Context context) { + sContext = context; + } + public void clearCookies() { sCookieStore.clear(); } diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt index 48659324..ff3e3662 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/HttpScheme.kt @@ -1,5 +1,5 @@ /* ownCloud Android Library is available under MIT license -* Copyright (C) 2020 ownCloud GmbH. +* Copyright (C) 2021 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt index 5938368d..7163fd4a 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/RemoteServerInfo.kt @@ -1,5 +1,5 @@ /* ownCloud Android Library is available under MIT license -* Copyright (C) 2020 ownCloud GmbH. +* Copyright (C) 2021 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt index 842c7d36..8706a185 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/StatusRequester.kt @@ -1,5 +1,5 @@ /* ownCloud Android Library is available under MIT license -* Copyright (C) 2020 ownCloud GmbH. +* Copyright (C) 2021 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt index f0e62a1f..7e1d7691 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/CookieJarImplTest.kt @@ -1,47 +1,57 @@ +/* ownCloud Android Library is available under MIT license + * Copyright (C) 2021 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ package com.owncloud.android.lib import com.owncloud.android.lib.common.http.CookieJarImpl -import junit.framework.Assert.assertEquals -import junit.framework.Assert.assertFalse -import junit.framework.Assert.assertTrue import okhttp3.Cookie import okhttp3.HttpUrl.Companion.toHttpUrl +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue import org.junit.Test class CookieJarImplTest { - private val oldCookies = ArrayList().apply { - add(COOKIE_A) - add(COOKIE_B_OLD) - } - - private val newCookies = ArrayList().apply { - add(COOKIE_B_NEW) - } - - private val updatedCookies = ArrayList().apply { - add(COOKIE_A) - add(COOKIE_B_NEW) - } - - private val cookieStore = HashMap>().apply { - put(SOME_HOST, oldCookies) - } + private val oldCookies = listOf(COOKIE_A, COOKIE_B_OLD) + private val newCookies = listOf(COOKIE_B_NEW) + private val updatedCookies = listOf(COOKIE_A, COOKIE_B_NEW) + private val cookieStore = hashMapOf(SOME_HOST to oldCookies) private val cookieJarImpl = CookieJarImpl(cookieStore) @Test - fun testContainsCookieWithNameReturnsTrue() { + fun `contains cookie with name - ok - true`() { assertTrue(cookieJarImpl.containsCookieWithName(oldCookies, COOKIE_B_OLD.name)) } @Test - fun testContainsCookieWithNameReturnsFalse() { + fun `contains cookie with name - ok - false`() { assertFalse(cookieJarImpl.containsCookieWithName(newCookies, COOKIE_A.name)) } @Test - fun testGetUpdatedCookies() { + fun `get updated cookies - ok`() { val generatedUpdatedCookies = cookieJarImpl.getUpdatedCookies(oldCookies, newCookies) assertEquals(2, generatedUpdatedCookies.size) assertEquals(updatedCookies[0], generatedUpdatedCookies[1]) @@ -49,7 +59,7 @@ class CookieJarImplTest { } @Test - fun testCookieStoreUpdateViaSaveFromResponse() { + fun `store cookie via saveFromResponse - ok`() { cookieJarImpl.saveFromResponse(SOME_URL, newCookies) val generatedUpdatedCookies = cookieStore[SOME_HOST] assertEquals(2, generatedUpdatedCookies?.size) @@ -58,7 +68,7 @@ class CookieJarImplTest { } @Test - fun testLoadForRequest() { + fun `load for request - ok`() { val cookies = cookieJarImpl.loadForRequest(SOME_URL) assertEquals(oldCookies[0], cookies[0]) assertEquals(oldCookies[1], cookies[1]) @@ -71,4 +81,4 @@ class CookieJarImplTest { val COOKIE_B_OLD = Cookie.parse(SOME_URL, "CookieB=CookieOldValueB")!! val COOKIE_B_NEW = Cookie.parse(SOME_URL, "CookieB=CookieNewValueB")!! } -} \ No newline at end of file +} diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt index 8cb93022..375e9aa5 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/GetRemoteStatusOperationTest.kt @@ -1,3 +1,26 @@ +/* ownCloud Android Library is available under MIT license + * Copyright (C) 2021 ownCloud GmbH. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + */ package com.owncloud.android.lib import android.net.Uri @@ -59,10 +82,9 @@ class GetRemoteStatusOperationTest { @Test fun `build full https url - ok - no https with subdir`() { assertEquals( - Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( - Uri.parse( - HTTPS_SOME_OWNCLOUD_WITH_SUBDIR - ) + Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), + GetRemoteStatusOperation.buildFullHttpsUrl( + Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR) ) ) } @@ -70,10 +92,9 @@ class GetRemoteStatusOperationTest { @Test fun `build full https url - ok - no prefix with subdir`() { assertEquals( - Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), GetRemoteStatusOperation.buildFullHttpsUrl( - Uri.parse( - SOME_OWNCLOUD_WITH_SUBDIR - ) + Uri.parse(HTTPS_SOME_OWNCLOUD_WITH_SUBDIR), + GetRemoteStatusOperation.buildFullHttpsUrl( + Uri.parse(SOME_OWNCLOUD_WITH_SUBDIR) ) ) } @@ -121,4 +142,4 @@ class GetRemoteStatusOperationTest { const val HTTP_SOME_IP_WITH_PORT = "$HTTP_PREFIX$SOME_IP_WITH_PORT" const val HTTPS_SOME_IP_WITH_PORT = "$HTTPS_PREFIX$SOME_IP_WITH_PORT" } -} \ No newline at end of file +} diff --git a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequesterTest.kt similarity index 80% rename from owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt rename to owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequesterTest.kt index 2ea243c5..20b1c668 100644 --- a/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequestorTest.kt +++ b/owncloudComLibrary/src/test/java/com/owncloud/android/lib/StatusRequesterTest.kt @@ -1,5 +1,5 @@ /* ownCloud Android Library is available under MIT license -* Copyright (C) 2020 ownCloud GmbH. +* Copyright (C) 2021 ownCloud GmbH. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -30,7 +30,7 @@ import org.junit.Assert.assertFalse import org.junit.Assert.assertTrue import org.junit.Test -class StatusRequestorTest { +class StatusRequesterTest { private val requester = StatusRequester() @Test @@ -53,40 +53,45 @@ class StatusRequestorTest { @Test fun `update location - ok - replace relative path`() { - val newLocation = requester.updateLocationWithRedirectPath( - "$TEST_DOMAIN/some/other/subdir", SUB_PATH - ) + val newLocation = requester.updateLocationWithRedirectPath("$TEST_DOMAIN/some/other/subdir", SUB_PATH) assertEquals("$TEST_DOMAIN$SUB_PATH", newLocation) } @Test fun `check redirect to unsecure connection - ok - redirect to http`() { - assertTrue(requester.isRedirectedToNonSecureConnection( - false, SECURE_DOMAIN, UNSECURE_DOMAIN)) + assertTrue( + requester.isRedirectedToNonSecureConnection(false, SECURE_DOMAIN, UNSECURE_DOMAIN + ) + ) } @Test fun `check redirect to unsecure connection - ko - redirect to https from http`() { - assertFalse(requester.isRedirectedToNonSecureConnection( - false, UNSECURE_DOMAIN, SECURE_DOMAIN)) + assertFalse( + requester.isRedirectedToNonSecureConnection(false, UNSECURE_DOMAIN, SECURE_DOMAIN + ) + ) } @Test fun `check redirect to unsecure connection - ko - from https to https`() { - assertFalse(requester.isRedirectedToNonSecureConnection( - false, SECURE_DOMAIN, SECURE_DOMAIN)) + assertFalse( + requester.isRedirectedToNonSecureConnection(false, SECURE_DOMAIN, SECURE_DOMAIN) + ) } @Test fun `check redirect to unsecure connection - ok - from https to https with previous http`() { - assertTrue(requester.isRedirectedToNonSecureConnection( - true, SECURE_DOMAIN, SECURE_DOMAIN)) + assertTrue( + requester.isRedirectedToNonSecureConnection(true, SECURE_DOMAIN, SECURE_DOMAIN) + ) } @Test fun `check redirect to unsecure connection - ok - from http to http`() { - assertFalse(requester.isRedirectedToNonSecureConnection( - false, UNSECURE_DOMAIN, UNSECURE_DOMAIN)) + assertFalse( + requester.isRedirectedToNonSecureConnection(false, UNSECURE_DOMAIN, UNSECURE_DOMAIN) + ) } companion object { From 46495e0df2897c042c0783b775728b1b66ad9854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Mon, 8 Mar 2021 16:26:20 +0100 Subject: [PATCH 47/49] Update versionCode and versionName --- owncloudComLibrary/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/owncloudComLibrary/build.gradle b/owncloudComLibrary/build.gradle index 5c6bc1a7..2fece952 100644 --- a/owncloudComLibrary/build.gradle +++ b/owncloudComLibrary/build.gradle @@ -25,8 +25,8 @@ android { minSdkVersion 21 targetSdkVersion 29 - versionCode = 10000900 - versionName = "1.0.9" + versionCode = 10000901 + versionName = "1.0.10-beta.1" } lintOptions { From a60c4909f4d892e1afcd89c94ca95f91b48ce988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 16 Mar 2021 11:11:39 +0100 Subject: [PATCH 48/49] Prepare 1.0.10 release --- owncloudComLibrary/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/owncloudComLibrary/build.gradle b/owncloudComLibrary/build.gradle index 2fece952..90ffbcd6 100644 --- a/owncloudComLibrary/build.gradle +++ b/owncloudComLibrary/build.gradle @@ -25,8 +25,8 @@ android { minSdkVersion 21 targetSdkVersion 29 - versionCode = 10000901 - versionName = "1.0.10-beta.1" + versionCode = 10001000 + versionName = "1.0.10" } lintOptions { From 663e067d08b469eefe65af91f12dddb10d3a80a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Abel=20Garci=CC=81a=20de=20Prada?= Date: Tue, 16 Mar 2021 12:40:51 +0100 Subject: [PATCH 49/49] Update client with latest url --- .../android/lib/resources/status/GetRemoteStatusOperation.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt index eeb2aadf..f4e1d452 100644 --- a/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt +++ b/owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/status/GetRemoteStatusOperation.kt @@ -31,6 +31,7 @@ import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCo import com.owncloud.android.lib.resources.status.HttpScheme.HTTPS_PREFIX import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_PREFIX import com.owncloud.android.lib.resources.status.HttpScheme.HTTP_SCHEME +import okhttp3.HttpUrl.Companion.toHttpUrl import org.json.JSONException import timber.log.Timber @@ -63,7 +64,9 @@ class GetRemoteStatusOperation : RemoteOperation() { return try { val requester = StatusRequester() val requestResult = requester.requestAndFollowRedirects(baseUrl, client) - requester.handleRequestResult(requestResult, baseUrl) + requester.handleRequestResult(requestResult, baseUrl).also { + client.baseUri = Uri.parse(it.data.baseUrl) + } } catch (e: JSONException) { RemoteOperationResult(ResultCode.INSTANCE_NOT_CONFIGURED) } catch (e: Exception) {