OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Use 200..299 ranges to replicate Net::HTTPSuccess.
Pavel Balashou12a3e7ccb2e1
diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rbindex 1e4f7ad154d..d17f154ee30 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/add_user_to_group_command.rb@@ -60,7 +60,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self.class, payload: response)case response.status- when 200+ when 200..299statuscode = Nokogiri::XML(response.body.to_s).xpath('/ocs/meta/statuscode').textcase statuscodediff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/copy_template_folder_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/copy_template_folder_command.rbindex bbf24cc8f80..02b18ef645d 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/copy_template_folder_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/copy_template_folder_command.rb@@ -85,7 +85,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloud.head(urls[:destination_url])case response.status- when 200+ when 200..299Util.error(:conflict, 'Destination folder already exists.')when 401Util.error(:unauthorized, "unauthorized (validate_destination)")@@ -110,7 +110,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloud})case response.status- when 201+ when 200..299ServiceResult.success(message: 'Folder was successfully copied')when 401Util.error(:unauthorized, "Unauthorized (copy_folder)")diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/create_folder_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/create_folder_command.rbindex 619996c98c8..28b35600c6b 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/create_folder_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/create_folder_command.rb@@ -59,7 +59,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self.class, payload: response)case response.status- when 201+ when 200..299ServiceResult.success(message: 'Folder was successfully created.')when 405if Util.error_text_from_response(response) == 'The resource you tried to create already exists'diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/download_link_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/download_link_query.rbindex 186645748a9..eb9c5950bbe 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/download_link_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/download_link_query.rb@@ -58,7 +58,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloud})case response.status- when 200+ when 200..299ServiceResult.success(result: response)when 404Util.error(:not_found, 'Outbound request destination not found!', response)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rbindex 9716db0819c..1343d38cc44 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_info_query.rb@@ -60,7 +60,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloud.get(Util.join_uri_path(@uri, FILE_INFO_PATH, file_id))case response.status- when 200+ when 200..299ServiceResult.success(result: response.body)when 404Util.error(:not_found, 'Outbound request destination not found!', response)@@ -82,7 +82,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouddef handle_failure->(response_object) docase response_object.ocs.data.statuscode- when 200+ when 200..299ServiceResult.success(result: response_object)when 403Util.error(:forbidden, 'Access to storage file forbidden!', response_object)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rbindex 96dad117732..c3224e7d82d 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_info_query.rb@@ -70,7 +70,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloudjson: { fileIds: file_ids })case response.status- when 200+ when 200..299ServiceResult.success(result: response.body.to_s)when 404Util.error(:not_found, 'Outbound request destination not found!', response)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rbindex bdd0455219a..9abbab32c3d 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/files_query.rb@@ -65,7 +65,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self, payload: response)case response.status- when 207+ when 200..299ServiceResult.success(result: response.body)when 404Util.error(:not_found, 'Outbound request destination not found', error_data)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rbindex de17d4c6021..67c21602fa9 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/group_users_query.rb@@ -53,7 +53,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self.class, payload: response)case response.status- when 200+ when 200..299group_users = Nokogiri::XML(response.body.to_s).xpath('/ocs/data/users/element').map(&:text)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rbindex 2472fbcd575..9e9ba9db898 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/internal/delete_entity_command.rb@@ -50,7 +50,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloud::InternalUTIL.escape_path(location)))case response.status- when 204+ when 200..299ServiceResult.successwhen 404UTIL.error(:not_found)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rbindex 5a2110fa0db..7a7e06441fc 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/remove_user_from_group_command.rb@@ -57,7 +57,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self.class, payload: response)case response.status- when 200+ when 200..299statuscode = Nokogiri::XML(response.body.to_s).xpath('/ocs/meta/statuscode').textcase statuscodewhen "100"diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rbindex 09973734337..15164b124db 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/rename_file_command.rb@@ -58,7 +58,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self.class, payload: response)case response.status- when 201+ when 200..299ServiceResult.successwhen 404Util.error(:not_found, 'Outbound request destination not found', error_data)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rbindex 2e767d916eb..fc1143a2529 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/set_permissions_command.rb@@ -94,7 +94,7 @@ module Storages::Peripherals::StorageInteraction::Nextclouderror_data = Storages::StorageErrorData.new(source: self.class, payload: response)case response.status- when 207+ when 200..299doc = Nokogiri::XML(response.body.to_s)if doc.xpath("/d:multistatus/d:response/d:propstat[d:status[text() = 'HTTP/1.1 200 OK']]/d:prop/nc:acl-list").present?ServiceResult.success(result: :success)diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/upload_link_query.rb b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/upload_link_query.rbindex 0b41fc73def..91a42e49f4c 100644--- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/upload_link_query.rb+++ b/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/upload_link_query.rb@@ -76,7 +76,7 @@ module Storages::Peripherals::StorageInteraction::Nextcloudjson: payload)case response.status- when 200+ when 200..299# The nextcloud API returns a successful response with empty body if the authorization is missing or expiredif response.body.present?ServiceResult.success(diff --git a/modules/storages/app/validator/nextcloud_application_credentials_validator.rb b/modules/storages/app/validator/nextcloud_application_credentials_validator.rbindex 70e544db5f8..5b1c6b677a8 100644--- a/modules/storages/app/validator/nextcloud_application_credentials_validator.rb+++ b/modules/storages/app/validator/nextcloud_application_credentials_validator.rb@@ -43,7 +43,7 @@ class NextcloudApplicationCredentialsValidator.basic_auth(contract.username, contract.password).head(UTIL.join_uri_path(uri, "remote.php/dav"))case response.status- when 200+ when 200..299truewhen 401contract.errors.add(:password, :invalid_password)